@shapediver/sdk.geometry-api-sdk-v2 3.6.0 → 4.0.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 +5 -5
- package/dist/UtilsApi.d.ts +16 -29
- package/dist/UtilsApi.d.ts.map +1 -1
- package/dist/UtilsApi.js +133 -135
- package/dist/UtilsApi.js.map +1 -1
- package/dist/base.d.ts +2 -5
- package/dist/base.d.ts.map +1 -1
- package/dist/base.js +30 -36
- package/dist/base.js.map +1 -1
- package/dist/client/apis/AnalyticsApi.d.ts +38 -0
- package/dist/client/apis/AnalyticsApi.d.ts.map +1 -0
- package/dist/client/apis/AnalyticsApi.js +245 -0
- package/dist/client/apis/AnalyticsApi.js.map +1 -0
- package/dist/client/apis/ArSceneApi.d.ts +23 -0
- package/dist/client/apis/ArSceneApi.d.ts.map +1 -0
- package/dist/client/apis/ArSceneApi.js +140 -0
- package/dist/client/apis/ArSceneApi.js.map +1 -0
- package/dist/client/apis/AssetsApi.d.ts +54 -0
- package/dist/client/apis/AssetsApi.d.ts.map +1 -0
- package/dist/client/apis/AssetsApi.js +329 -0
- package/dist/client/apis/AssetsApi.js.map +1 -0
- package/dist/client/apis/AuthApi.d.ts +8 -0
- package/dist/client/apis/AuthApi.d.ts.map +1 -0
- package/dist/client/apis/AuthApi.js +77 -0
- package/dist/client/apis/AuthApi.js.map +1 -0
- package/dist/client/apis/AuthGroupApi.d.ts +12 -0
- package/dist/client/apis/AuthGroupApi.d.ts.map +1 -0
- package/dist/client/apis/AuthGroupApi.js +89 -0
- package/dist/client/apis/AuthGroupApi.js.map +1 -0
- package/dist/client/apis/ExportApi.d.ts +38 -0
- package/dist/client/apis/ExportApi.d.ts.map +1 -0
- package/dist/client/apis/ExportApi.js +230 -0
- package/dist/client/apis/ExportApi.js.map +1 -0
- package/dist/client/apis/FileApi.d.ts +45 -0
- package/dist/client/apis/FileApi.d.ts.map +1 -0
- package/dist/client/apis/FileApi.js +271 -0
- package/dist/client/apis/FileApi.js.map +1 -0
- package/dist/client/apis/GltfApi.d.ts +14 -0
- package/dist/client/apis/GltfApi.d.ts.map +1 -0
- package/dist/client/apis/GltfApi.js +96 -0
- package/dist/client/apis/GltfApi.js.map +1 -0
- package/dist/client/apis/LogApi.d.ts +13 -0
- package/dist/client/apis/LogApi.d.ts.map +1 -0
- package/dist/client/apis/LogApi.js +93 -0
- package/dist/client/apis/LogApi.js.map +1 -0
- package/dist/client/apis/ModelApi.d.ts +129 -0
- package/dist/client/apis/ModelApi.d.ts.map +1 -0
- package/dist/client/apis/ModelApi.js +762 -0
- package/dist/client/apis/ModelApi.js.map +1 -0
- package/dist/client/apis/ModelStateApi.d.ts +57 -0
- package/dist/client/apis/ModelStateApi.d.ts.map +1 -0
- package/dist/client/apis/ModelStateApi.js +328 -0
- package/dist/client/apis/ModelStateApi.js.map +1 -0
- package/dist/client/apis/OutputApi.d.ts +38 -0
- package/dist/client/apis/OutputApi.d.ts.map +1 -0
- package/dist/client/apis/OutputApi.js +230 -0
- package/dist/client/apis/OutputApi.js.map +1 -0
- package/dist/client/apis/ScriptApi.d.ts +17 -0
- package/dist/client/apis/ScriptApi.d.ts.map +1 -0
- package/dist/client/apis/ScriptApi.js +127 -0
- package/dist/client/apis/ScriptApi.js.map +1 -0
- package/dist/client/apis/SdtfApi.d.ts +37 -0
- package/dist/client/apis/SdtfApi.d.ts.map +1 -0
- package/dist/client/apis/SdtfApi.js +227 -0
- package/dist/client/apis/SdtfApi.js.map +1 -0
- package/dist/client/apis/SessionApi.d.ts +51 -0
- package/dist/client/apis/SessionApi.d.ts.map +1 -0
- package/dist/client/apis/SessionApi.js +300 -0
- package/dist/client/apis/SessionApi.js.map +1 -0
- package/dist/client/apis/SystemApi.d.ts +28 -0
- package/dist/client/apis/SystemApi.d.ts.map +1 -0
- package/dist/client/apis/SystemApi.js +235 -0
- package/dist/client/apis/SystemApi.js.map +1 -0
- package/dist/client/apis/TextureApi.d.ts +13 -0
- package/dist/client/apis/TextureApi.d.ts.map +1 -0
- package/dist/client/apis/TextureApi.js +91 -0
- package/dist/client/apis/TextureApi.js.map +1 -0
- package/dist/client/apis/index.d.ts +18 -0
- package/dist/client/apis/index.d.ts.map +1 -0
- package/dist/client/apis/index.js +34 -0
- package/dist/client/apis/index.js.map +1 -0
- package/dist/client/index.d.ts +3 -2
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +3 -2
- package/dist/client/index.js.map +1 -1
- package/dist/client/models/index.d.ts +1671 -0
- package/dist/client/models/index.d.ts.map +1 -0
- package/dist/client/models/index.js +239 -0
- package/dist/client/models/index.js.map +1 -0
- package/dist/client/runtime.d.ts +154 -0
- package/dist/client/runtime.d.ts.map +1 -0
- package/dist/client/runtime.js +323 -0
- package/dist/client/runtime.js.map +1 -0
- package/dist/configuration.d.ts +2 -7
- package/dist/configuration.d.ts.map +1 -1
- package/dist/configuration.js +36 -16
- package/dist/configuration.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/utils.d.ts +2 -3
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +16 -13
- package/dist/utils.js.map +1 -1
- package/package.json +3 -9
- package/src/UtilsApi.ts +252 -324
- package/src/base.ts +48 -46
- package/src/client/apis/AnalyticsApi.ts +347 -0
- package/src/client/apis/ArSceneApi.ts +172 -0
- package/src/client/apis/AssetsApi.ts +474 -0
- package/src/client/apis/AuthApi.ts +63 -0
- package/src/client/apis/AuthGroupApi.ts +89 -0
- package/src/client/apis/ExportApi.ts +332 -0
- package/src/client/apis/FileApi.ts +401 -0
- package/src/client/apis/GltfApi.ts +101 -0
- package/src/client/apis/LogApi.ts +96 -0
- package/src/client/apis/ModelApi.ts +1206 -0
- package/src/client/apis/ModelStateApi.ts +479 -0
- package/src/client/apis/OutputApi.ts +333 -0
- package/src/client/apis/ScriptApi.ts +142 -0
- package/src/client/apis/SdtfApi.ts +327 -0
- package/src/client/apis/SessionApi.ts +435 -0
- package/src/client/apis/SystemApi.ts +301 -0
- package/src/client/apis/TextureApi.ts +91 -0
- package/src/client/apis/index.ts +19 -0
- package/src/client/index.ts +3 -16
- package/src/client/models/index.ts +7367 -0
- package/src/client/runtime.ts +442 -0
- package/src/configuration.ts +62 -37
- package/src/error.ts +2 -2
- package/src/index.ts +2 -1
- package/src/utils.ts +53 -25
- package/dist/client/api.d.ts +0 -2111
- package/dist/client/api.d.ts.map +0 -1
- package/dist/client/api.js +0 -3576
- package/dist/client/api.js.map +0 -1
- package/dist/client/base.d.ts +0 -32
- package/dist/client/base.d.ts.map +0 -1
- package/dist/client/base.js +0 -37
- package/dist/client/base.js.map +0 -1
- package/dist/client/common.d.ts +0 -15
- package/dist/client/common.d.ts.map +0 -1
- package/dist/client/common.js +0 -117
- package/dist/client/common.js.map +0 -1
- package/dist/client/configuration.d.ts +0 -37
- package/dist/client/configuration.d.ts.map +0 -1
- package/dist/client/configuration.js +0 -23
- package/dist/client/configuration.js.map +0 -1
- package/src/client/api.ts +0 -11052
- package/src/client/base.ts +0 -62
- package/src/client/common.ts +0 -127
- package/src/client/configuration.ts +0 -121
package/src/base.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import { Configuration as ClientConfig } from './client/
|
|
2
|
-
import { BaseAPI as ClientBaseAPI } from './client/base';
|
|
1
|
+
import { BaseAPI as ClientBaseAPI, Configuration as ClientConfig, FetchAPI } from './client/runtime';
|
|
3
2
|
import { Configuration } from './configuration';
|
|
4
|
-
import globalAxios, { AxiosInstance } from 'axios';
|
|
5
|
-
|
|
6
|
-
/** Axios singleton instance used by all APIs by default. */
|
|
7
|
-
let AXIOS: AxiosInstance | undefined;
|
|
8
3
|
|
|
9
4
|
/**
|
|
10
5
|
* Overrides the `BaseAPI` class that is used by all resource APIs.
|
|
@@ -12,64 +7,71 @@ let AXIOS: AxiosInstance | undefined;
|
|
|
12
7
|
* NOTE: The classes are swapped out in `client/base.ts` by a script during generation.
|
|
13
8
|
*
|
|
14
9
|
* Extensions:
|
|
15
|
-
* -
|
|
16
|
-
* - Extend the Axios instance by an Interceptor to handle retries on 429 and 502 status codes.
|
|
10
|
+
* - Wrap the generated Fetch pipeline with bounded retries for 429 and 502 responses.
|
|
17
11
|
*/
|
|
18
12
|
export class BaseAPI extends ClientBaseAPI {
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
constructor(config: Configuration | ClientConfig = new Configuration()) {
|
|
14
|
+
super(config);
|
|
21
15
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
this.defaultAxios = axios;
|
|
16
|
+
const maxRetries =
|
|
17
|
+
config instanceof Configuration
|
|
18
|
+
? config.maxRetries
|
|
19
|
+
: new Configuration().maxRetries;
|
|
20
|
+
|
|
21
|
+
// Wrap the generated pipeline rather than the raw Fetch implementation so that
|
|
22
|
+
// configured middleware still runs for every attempt.
|
|
23
|
+
this.fetchApi = createRetryingFetch(this.fetchApi, maxRetries);
|
|
31
24
|
}
|
|
32
25
|
}
|
|
33
26
|
|
|
34
27
|
/**
|
|
35
|
-
*
|
|
36
|
-
* `429` and `502` status codes.
|
|
28
|
+
* Wraps Fetch with bounded retries for retryable HTTP responses.
|
|
37
29
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
30
|
+
* The wrapper returns the final response unchanged so the generated runtime can
|
|
31
|
+
* perform its normal success/error conversion. Fetch transport failures are not
|
|
32
|
+
* retried here.
|
|
40
33
|
*/
|
|
41
|
-
function
|
|
42
|
-
|
|
34
|
+
function createRetryingFetch(
|
|
35
|
+
fetchApi: FetchAPI,
|
|
36
|
+
maxRetries = 5,
|
|
37
|
+
): FetchAPI {
|
|
38
|
+
return async (url, init) => {
|
|
39
|
+
let retries = 0;
|
|
43
40
|
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
while (true) {
|
|
42
|
+
const response = await fetchApi(url, init);
|
|
46
43
|
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
if (
|
|
45
|
+
(response.status !== 429 && response.status !== 502) ||
|
|
46
|
+
retries >= maxRetries
|
|
47
|
+
) {
|
|
48
|
+
return response;
|
|
49
|
+
}
|
|
49
50
|
|
|
50
|
-
|
|
51
|
-
config.retryCount = config.retryCount ?? 0;
|
|
52
|
-
if (config.retryCount >= maxRetries) return Promise.reject(error);
|
|
53
|
-
|
|
54
|
-
// Only retry for 429 or 502 status codes
|
|
55
|
-
if (response.status === 429 || response.status === 502) {
|
|
56
|
-
config.retryCount += 1;
|
|
51
|
+
retries++;
|
|
57
52
|
|
|
58
53
|
const delay =
|
|
59
54
|
response.status === 429
|
|
60
|
-
?
|
|
61
|
-
|
|
62
|
-
: // 1 second delay for 502 status
|
|
63
|
-
1000;
|
|
55
|
+
? getRetryAfterDelay(response)
|
|
56
|
+
: 1000;
|
|
64
57
|
|
|
65
|
-
// Delay retry and send the request again
|
|
66
58
|
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
67
|
-
return axios.request(config);
|
|
68
59
|
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
69
62
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Returns the retry delay in milliseconds for a 429 response.
|
|
65
|
+
*
|
|
66
|
+
* Only a non-negative integer Retry-After value is usable; missing or malformed
|
|
67
|
+
* values use the SDK fallback delay of 60 seconds.
|
|
68
|
+
*/
|
|
69
|
+
function getRetryAfterDelay(response: Response): number {
|
|
70
|
+
const value = response.headers.get('Retry-After')?.trim();
|
|
71
|
+
|
|
72
|
+
if (value && /^\d+$/.test(value)) {
|
|
73
|
+
return Number(value) * 1000;
|
|
74
|
+
}
|
|
73
75
|
|
|
74
|
-
return
|
|
76
|
+
return 60_000;
|
|
75
77
|
}
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Geometry Backend API v2
|
|
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
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 2.5.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import * as runtime from '../runtime';
|
|
16
|
+
import { BaseAPI } from '../../base';
|
|
17
|
+
import type {
|
|
18
|
+
ReqCreditMetrics,
|
|
19
|
+
ResError,
|
|
20
|
+
ResGetCreditMetrics,
|
|
21
|
+
ResGetModelOrganizationCreditMetrics,
|
|
22
|
+
ResGetModelUserCreditMetrics,
|
|
23
|
+
ResGetOrganizationCreditMetrics,
|
|
24
|
+
ResGetUserCreditMetrics,
|
|
25
|
+
} from '../models/index';
|
|
26
|
+
|
|
27
|
+
export interface GetCreditMetricsRequest {
|
|
28
|
+
reqCreditMetrics: ReqCreditMetrics;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface GetModelOrganizationCreditMetricsRequest {
|
|
32
|
+
timestamp: string;
|
|
33
|
+
orgId: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface GetModelUserCreditMetricsRequest {
|
|
37
|
+
timestamp: string;
|
|
38
|
+
userId: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface GetOrganizationCreditMetricsRequest {
|
|
42
|
+
timestamp: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface GetUserCreditMetricsRequest {
|
|
46
|
+
timestamp: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
*/
|
|
52
|
+
export class AnalyticsApi extends BaseAPI {
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Creates request options for getCreditMetrics without sending the request
|
|
56
|
+
*/
|
|
57
|
+
async getCreditMetricsRequestOpts(requestParameters: GetCreditMetricsRequest): Promise<runtime.RequestOpts> {
|
|
58
|
+
if (requestParameters['reqCreditMetrics'] == null) {
|
|
59
|
+
throw new runtime.RequiredError(
|
|
60
|
+
'reqCreditMetrics',
|
|
61
|
+
'Required parameter "reqCreditMetrics" was null or undefined when calling getCreditMetrics().'
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const queryParameters: any = {};
|
|
66
|
+
|
|
67
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
68
|
+
|
|
69
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
70
|
+
|
|
71
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
72
|
+
const token = this.configuration.accessToken;
|
|
73
|
+
const tokenString = await token("JwtAuth", []);
|
|
74
|
+
|
|
75
|
+
if (tokenString) {
|
|
76
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
let urlPath = `/api/v2/analytics/credit-metrics`;
|
|
81
|
+
|
|
82
|
+
return {
|
|
83
|
+
path: urlPath,
|
|
84
|
+
method: 'PUT',
|
|
85
|
+
headers: headerParameters,
|
|
86
|
+
query: queryParameters,
|
|
87
|
+
body: requestParameters['reqCreditMetrics'],
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Subject-Restriction: __backend__ - ONLY for _system-metrics_. Permissions: * `analytics.model.get.*` - __required__.
|
|
93
|
+
* Get credit metrics.
|
|
94
|
+
*/
|
|
95
|
+
async getCreditMetricsRaw(requestParameters: GetCreditMetricsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ResGetCreditMetrics>> {
|
|
96
|
+
const requestOptions = await this.getCreditMetricsRequestOpts(requestParameters);
|
|
97
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
98
|
+
|
|
99
|
+
return new runtime.JSONApiResponse(response);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Subject-Restriction: __backend__ - ONLY for _system-metrics_. Permissions: * `analytics.model.get.*` - __required__.
|
|
104
|
+
* Get credit metrics.
|
|
105
|
+
*/
|
|
106
|
+
async getCreditMetrics(reqCreditMetrics: ReqCreditMetrics, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ResGetCreditMetrics> {
|
|
107
|
+
const response = await this.getCreditMetricsRaw({ reqCreditMetrics: reqCreditMetrics }, initOverrides);
|
|
108
|
+
return await response.value();
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Creates request options for getModelOrganizationCreditMetrics without sending the request
|
|
113
|
+
*/
|
|
114
|
+
async getModelOrganizationCreditMetricsRequestOpts(requestParameters: GetModelOrganizationCreditMetricsRequest): Promise<runtime.RequestOpts> {
|
|
115
|
+
if (requestParameters['timestamp'] == null) {
|
|
116
|
+
throw new runtime.RequiredError(
|
|
117
|
+
'timestamp',
|
|
118
|
+
'Required parameter "timestamp" was null or undefined when calling getModelOrganizationCreditMetrics().'
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (requestParameters['orgId'] == null) {
|
|
123
|
+
throw new runtime.RequiredError(
|
|
124
|
+
'orgId',
|
|
125
|
+
'Required parameter "orgId" was null or undefined when calling getModelOrganizationCreditMetrics().'
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const queryParameters: any = {};
|
|
130
|
+
|
|
131
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
132
|
+
|
|
133
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
134
|
+
const token = this.configuration.accessToken;
|
|
135
|
+
const tokenString = await token("JwtAuth", []);
|
|
136
|
+
|
|
137
|
+
if (tokenString) {
|
|
138
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
let urlPath = `/api/v2/analytics/credit-metrics/timestamp/{timestamp}/org/{orgId}`;
|
|
143
|
+
urlPath = urlPath.replace('{timestamp}', encodeURIComponent(String(requestParameters['timestamp'])));
|
|
144
|
+
urlPath = urlPath.replace('{orgId}', encodeURIComponent(String(requestParameters['orgId'])));
|
|
145
|
+
|
|
146
|
+
return {
|
|
147
|
+
path: urlPath,
|
|
148
|
+
method: 'GET',
|
|
149
|
+
headers: headerParameters,
|
|
150
|
+
query: queryParameters,
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Permissions: * `analytics.model.get.*` - __required__.
|
|
156
|
+
* Get model credit metrics of the organization at timestamp.
|
|
157
|
+
*/
|
|
158
|
+
async getModelOrganizationCreditMetricsRaw(requestParameters: GetModelOrganizationCreditMetricsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ResGetModelOrganizationCreditMetrics>> {
|
|
159
|
+
const requestOptions = await this.getModelOrganizationCreditMetricsRequestOpts(requestParameters);
|
|
160
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
161
|
+
|
|
162
|
+
return new runtime.JSONApiResponse(response);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Permissions: * `analytics.model.get.*` - __required__.
|
|
167
|
+
* Get model credit metrics of the organization at timestamp.
|
|
168
|
+
*/
|
|
169
|
+
async getModelOrganizationCreditMetrics(timestamp: string, orgId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ResGetModelOrganizationCreditMetrics> {
|
|
170
|
+
const response = await this.getModelOrganizationCreditMetricsRaw({ timestamp: timestamp, orgId: orgId }, initOverrides);
|
|
171
|
+
return await response.value();
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Creates request options for getModelUserCreditMetrics without sending the request
|
|
176
|
+
*/
|
|
177
|
+
async getModelUserCreditMetricsRequestOpts(requestParameters: GetModelUserCreditMetricsRequest): Promise<runtime.RequestOpts> {
|
|
178
|
+
if (requestParameters['timestamp'] == null) {
|
|
179
|
+
throw new runtime.RequiredError(
|
|
180
|
+
'timestamp',
|
|
181
|
+
'Required parameter "timestamp" was null or undefined when calling getModelUserCreditMetrics().'
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
if (requestParameters['userId'] == null) {
|
|
186
|
+
throw new runtime.RequiredError(
|
|
187
|
+
'userId',
|
|
188
|
+
'Required parameter "userId" was null or undefined when calling getModelUserCreditMetrics().'
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const queryParameters: any = {};
|
|
193
|
+
|
|
194
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
195
|
+
|
|
196
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
197
|
+
const token = this.configuration.accessToken;
|
|
198
|
+
const tokenString = await token("JwtAuth", []);
|
|
199
|
+
|
|
200
|
+
if (tokenString) {
|
|
201
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
let urlPath = `/api/v2/analytics/credit-metrics/timestamp/{timestamp}/user/{userId}`;
|
|
206
|
+
urlPath = urlPath.replace('{timestamp}', encodeURIComponent(String(requestParameters['timestamp'])));
|
|
207
|
+
urlPath = urlPath.replace('{userId}', encodeURIComponent(String(requestParameters['userId'])));
|
|
208
|
+
|
|
209
|
+
return {
|
|
210
|
+
path: urlPath,
|
|
211
|
+
method: 'GET',
|
|
212
|
+
headers: headerParameters,
|
|
213
|
+
query: queryParameters,
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Permissions: * `analytics.model.get.*` - __required__.
|
|
219
|
+
* Get model credit metrics of the user at timestamp.
|
|
220
|
+
*/
|
|
221
|
+
async getModelUserCreditMetricsRaw(requestParameters: GetModelUserCreditMetricsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ResGetModelUserCreditMetrics>> {
|
|
222
|
+
const requestOptions = await this.getModelUserCreditMetricsRequestOpts(requestParameters);
|
|
223
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
224
|
+
|
|
225
|
+
return new runtime.JSONApiResponse(response);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Permissions: * `analytics.model.get.*` - __required__.
|
|
230
|
+
* Get model credit metrics of the user at timestamp.
|
|
231
|
+
*/
|
|
232
|
+
async getModelUserCreditMetrics(timestamp: string, userId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ResGetModelUserCreditMetrics> {
|
|
233
|
+
const response = await this.getModelUserCreditMetricsRaw({ timestamp: timestamp, userId: userId }, initOverrides);
|
|
234
|
+
return await response.value();
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Creates request options for getOrganizationCreditMetrics without sending the request
|
|
239
|
+
*/
|
|
240
|
+
async getOrganizationCreditMetricsRequestOpts(requestParameters: GetOrganizationCreditMetricsRequest): Promise<runtime.RequestOpts> {
|
|
241
|
+
if (requestParameters['timestamp'] == null) {
|
|
242
|
+
throw new runtime.RequiredError(
|
|
243
|
+
'timestamp',
|
|
244
|
+
'Required parameter "timestamp" was null or undefined when calling getOrganizationCreditMetrics().'
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
const queryParameters: any = {};
|
|
249
|
+
|
|
250
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
251
|
+
|
|
252
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
253
|
+
const token = this.configuration.accessToken;
|
|
254
|
+
const tokenString = await token("JwtAuth", []);
|
|
255
|
+
|
|
256
|
+
if (tokenString) {
|
|
257
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
let urlPath = `/api/v2/analytics/credit-metrics/timestamp/{timestamp}/org`;
|
|
262
|
+
urlPath = urlPath.replace('{timestamp}', encodeURIComponent(String(requestParameters['timestamp'])));
|
|
263
|
+
|
|
264
|
+
return {
|
|
265
|
+
path: urlPath,
|
|
266
|
+
method: 'GET',
|
|
267
|
+
headers: headerParameters,
|
|
268
|
+
query: queryParameters,
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Subject-Restriction: __backend__. Permissions: * `analytics.model.get.*` - __required__.
|
|
274
|
+
* Get credit metrics of all organizations with users active at timestamp.
|
|
275
|
+
*/
|
|
276
|
+
async getOrganizationCreditMetricsRaw(requestParameters: GetOrganizationCreditMetricsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ResGetOrganizationCreditMetrics>> {
|
|
277
|
+
const requestOptions = await this.getOrganizationCreditMetricsRequestOpts(requestParameters);
|
|
278
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
279
|
+
|
|
280
|
+
return new runtime.JSONApiResponse(response);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Subject-Restriction: __backend__. Permissions: * `analytics.model.get.*` - __required__.
|
|
285
|
+
* Get credit metrics of all organizations with users active at timestamp.
|
|
286
|
+
*/
|
|
287
|
+
async getOrganizationCreditMetrics(timestamp: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ResGetOrganizationCreditMetrics> {
|
|
288
|
+
const response = await this.getOrganizationCreditMetricsRaw({ timestamp: timestamp }, initOverrides);
|
|
289
|
+
return await response.value();
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Creates request options for getUserCreditMetrics without sending the request
|
|
294
|
+
*/
|
|
295
|
+
async getUserCreditMetricsRequestOpts(requestParameters: GetUserCreditMetricsRequest): Promise<runtime.RequestOpts> {
|
|
296
|
+
if (requestParameters['timestamp'] == null) {
|
|
297
|
+
throw new runtime.RequiredError(
|
|
298
|
+
'timestamp',
|
|
299
|
+
'Required parameter "timestamp" was null or undefined when calling getUserCreditMetrics().'
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
const queryParameters: any = {};
|
|
304
|
+
|
|
305
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
306
|
+
|
|
307
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
308
|
+
const token = this.configuration.accessToken;
|
|
309
|
+
const tokenString = await token("JwtAuth", []);
|
|
310
|
+
|
|
311
|
+
if (tokenString) {
|
|
312
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
let urlPath = `/api/v2/analytics/credit-metrics/timestamp/{timestamp}/user`;
|
|
317
|
+
urlPath = urlPath.replace('{timestamp}', encodeURIComponent(String(requestParameters['timestamp'])));
|
|
318
|
+
|
|
319
|
+
return {
|
|
320
|
+
path: urlPath,
|
|
321
|
+
method: 'GET',
|
|
322
|
+
headers: headerParameters,
|
|
323
|
+
query: queryParameters,
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Subject-Restriction: __backend__. Permissions: * `analytics.model.get.*` - __required__.
|
|
329
|
+
* Get credit metrics of all users active at timestamp.
|
|
330
|
+
*/
|
|
331
|
+
async getUserCreditMetricsRaw(requestParameters: GetUserCreditMetricsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ResGetUserCreditMetrics>> {
|
|
332
|
+
const requestOptions = await this.getUserCreditMetricsRequestOpts(requestParameters);
|
|
333
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
334
|
+
|
|
335
|
+
return new runtime.JSONApiResponse(response);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Subject-Restriction: __backend__. Permissions: * `analytics.model.get.*` - __required__.
|
|
340
|
+
* Get credit metrics of all users active at timestamp.
|
|
341
|
+
*/
|
|
342
|
+
async getUserCreditMetrics(timestamp: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ResGetUserCreditMetrics> {
|
|
343
|
+
const response = await this.getUserCreditMetricsRaw({ timestamp: timestamp }, initOverrides);
|
|
344
|
+
return await response.value();
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Geometry Backend API v2
|
|
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
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 2.5.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import * as runtime from '../runtime';
|
|
16
|
+
import { BaseAPI } from '../../base';
|
|
17
|
+
import type {
|
|
18
|
+
ResError,
|
|
19
|
+
} from '../models/index';
|
|
20
|
+
|
|
21
|
+
export interface DownloadArSceneGltfRequest {
|
|
22
|
+
sceneId: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface DownloadArSceneUsdzRequest {
|
|
26
|
+
sceneId: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface GetArSceneMetadataRequest {
|
|
30
|
+
sceneId: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
*/
|
|
36
|
+
export class ArSceneApi extends BaseAPI {
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Creates request options for downloadArSceneGltf without sending the request
|
|
40
|
+
*/
|
|
41
|
+
async downloadArSceneGltfRequestOpts(requestParameters: DownloadArSceneGltfRequest): Promise<runtime.RequestOpts> {
|
|
42
|
+
if (requestParameters['sceneId'] == null) {
|
|
43
|
+
throw new runtime.RequiredError(
|
|
44
|
+
'sceneId',
|
|
45
|
+
'Required parameter "sceneId" was null or undefined when calling downloadArSceneGltf().'
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const queryParameters: any = {};
|
|
50
|
+
|
|
51
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
let urlPath = `/api/v2/ar-scene/{sceneId}/gltf`;
|
|
55
|
+
urlPath = urlPath.replace('{sceneId}', encodeURIComponent(String(requestParameters['sceneId'])));
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
path: urlPath,
|
|
59
|
+
method: 'GET',
|
|
60
|
+
headers: headerParameters,
|
|
61
|
+
query: queryParameters,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Downloads the glTF asset of an AR scene or a Model-State that is linked to an AR scene.
|
|
67
|
+
*/
|
|
68
|
+
async downloadArSceneGltfRaw(requestParameters: DownloadArSceneGltfRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>> {
|
|
69
|
+
const requestOptions = await this.downloadArSceneGltfRequestOpts(requestParameters);
|
|
70
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
71
|
+
|
|
72
|
+
return new runtime.BlobApiResponse(response);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Downloads the glTF asset of an AR scene or a Model-State that is linked to an AR scene.
|
|
77
|
+
*/
|
|
78
|
+
async downloadArSceneGltf(sceneId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob> {
|
|
79
|
+
const response = await this.downloadArSceneGltfRaw({ sceneId: sceneId }, initOverrides);
|
|
80
|
+
return await response.value();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Creates request options for downloadArSceneUsdz without sending the request
|
|
85
|
+
*/
|
|
86
|
+
async downloadArSceneUsdzRequestOpts(requestParameters: DownloadArSceneUsdzRequest): Promise<runtime.RequestOpts> {
|
|
87
|
+
if (requestParameters['sceneId'] == null) {
|
|
88
|
+
throw new runtime.RequiredError(
|
|
89
|
+
'sceneId',
|
|
90
|
+
'Required parameter "sceneId" was null or undefined when calling downloadArSceneUsdz().'
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const queryParameters: any = {};
|
|
95
|
+
|
|
96
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
let urlPath = `/api/v2/ar-scene/{sceneId}/usdz`;
|
|
100
|
+
urlPath = urlPath.replace('{sceneId}', encodeURIComponent(String(requestParameters['sceneId'])));
|
|
101
|
+
|
|
102
|
+
return {
|
|
103
|
+
path: urlPath,
|
|
104
|
+
method: 'GET',
|
|
105
|
+
headers: headerParameters,
|
|
106
|
+
query: queryParameters,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Downloads the USDZ asset of an AR scene or a Model-State that is linked to an AR scene.
|
|
112
|
+
*/
|
|
113
|
+
async downloadArSceneUsdzRaw(requestParameters: DownloadArSceneUsdzRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>> {
|
|
114
|
+
const requestOptions = await this.downloadArSceneUsdzRequestOpts(requestParameters);
|
|
115
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
116
|
+
|
|
117
|
+
return new runtime.BlobApiResponse(response);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Downloads the USDZ asset of an AR scene or a Model-State that is linked to an AR scene.
|
|
122
|
+
*/
|
|
123
|
+
async downloadArSceneUsdz(sceneId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob> {
|
|
124
|
+
const response = await this.downloadArSceneUsdzRaw({ sceneId: sceneId }, initOverrides);
|
|
125
|
+
return await response.value();
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Creates request options for getArSceneMetadata without sending the request
|
|
130
|
+
*/
|
|
131
|
+
async getArSceneMetadataRequestOpts(requestParameters: GetArSceneMetadataRequest): Promise<runtime.RequestOpts> {
|
|
132
|
+
if (requestParameters['sceneId'] == null) {
|
|
133
|
+
throw new runtime.RequiredError(
|
|
134
|
+
'sceneId',
|
|
135
|
+
'Required parameter "sceneId" was null or undefined when calling getArSceneMetadata().'
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const queryParameters: any = {};
|
|
140
|
+
|
|
141
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
let urlPath = `/api/v2/ar-scene/{sceneId}`;
|
|
145
|
+
urlPath = urlPath.replace('{sceneId}', encodeURIComponent(String(requestParameters['sceneId'])));
|
|
146
|
+
|
|
147
|
+
return {
|
|
148
|
+
path: urlPath,
|
|
149
|
+
method: 'HEAD',
|
|
150
|
+
headers: headerParameters,
|
|
151
|
+
query: queryParameters,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Verifies whether an AR scene exists or if a Model-State is linked to an AR scene.
|
|
157
|
+
*/
|
|
158
|
+
async getArSceneMetadataRaw(requestParameters: GetArSceneMetadataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
159
|
+
const requestOptions = await this.getArSceneMetadataRequestOpts(requestParameters);
|
|
160
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
161
|
+
|
|
162
|
+
return new runtime.VoidApiResponse(response);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Verifies whether an AR scene exists or if a Model-State is linked to an AR scene.
|
|
167
|
+
*/
|
|
168
|
+
async getArSceneMetadata(sceneId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
169
|
+
await this.getArSceneMetadataRaw({ sceneId: sceneId }, initOverrides);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
}
|