Skip to content

Commit

Permalink
Merge from main
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmycallin committed Mar 15, 2023
1 parent 28e89d6 commit a1b84b0
Show file tree
Hide file tree
Showing 14 changed files with 876 additions and 291 deletions.
8 changes: 7 additions & 1 deletion doc/api_reference/session.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Construct Session instance with API credentials.
:param Array [options.serverInformationValues=[]]: Optional list of server information values to retrieve.
:param Object [options.eventHubOptions={}]: Options to configure event hub with.
:param string [options.clientToken=null]: Client identifier included in update events caused by operations performed by this session.
:param Object [options.headers]: Additional headers to send with the request
:param Object [options.strictApi]: Turn on strict API mode

Function ``call``
=================
Expand All @@ -45,8 +47,12 @@ ServerError

:param Array operations: API operations.
:param Object [options]: options
:param Object [options.abortController]: - Deprecated in favour of options.signal
:param Object [options.signal]: - Abort signal user for aborting requests prematurely
:param Object [options.headers]: - Additional headers to send with the request


:return Promise: Promise which will be resolved with an array of decoded responses.

Function ``getSchema``
======================
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@rollup/plugin-commonjs": "^24.0.1",
"@types/uuid": "^9.0.0",
"cross-fetch": "^3.1.5",
"dayjs": "^1.11.7",
"eslint": "^8.33.0",
"eslint-config-react-app": "^7.0.1",
"jsdom": "^21.1.0",
Expand Down
11 changes: 7 additions & 4 deletions source/project_schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import * as operation from "./operation";
import { Session } from "./session";

import { Data, QueryResponse } from "./types";
/**
* Project schema namespace
* @namespace project_schema
Expand Down Expand Up @@ -71,7 +71,7 @@ export function getStatuses(
)
);

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

if (schema && schema.alias_for && schema.alias_for.id === "Task") {
if (
typeof schema?.alias_for === "object" &&
schema.alias_for.id === "Task"
) {
const objectTypeId = schema.alias_for.classifiers.object_typeid;

for (const index in data._schemas) {
Expand Down
Loading

0 comments on commit a1b84b0

Please sign in to comment.