Skip to content

Commit a1b84b0

Browse files
committed
Merge from main
1 parent 28e89d6 commit a1b84b0

14 files changed

+876
-291
lines changed

doc/api_reference/session.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Construct Session instance with API credentials.
2323
:param Array [options.serverInformationValues=[]]: Optional list of server information values to retrieve.
2424
:param Object [options.eventHubOptions={}]: Options to configure event hub with.
2525
:param string [options.clientToken=null]: Client identifier included in update events caused by operations performed by this session.
26+
:param Object [options.headers]: Additional headers to send with the request
27+
:param Object [options.strictApi]: Turn on strict API mode
2628

2729
Function ``call``
2830
=================
@@ -45,8 +47,12 @@ ServerError
4547

4648
4749
:param Array operations: API operations.
50+
:param Object [options]: options
51+
:param Object [options.abortController]: - Deprecated in favour of options.signal
52+
:param Object [options.signal]: - Abort signal user for aborting requests prematurely
53+
:param Object [options.headers]: - Additional headers to send with the request
4854

49-
55+
:return Promise: Promise which will be resolved with an array of decoded responses.
5056

5157
Function ``getSchema``
5258
======================

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"@rollup/plugin-commonjs": "^24.0.1",
2525
"@types/uuid": "^9.0.0",
2626
"cross-fetch": "^3.1.5",
27+
"dayjs": "^1.11.7",
2728
"eslint": "^8.33.0",
2829
"eslint-config-react-app": "^7.0.1",
2930
"jsdom": "^21.1.0",

source/project_schema.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import * as operation from "./operation";
44
import { Session } from "./session";
5-
5+
import { Data, QueryResponse } from "./types";
66
/**
77
* Project schema namespace
88
* @namespace project_schema
@@ -71,7 +71,7 @@ export function getStatuses(
7171
)
7272
);
7373

74-
response = session.call(operations);
74+
response = session.call<QueryResponse<Data>>(operations);
7575
response = response.then((results) => {
7676
// Since the operations where performed in one batched call,
7777
// the result will be merged into a single entity.
@@ -97,9 +97,12 @@ export function getStatuses(
9797
} else if (entityType === "AssetVersion") {
9898
statuses = data._version_workflow.statuses;
9999
} else {
100-
const schema = session.getSchema(entityType) as any;
100+
const schema = session.getSchema(entityType);
101101

102-
if (schema && schema.alias_for && schema.alias_for.id === "Task") {
102+
if (
103+
typeof schema?.alias_for === "object" &&
104+
schema.alias_for.id === "Task"
105+
) {
103106
const objectTypeId = schema.alias_for.classifiers.object_typeid;
104107

105108
for (const index in data._schemas) {

0 commit comments

Comments
 (0)