@shapediver/sdk.geometry-api-sdk-v2 2.1.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -14
- package/dist/client/api.d.ts +27 -2
- package/dist/client/api.d.ts.map +1 -1
- package/dist/client/api.js.map +1 -1
- package/dist/configuration.d.ts +1 -1
- package/dist/configuration.js +1 -1
- package/dist/error.d.ts +6 -6
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js +12 -12
- package/dist/error.js.map +1 -1
- package/dist/utils.d.ts +2 -2
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +4 -4
- package/dist/utils.js.map +1 -1
- package/package.json +2 -1
- package/src/client/api.ts +132 -5
- package/src/client/base.ts +1 -1
- package/src/client/common.ts +1 -1
- package/src/client/configuration.ts +1 -1
- package/src/client/index.ts +1 -1
- package/src/configuration.ts +1 -1
- package/src/error.ts +17 -17
- package/src/utils.ts +8 -9
package/dist/configuration.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export interface ConfigurationParameters extends Pick<ClientConfigParams, 'acces
|
|
|
6
6
|
maxRetries?: number;
|
|
7
7
|
}
|
|
8
8
|
export declare class Configuration extends ClientConfig {
|
|
9
|
-
protected readonly sdkVersion = "2.
|
|
9
|
+
protected readonly sdkVersion = "2.3.0";
|
|
10
10
|
readonly useCustomAxios: boolean;
|
|
11
11
|
readonly maxRetries: number;
|
|
12
12
|
constructor(param?: ConfigurationParameters);
|
package/dist/configuration.js
CHANGED
|
@@ -6,7 +6,7 @@ class Configuration extends configuration_1.Configuration {
|
|
|
6
6
|
constructor(param = {}) {
|
|
7
7
|
var _a, _b, _c, _d;
|
|
8
8
|
super(param);
|
|
9
|
-
this.sdkVersion = '2.
|
|
9
|
+
this.sdkVersion = '2.3.0';
|
|
10
10
|
this.useCustomAxios = (_a = param.useCustomAxios) !== null && _a !== void 0 ? _a : true;
|
|
11
11
|
this.maxRetries = (_b = param.maxRetries) !== null && _b !== void 0 ? _b : 5;
|
|
12
12
|
this.baseOptions = (_c = this.baseOptions) !== null && _c !== void 0 ? _c : {};
|
package/dist/error.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { ResErrorType } from './client';
|
|
2
|
-
export declare class
|
|
3
|
-
constructor(message
|
|
2
|
+
export declare class SdGeometryError extends Error {
|
|
3
|
+
constructor(message?: string);
|
|
4
4
|
}
|
|
5
|
-
export declare class
|
|
5
|
+
export declare class RequestError extends SdGeometryError {
|
|
6
6
|
constructor(message: string);
|
|
7
7
|
}
|
|
8
|
-
export declare class
|
|
8
|
+
export declare class ResponseError extends SdGeometryError {
|
|
9
9
|
readonly status: number;
|
|
10
10
|
readonly type: ResErrorType;
|
|
11
11
|
readonly description: string;
|
|
12
12
|
constructor(status: number, message: string, desc: string, type?: string);
|
|
13
13
|
}
|
|
14
|
-
export declare class IllegalArgumentError extends
|
|
14
|
+
export declare class IllegalArgumentError extends SdGeometryError {
|
|
15
15
|
field: string;
|
|
16
16
|
constructor(field: string, msg?: string);
|
|
17
17
|
}
|
|
18
|
-
export declare class TimeoutError extends
|
|
18
|
+
export declare class TimeoutError extends SdGeometryError {
|
|
19
19
|
field: string;
|
|
20
20
|
constructor(field: string, msg?: string);
|
|
21
21
|
}
|
package/dist/error.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAUxC,qBAAa,
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAUxC,qBAAa,eAAgB,SAAQ,KAAK;gBAC1B,OAAO,CAAC,EAAE,MAAM;CAI/B;AAUD,qBAAa,YAAa,SAAQ,eAAe;gBACjC,OAAO,EAAE,MAAM;CAI9B;AAWD,qBAAa,aAAc,SAAQ,eAAe;IAE9C,SAAgB,MAAM,EAAE,MAAM,CAAC;IAG/B,SAAgB,IAAI,EAAE,YAAY,CAAC;IAGnC,SAAgB,WAAW,EAAE,MAAM,CAAC;gBAExB,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM;CAU3E;AAOD,qBAAa,oBAAqB,SAAQ,eAAe;IAE1C,KAAK,EAAE,MAAM;gBAAb,KAAK,EAAE,MAAM,EACpB,GAAG,CAAC,EAAE,MAAM;CAKnB;AAOD,qBAAa,YAAa,SAAQ,eAAe;IAElC,KAAK,EAAE,MAAM;gBAAb,KAAK,EAAE,MAAM,EACpB,GAAG,CAAC,EAAE,MAAM;CAKnB"}
|
package/dist/error.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TimeoutError = exports.IllegalArgumentError = exports.
|
|
3
|
+
exports.TimeoutError = exports.IllegalArgumentError = exports.ResponseError = exports.RequestError = exports.SdGeometryError = void 0;
|
|
4
4
|
const client_1 = require("./client");
|
|
5
|
-
class
|
|
5
|
+
class SdGeometryError extends Error {
|
|
6
6
|
constructor(message) {
|
|
7
7
|
super(message);
|
|
8
|
-
this.name = '
|
|
8
|
+
this.name = 'SdGeometryError';
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
exports.
|
|
12
|
-
class
|
|
11
|
+
exports.SdGeometryError = SdGeometryError;
|
|
12
|
+
class RequestError extends SdGeometryError {
|
|
13
13
|
constructor(message) {
|
|
14
14
|
super(message);
|
|
15
|
-
this.name = '
|
|
15
|
+
this.name = 'RequestError';
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
exports.
|
|
19
|
-
class
|
|
18
|
+
exports.RequestError = RequestError;
|
|
19
|
+
class ResponseError extends SdGeometryError {
|
|
20
20
|
constructor(status, message, desc, type) {
|
|
21
21
|
super(message);
|
|
22
|
-
this.name = '
|
|
22
|
+
this.name = 'ResponseError';
|
|
23
23
|
this.status = status;
|
|
24
24
|
this.description = desc;
|
|
25
25
|
this.type =
|
|
@@ -28,8 +28,8 @@ class SdResponseError extends Error {
|
|
|
28
28
|
: client_1.ResErrorType.UNKNOWN;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
exports.
|
|
32
|
-
class IllegalArgumentError extends
|
|
31
|
+
exports.ResponseError = ResponseError;
|
|
32
|
+
class IllegalArgumentError extends SdGeometryError {
|
|
33
33
|
constructor(field, msg) {
|
|
34
34
|
super(msg);
|
|
35
35
|
this.field = field;
|
|
@@ -37,7 +37,7 @@ class IllegalArgumentError extends Error {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
exports.IllegalArgumentError = IllegalArgumentError;
|
|
40
|
-
class TimeoutError extends
|
|
40
|
+
class TimeoutError extends SdGeometryError {
|
|
41
41
|
constructor(field, msg) {
|
|
42
42
|
super(msg);
|
|
43
43
|
this.field = field;
|
package/dist/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";;;AAAA,qCAAwC;AAUxC,MAAa,
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";;;AAAA,qCAAwC;AAUxC,MAAa,eAAgB,SAAQ,KAAK;IACtC,YAAY,OAAgB;QACxB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAClC,CAAC;CACJ;AALD,0CAKC;AAUD,MAAa,YAAa,SAAQ,eAAe;IAC7C,YAAY,OAAe;QACvB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;IAC/B,CAAC;CACJ;AALD,oCAKC;AAWD,MAAa,aAAc,SAAQ,eAAe;IAU9C,YAAY,MAAc,EAAE,OAAe,EAAE,IAAY,EAAE,IAAa;QACpE,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QAC5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,IAAI;YACL,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,qBAAY,CAAC,CAAC,QAAQ,CAAC,IAAoB,CAAC;gBAC9D,CAAC,CAAE,IAAqB;gBACxB,CAAC,CAAC,qBAAY,CAAC,OAAO,CAAC;IACnC,CAAC;CACJ;AApBD,sCAoBC;AAOD,MAAa,oBAAqB,SAAQ,eAAe;IACrD,YACW,KAAa,EACpB,GAAY;QAEZ,KAAK,CAAC,GAAG,CAAC,CAAC;QAHJ,UAAK,GAAL,KAAK,CAAQ;QAIpB,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACvC,CAAC;CACJ;AARD,oDAQC;AAOD,MAAa,YAAa,SAAQ,eAAe;IAC7C,YACW,KAAa,EACpB,GAAY;QAEZ,KAAK,CAAC,GAAG,CAAC,CAAC;QAHJ,UAAK,GAAL,KAAK,CAAQ;QAIpB,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;IAC/B,CAAC;CACJ;AARD,oCAQC"}
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosError, AxiosPromise } from 'axios';
|
|
2
|
-
import {
|
|
2
|
+
import { RequestError, ResponseError } from './error';
|
|
3
3
|
export declare function sleep(ms: number): Promise<void>;
|
|
4
4
|
export declare function extractFileInfo(headers: Record<string, any> | undefined): {
|
|
5
5
|
size: number | undefined;
|
|
@@ -8,5 +8,5 @@ export declare function extractFileInfo(headers: Record<string, any> | undefined
|
|
|
8
8
|
export declare function contentDispositionFromFilename(filename: string): string;
|
|
9
9
|
export declare function filenameFromContentDisposition(contentDisposition: string): string | undefined;
|
|
10
10
|
export declare function exists(apiCall: () => AxiosPromise<unknown>): Promise<boolean>;
|
|
11
|
-
export declare function processError(error: AxiosError | Error):
|
|
11
|
+
export declare function processError(error: AxiosError | Error): Error | RequestError | ResponseError;
|
|
12
12
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAGtD,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/C;AAOD,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,GAAG;IACvE,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC,CAcA;AAOD,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAWvE;AAQD,wBAAgB,8BAA8B,CAAC,kBAAkB,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAmB7F;AAUD,wBAAsB,MAAM,CAAC,OAAO,EAAE,MAAM,YAAY,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAOnF;AAOD,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,KAAK,GAAG,KAAK,GAAG,YAAY,GAAG,aAAa,CAyB5F"}
|
package/dist/utils.js
CHANGED
|
@@ -77,17 +77,17 @@ function processError(error) {
|
|
|
77
77
|
typeof data.error === 'string' &&
|
|
78
78
|
'message' in data &&
|
|
79
79
|
typeof data.message === 'string') {
|
|
80
|
-
return new error_1.
|
|
80
|
+
return new error_1.ResponseError(status, data.message, data.desc, data.error);
|
|
81
81
|
}
|
|
82
82
|
else {
|
|
83
|
-
return new error_1.
|
|
83
|
+
return new error_1.ResponseError(status, err.message, 'No error description provided');
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
else if ('request' in error) {
|
|
87
|
-
return new error_1.
|
|
87
|
+
return new error_1.RequestError(error.message);
|
|
88
88
|
}
|
|
89
89
|
else {
|
|
90
|
-
return
|
|
90
|
+
return error;
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
//# sourceMappingURL=utils.js.map
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;;;;;;;;;AAIA,sBAEC;AAOD,0CAiBC;AAOD,wEAWC;AAQD,wEAmBC;AAUD,wBAOC;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;;;;;;;;;AAIA,sBAEC;AAOD,0CAiBC;AAOD,wEAWC;AAQD,wEAmBC;AAUD,wBAOC;AAOD,oCAyBC;AA3HD,mCAAsD;AAGtD,SAAgB,KAAK,CAAC,EAAU;IAC5B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC7D,CAAC;AAOD,SAAgB,eAAe,CAAC,OAAwC;IAIpE,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAG9D,MAAM,aAAa,GAA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OAAO,IAAI,qBAAa,CAAC,MAAM,EAAE,GAAG,CAAC,OAAO,EAAE,+BAA+B,CAAC,CAAC;QACnF,CAAC;IACL,CAAC;SAAM,IAAI,SAAS,IAAI,KAAK,EAAE,CAAC;QAC5B,OAAO,IAAI,oBAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC;SAAM,CAAC;QACJ,OAAO,KAAK,CAAC;IACjB,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shapediver/sdk.geometry-api-sdk-v2",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "SDK to communicate with the Geometry API version 2",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"shapediver",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"axios": "~1.7.7"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
+
"axios-mock-adapter": "~2.1.0",
|
|
49
50
|
"jest": "~29.7.0",
|
|
50
51
|
"lerna": "8.1.8",
|
|
51
52
|
"typescript": "~5.5.4",
|
package/src/client/api.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Geometry Backend API v2
|
|
5
5
|
* The ShapeDiver Geometry Backend system is used to: * host Grasshopper models in a secure, reliable, scalable, and performant way, * run computations of Grasshopper models, * and cache and output the results of computations and exports.
|
|
6
6
|
*
|
|
7
|
-
* The version of the OpenAPI document: 1.
|
|
7
|
+
* The version of the OpenAPI document: 1.7.0
|
|
8
8
|
*
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -98,6 +98,25 @@ export interface CommonsGroup {
|
|
|
98
98
|
*/
|
|
99
99
|
'name': string;
|
|
100
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Reasons why the model may be blocked.
|
|
103
|
+
* @export
|
|
104
|
+
* @interface CommonsModelBlockingReasons
|
|
105
|
+
*/
|
|
106
|
+
export interface CommonsModelBlockingReasons {
|
|
107
|
+
/**
|
|
108
|
+
* The model owner\'s credit limit has been exceeded.
|
|
109
|
+
* @type {boolean}
|
|
110
|
+
* @memberof CommonsModelBlockingReasons
|
|
111
|
+
*/
|
|
112
|
+
'creditLimit'?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* The model has been blocked explicitly by its owner.
|
|
115
|
+
* @type {boolean}
|
|
116
|
+
* @memberof CommonsModelBlockingReasons
|
|
117
|
+
*/
|
|
118
|
+
'owner'?: boolean;
|
|
119
|
+
}
|
|
101
120
|
/**
|
|
102
121
|
* Status of a model.
|
|
103
122
|
* @export
|
|
@@ -360,6 +379,13 @@ export interface ReqAuthorizationGroup {
|
|
|
360
379
|
*/
|
|
361
380
|
'organizations'?: Array<string>;
|
|
362
381
|
}
|
|
382
|
+
/**
|
|
383
|
+
* @type ReqBasicParameter
|
|
384
|
+
* Definition of a basic ShapeDiver parameter.
|
|
385
|
+
* @export
|
|
386
|
+
*/
|
|
387
|
+
export type ReqBasicParameter = boolean | number | string;
|
|
388
|
+
|
|
363
389
|
/**
|
|
364
390
|
* Body of an export or output cache request. A directory of export-/output-IDs and version-IDs.
|
|
365
391
|
* @export
|
|
@@ -423,7 +449,7 @@ export interface ReqCreditMetrics {
|
|
|
423
449
|
'parameters': Array<ReqCreditMetric>;
|
|
424
450
|
}
|
|
425
451
|
/**
|
|
426
|
-
* A directory of parameter keys and values. Supported parameter keys are as follows, whereby the parameter resolution is done in the same order as the keys are listed: * `id` * `name` * `displayname` Supported parameter values are: * Basic parameter (`
|
|
452
|
+
* A directory of parameter keys and values. Supported parameter keys are as follows, whereby the parameter resolution is done in the same order as the keys are listed: * `id` * `name` * `displayname` Supported parameter values are: * Basic parameter (`ReqBasicParameter`) * S-type parameter (`ReqStypeParameter`)
|
|
427
453
|
* @export
|
|
428
454
|
* @interface ReqCustomization
|
|
429
455
|
*/
|
|
@@ -654,6 +680,12 @@ export interface ReqModel {
|
|
|
654
680
|
* @memberof ReqModel
|
|
655
681
|
*/
|
|
656
682
|
'backendaccess'?: boolean;
|
|
683
|
+
/**
|
|
684
|
+
*
|
|
685
|
+
* @type {ReqModelBlockingReasons}
|
|
686
|
+
* @memberof ReqModel
|
|
687
|
+
*/
|
|
688
|
+
'blockingReasons'?: ReqModelBlockingReasons;
|
|
657
689
|
/**
|
|
658
690
|
* Original name of the model\'s grasshopper file.
|
|
659
691
|
* @type {string}
|
|
@@ -819,6 +851,25 @@ export interface ReqModel {
|
|
|
819
851
|
}
|
|
820
852
|
|
|
821
853
|
|
|
854
|
+
/**
|
|
855
|
+
* Reasons why the model may be blocked.
|
|
856
|
+
* @export
|
|
857
|
+
* @interface ReqModelBlockingReasons
|
|
858
|
+
*/
|
|
859
|
+
export interface ReqModelBlockingReasons {
|
|
860
|
+
/**
|
|
861
|
+
* The model owner\'s credit limit has been exceeded.
|
|
862
|
+
* @type {boolean}
|
|
863
|
+
* @memberof ReqModelBlockingReasons
|
|
864
|
+
*/
|
|
865
|
+
'creditLimit'?: boolean;
|
|
866
|
+
/**
|
|
867
|
+
* The model has been blocked explicitly by its owner.
|
|
868
|
+
* @type {boolean}
|
|
869
|
+
* @memberof ReqModelBlockingReasons
|
|
870
|
+
*/
|
|
871
|
+
'owner'?: boolean;
|
|
872
|
+
}
|
|
822
873
|
/**
|
|
823
874
|
* Model metrics
|
|
824
875
|
* @export
|
|
@@ -1120,7 +1171,7 @@ export interface ReqParameterDefinitions {
|
|
|
1120
1171
|
* The value of a single model parameter.
|
|
1121
1172
|
* @export
|
|
1122
1173
|
*/
|
|
1123
|
-
export type ReqParameterValue =
|
|
1174
|
+
export type ReqParameterValue = ReqBasicParameter | ReqStypeParameter;
|
|
1124
1175
|
|
|
1125
1176
|
/**
|
|
1126
1177
|
* Data for a single sdTF parameter.
|
|
@@ -1168,6 +1219,25 @@ export const ReqSdtfType = {
|
|
|
1168
1219
|
export type ReqSdtfType = typeof ReqSdtfType[keyof typeof ReqSdtfType];
|
|
1169
1220
|
|
|
1170
1221
|
|
|
1222
|
+
/**
|
|
1223
|
+
* Definition of the value to use for s-type parameters.
|
|
1224
|
+
* @export
|
|
1225
|
+
* @interface ReqStypeParameter
|
|
1226
|
+
*/
|
|
1227
|
+
export interface ReqStypeParameter {
|
|
1228
|
+
/**
|
|
1229
|
+
* Optional embedded value. If this is set the asset is ignored.
|
|
1230
|
+
* @type {string}
|
|
1231
|
+
* @memberof ReqStypeParameter
|
|
1232
|
+
*/
|
|
1233
|
+
'value'?: string;
|
|
1234
|
+
/**
|
|
1235
|
+
*
|
|
1236
|
+
* @type {CommmonsParameterAsset}
|
|
1237
|
+
* @memberof ReqStypeParameter
|
|
1238
|
+
*/
|
|
1239
|
+
'asset'?: CommmonsParameterAsset;
|
|
1240
|
+
}
|
|
1171
1241
|
/**
|
|
1172
1242
|
* System-wide metrics
|
|
1173
1243
|
* @export
|
|
@@ -1787,6 +1857,13 @@ export interface ResBaseSystem {
|
|
|
1787
1857
|
*/
|
|
1788
1858
|
'system'?: ResSystem;
|
|
1789
1859
|
}
|
|
1860
|
+
/**
|
|
1861
|
+
* @type ResBasicParameter
|
|
1862
|
+
* Definition of a basic ShapeDiver parameter.
|
|
1863
|
+
* @export
|
|
1864
|
+
*/
|
|
1865
|
+
export type ResBasicParameter = boolean | number | string;
|
|
1866
|
+
|
|
1790
1867
|
/**
|
|
1791
1868
|
*
|
|
1792
1869
|
* @export
|
|
@@ -4352,6 +4429,12 @@ export interface ResModel {
|
|
|
4352
4429
|
* @memberof ResModel
|
|
4353
4430
|
*/
|
|
4354
4431
|
'backlinkurl'?: string;
|
|
4432
|
+
/**
|
|
4433
|
+
*
|
|
4434
|
+
* @type {ResModelBlockingReasons}
|
|
4435
|
+
* @memberof ResModel
|
|
4436
|
+
*/
|
|
4437
|
+
'blockingReasons'?: ResModelBlockingReasons;
|
|
4355
4438
|
/**
|
|
4356
4439
|
* Link to continue the checking process of the model on the ShapeDiver Platform.
|
|
4357
4440
|
* @type {string}
|
|
@@ -4433,6 +4516,31 @@ export interface ResModel {
|
|
|
4433
4516
|
}
|
|
4434
4517
|
|
|
4435
4518
|
|
|
4519
|
+
/**
|
|
4520
|
+
*
|
|
4521
|
+
* @export
|
|
4522
|
+
* @interface ResModelBlockingReasons
|
|
4523
|
+
*/
|
|
4524
|
+
export interface ResModelBlockingReasons {
|
|
4525
|
+
/**
|
|
4526
|
+
* The model owner\'s credit limit has been exceeded.
|
|
4527
|
+
* @type {boolean}
|
|
4528
|
+
* @memberof ResModelBlockingReasons
|
|
4529
|
+
*/
|
|
4530
|
+
'creditLimit': boolean;
|
|
4531
|
+
/**
|
|
4532
|
+
* The model has been blocked explicitly by its owner.
|
|
4533
|
+
* @type {boolean}
|
|
4534
|
+
* @memberof ResModelBlockingReasons
|
|
4535
|
+
*/
|
|
4536
|
+
'owner': boolean;
|
|
4537
|
+
/**
|
|
4538
|
+
* The model uses a Grasshopper plugin that is not allowed for the owner.
|
|
4539
|
+
* @type {boolean}
|
|
4540
|
+
* @memberof ResModelBlockingReasons
|
|
4541
|
+
*/
|
|
4542
|
+
'pluginPermission': boolean;
|
|
4543
|
+
}
|
|
4436
4544
|
/**
|
|
4437
4545
|
* Information about a model cleanup process.
|
|
4438
4546
|
* @export
|
|
@@ -6043,10 +6151,10 @@ export type ResParameterType = typeof ResParameterType[keyof typeof ResParameter
|
|
|
6043
6151
|
|
|
6044
6152
|
/**
|
|
6045
6153
|
* @type ResParameterValue
|
|
6046
|
-
* The value of a single model parameter. Supported parameter values are: * Basic parameter (`
|
|
6154
|
+
* The value of a single model parameter. Supported parameter values are: * Basic parameter (`ResBasicParameter`) * S-type parameter (`ResStypeParameter`)
|
|
6047
6155
|
* @export
|
|
6048
6156
|
*/
|
|
6049
|
-
export type ResParameterValue =
|
|
6157
|
+
export type ResParameterValue = ResBasicParameter | ResStypeParameter;
|
|
6050
6158
|
|
|
6051
6159
|
/**
|
|
6052
6160
|
*
|
|
@@ -6731,6 +6839,25 @@ export const ResStructureType = {
|
|
|
6731
6839
|
export type ResStructureType = typeof ResStructureType[keyof typeof ResStructureType];
|
|
6732
6840
|
|
|
6733
6841
|
|
|
6842
|
+
/**
|
|
6843
|
+
* Definition of the value to use for s-type parameters.
|
|
6844
|
+
* @export
|
|
6845
|
+
* @interface ResStypeParameter
|
|
6846
|
+
*/
|
|
6847
|
+
export interface ResStypeParameter {
|
|
6848
|
+
/**
|
|
6849
|
+
* Optional embedded value. If this is set the asset is ignored.
|
|
6850
|
+
* @type {string}
|
|
6851
|
+
* @memberof ResStypeParameter
|
|
6852
|
+
*/
|
|
6853
|
+
'value'?: string;
|
|
6854
|
+
/**
|
|
6855
|
+
*
|
|
6856
|
+
* @type {CommmonsParameterAsset}
|
|
6857
|
+
* @memberof ResStypeParameter
|
|
6858
|
+
*/
|
|
6859
|
+
'asset'?: CommmonsParameterAsset;
|
|
6860
|
+
}
|
|
6734
6861
|
/**
|
|
6735
6862
|
* ShapeDiver API response of system-request.
|
|
6736
6863
|
* @export
|
package/src/client/base.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Geometry Backend API v2
|
|
5
5
|
* The ShapeDiver Geometry Backend system is used to: * host Grasshopper models in a secure, reliable, scalable, and performant way, * run computations of Grasshopper models, * and cache and output the results of computations and exports.
|
|
6
6
|
*
|
|
7
|
-
* The version of the OpenAPI document: 1.
|
|
7
|
+
* The version of the OpenAPI document: 1.7.0
|
|
8
8
|
*
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
package/src/client/common.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Geometry Backend API v2
|
|
5
5
|
* The ShapeDiver Geometry Backend system is used to: * host Grasshopper models in a secure, reliable, scalable, and performant way, * run computations of Grasshopper models, * and cache and output the results of computations and exports.
|
|
6
6
|
*
|
|
7
|
-
* The version of the OpenAPI document: 1.
|
|
7
|
+
* The version of the OpenAPI document: 1.7.0
|
|
8
8
|
*
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Geometry Backend API v2
|
|
5
5
|
* The ShapeDiver Geometry Backend system is used to: * host Grasshopper models in a secure, reliable, scalable, and performant way, * run computations of Grasshopper models, * and cache and output the results of computations and exports.
|
|
6
6
|
*
|
|
7
|
-
* The version of the OpenAPI document: 1.
|
|
7
|
+
* The version of the OpenAPI document: 1.7.0
|
|
8
8
|
*
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
package/src/client/index.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Geometry Backend API v2
|
|
5
5
|
* The ShapeDiver Geometry Backend system is used to: * host Grasshopper models in a secure, reliable, scalable, and performant way, * run computations of Grasshopper models, * and cache and output the results of computations and exports.
|
|
6
6
|
*
|
|
7
|
-
* The version of the OpenAPI document: 1.
|
|
7
|
+
* The version of the OpenAPI document: 1.7.0
|
|
8
8
|
*
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
package/src/configuration.ts
CHANGED
|
@@ -34,7 +34,7 @@ export interface ConfigurationParameters
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
export class Configuration extends ClientConfig {
|
|
37
|
-
protected readonly sdkVersion = '2.
|
|
37
|
+
protected readonly sdkVersion = '2.3.0'; // WARNING: This value is updated automatically!
|
|
38
38
|
|
|
39
39
|
public readonly useCustomAxios: boolean;
|
|
40
40
|
public readonly maxRetries: number;
|
package/src/error.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { ResErrorType } from './client';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Represents a generic
|
|
4
|
+
* Represents a generic ShapeDiver error.
|
|
5
5
|
*
|
|
6
6
|
* Something happened in setting up the request that triggered an Error.
|
|
7
7
|
* @export
|
|
8
|
-
* @class
|
|
8
|
+
* @class SdGeometryError
|
|
9
9
|
* @extends {Error}
|
|
10
10
|
*/
|
|
11
|
-
export class
|
|
12
|
-
constructor(message
|
|
11
|
+
export class SdGeometryError extends Error {
|
|
12
|
+
constructor(message?: string) {
|
|
13
13
|
super(message);
|
|
14
|
-
this.name = '
|
|
14
|
+
this.name = 'SdGeometryError';
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -20,13 +20,13 @@ export class SdError extends Error {
|
|
|
20
20
|
*
|
|
21
21
|
* The request was made but no response was received.
|
|
22
22
|
* @export
|
|
23
|
-
* @class
|
|
24
|
-
* @extends {
|
|
23
|
+
* @class RequestError
|
|
24
|
+
* @extends {SdGeometryError}
|
|
25
25
|
*/
|
|
26
|
-
export class
|
|
26
|
+
export class RequestError extends SdGeometryError {
|
|
27
27
|
constructor(message: string) {
|
|
28
28
|
super(message);
|
|
29
|
-
this.name = '
|
|
29
|
+
this.name = 'RequestError';
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -36,10 +36,10 @@ export class SdRequestError extends Error {
|
|
|
36
36
|
* The request was made and the server responded with a status code that falls out of the range of
|
|
37
37
|
* 2xx.
|
|
38
38
|
* @export
|
|
39
|
-
* @class
|
|
40
|
-
* @extends {
|
|
39
|
+
* @class ResponseError
|
|
40
|
+
* @extends {SdGeometryError}
|
|
41
41
|
*/
|
|
42
|
-
export class
|
|
42
|
+
export class ResponseError extends SdGeometryError {
|
|
43
43
|
/** The HTTP status code from the server response. */
|
|
44
44
|
public readonly status: number;
|
|
45
45
|
|
|
@@ -51,7 +51,7 @@ export class SdResponseError extends Error {
|
|
|
51
51
|
|
|
52
52
|
constructor(status: number, message: string, desc: string, type?: string) {
|
|
53
53
|
super(message);
|
|
54
|
-
this.name = '
|
|
54
|
+
this.name = 'ResponseError';
|
|
55
55
|
this.status = status;
|
|
56
56
|
this.description = desc;
|
|
57
57
|
this.type =
|
|
@@ -64,9 +64,9 @@ export class SdResponseError extends Error {
|
|
|
64
64
|
/**
|
|
65
65
|
* @export
|
|
66
66
|
* @class IllegalArgumentError
|
|
67
|
-
* @extends {
|
|
67
|
+
* @extends {SdGeometryError}
|
|
68
68
|
*/
|
|
69
|
-
export class IllegalArgumentError extends
|
|
69
|
+
export class IllegalArgumentError extends SdGeometryError {
|
|
70
70
|
constructor(
|
|
71
71
|
public field: string,
|
|
72
72
|
msg?: string
|
|
@@ -79,9 +79,9 @@ export class IllegalArgumentError extends Error {
|
|
|
79
79
|
/**
|
|
80
80
|
* @export
|
|
81
81
|
* @class TimeoutError
|
|
82
|
-
* @extends {
|
|
82
|
+
* @extends {SdGeometryError}
|
|
83
83
|
*/
|
|
84
|
-
export class TimeoutError extends
|
|
84
|
+
export class TimeoutError extends SdGeometryError {
|
|
85
85
|
constructor(
|
|
86
86
|
public field: string,
|
|
87
87
|
msg?: string
|
package/src/utils.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosError, AxiosPromise } from 'axios';
|
|
2
|
-
import {
|
|
2
|
+
import { RequestError, ResponseError } from './error';
|
|
3
3
|
|
|
4
4
|
/** Delays the response for the given number of milliseconds */
|
|
5
5
|
export function sleep(ms: number): Promise<void> {
|
|
@@ -93,12 +93,11 @@ export async function exists(apiCall: () => AxiosPromise<unknown>): Promise<bool
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
/**
|
|
96
|
-
*
|
|
96
|
+
* Tries to convert a generic Axios error into a more specific ShapeDiver error. When no match is
|
|
97
|
+
* found, the original error is returned instead.
|
|
97
98
|
* @param error The Axios error to convert.
|
|
98
99
|
*/
|
|
99
|
-
export function processError(
|
|
100
|
-
error: AxiosError | Error
|
|
101
|
-
): SdError | SdRequestError | SdResponseError {
|
|
100
|
+
export function processError(error: AxiosError | Error): Error | RequestError | ResponseError {
|
|
102
101
|
if ('response' in error) {
|
|
103
102
|
const err = error as AxiosError,
|
|
104
103
|
status = err.response!.status,
|
|
@@ -114,13 +113,13 @@ export function processError(
|
|
|
114
113
|
'message' in data &&
|
|
115
114
|
typeof data.message === 'string'
|
|
116
115
|
) {
|
|
117
|
-
return new
|
|
116
|
+
return new ResponseError(status, data.message, data.desc, data.error);
|
|
118
117
|
} else {
|
|
119
|
-
return new
|
|
118
|
+
return new ResponseError(status, err.message, 'No error description provided');
|
|
120
119
|
}
|
|
121
120
|
} else if ('request' in error) {
|
|
122
|
-
return new
|
|
121
|
+
return new RequestError(error.message);
|
|
123
122
|
} else {
|
|
124
|
-
return
|
|
123
|
+
return error;
|
|
125
124
|
}
|
|
126
125
|
}
|