@vertexvis/api-client-node 0.16.0 → 0.17.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/dist/esm/api.js CHANGED
@@ -54,6 +54,9 @@ export const ClearTransformOperationTypeEnum = {
54
54
  export const DeselectOperationTypeEnum = {
55
55
  Deselect: 'deselect',
56
56
  };
57
+ export const ExportRelationshipDataTypeEnum = {
58
+ Scene: 'scene',
59
+ };
57
60
  export const FileRelationshipDataTypeEnum = {
58
61
  File: 'file',
59
62
  };
@@ -1110,6 +1113,237 @@ export class BatchesApi extends BaseAPI {
1110
1113
  .then((request) => request(this.axios, this.basePath));
1111
1114
  }
1112
1115
  }
1116
+ /**
1117
+ * ExportsApi - axios parameter creator
1118
+ * @export
1119
+ */
1120
+ export const ExportsApiAxiosParamCreator = function (configuration) {
1121
+ return {
1122
+ /**
1123
+ * Create an `export`. This API is asynchronous, returning the location of a `queued-export`. Check the status via the getQueuedExport API.
1124
+ * @param {CreateExportRequest} createExportRequest
1125
+ * @param {*} [options] Override http request option.
1126
+ * @throws {RequiredError}
1127
+ */
1128
+ createExport: (createExportRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
1129
+ // verify required parameter 'createExportRequest' is not null or undefined
1130
+ assertParamExists('createExport', 'createExportRequest', createExportRequest);
1131
+ const localVarPath = `/exports`;
1132
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1133
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1134
+ let baseOptions;
1135
+ if (configuration) {
1136
+ baseOptions = configuration.baseOptions;
1137
+ }
1138
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
1139
+ const localVarHeaderParameter = {};
1140
+ const localVarQueryParameter = {};
1141
+ // authentication OAuth2 required
1142
+ // oauth required
1143
+ yield setOAuthToObject(localVarHeaderParameter, 'OAuth2', [], configuration);
1144
+ localVarHeaderParameter['Content-Type'] = 'application/vnd.api+json';
1145
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1146
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1147
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1148
+ localVarRequestOptions.data = serializeDataIfNeeded(createExportRequest, localVarRequestOptions, configuration);
1149
+ return {
1150
+ url: toPathString(localVarUrlObj),
1151
+ options: localVarRequestOptions,
1152
+ };
1153
+ }),
1154
+ /**
1155
+ * Get an `export` by ID.
1156
+ * @param {string} id The `export` ID.
1157
+ * @param {*} [options] Override http request option.
1158
+ * @throws {RequiredError}
1159
+ */
1160
+ getExport: (id, options = {}) => __awaiter(this, void 0, void 0, function* () {
1161
+ // verify required parameter 'id' is not null or undefined
1162
+ assertParamExists('getExport', 'id', id);
1163
+ const localVarPath = `/exports/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id)));
1164
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1165
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1166
+ let baseOptions;
1167
+ if (configuration) {
1168
+ baseOptions = configuration.baseOptions;
1169
+ }
1170
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
1171
+ const localVarHeaderParameter = {};
1172
+ const localVarQueryParameter = {};
1173
+ // authentication OAuth2 required
1174
+ // oauth required
1175
+ yield setOAuthToObject(localVarHeaderParameter, 'OAuth2', [], configuration);
1176
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1177
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1178
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1179
+ return {
1180
+ url: toPathString(localVarUrlObj),
1181
+ options: localVarRequestOptions,
1182
+ };
1183
+ }),
1184
+ /**
1185
+ * Get a `queued-export`. The response is either the status if `running` or `error` or, upon completion, redirects to the created `export`.
1186
+ * @param {string} id The `queued-export` ID.
1187
+ * @param {*} [options] Override http request option.
1188
+ * @throws {RequiredError}
1189
+ */
1190
+ getQueuedExport: (id, options = {}) => __awaiter(this, void 0, void 0, function* () {
1191
+ // verify required parameter 'id' is not null or undefined
1192
+ assertParamExists('getQueuedExport', 'id', id);
1193
+ const localVarPath = `/queued-exports/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id)));
1194
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1195
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1196
+ let baseOptions;
1197
+ if (configuration) {
1198
+ baseOptions = configuration.baseOptions;
1199
+ }
1200
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
1201
+ const localVarHeaderParameter = {};
1202
+ const localVarQueryParameter = {};
1203
+ // authentication OAuth2 required
1204
+ // oauth required
1205
+ yield setOAuthToObject(localVarHeaderParameter, 'OAuth2', [], configuration);
1206
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1207
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1208
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1209
+ return {
1210
+ url: toPathString(localVarUrlObj),
1211
+ options: localVarRequestOptions,
1212
+ };
1213
+ }),
1214
+ };
1215
+ };
1216
+ /**
1217
+ * ExportsApi - functional programming interface
1218
+ * @export
1219
+ */
1220
+ export const ExportsApiFp = function (configuration) {
1221
+ const localVarAxiosParamCreator = ExportsApiAxiosParamCreator(configuration);
1222
+ return {
1223
+ /**
1224
+ * Create an `export`. This API is asynchronous, returning the location of a `queued-export`. Check the status via the getQueuedExport API.
1225
+ * @param {CreateExportRequest} createExportRequest
1226
+ * @param {*} [options] Override http request option.
1227
+ * @throws {RequiredError}
1228
+ */
1229
+ createExport(createExportRequest, options) {
1230
+ return __awaiter(this, void 0, void 0, function* () {
1231
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.createExport(createExportRequest, options);
1232
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1233
+ });
1234
+ },
1235
+ /**
1236
+ * Get an `export` by ID.
1237
+ * @param {string} id The `export` ID.
1238
+ * @param {*} [options] Override http request option.
1239
+ * @throws {RequiredError}
1240
+ */
1241
+ getExport(id, options) {
1242
+ return __awaiter(this, void 0, void 0, function* () {
1243
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getExport(id, options);
1244
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1245
+ });
1246
+ },
1247
+ /**
1248
+ * Get a `queued-export`. The response is either the status if `running` or `error` or, upon completion, redirects to the created `export`.
1249
+ * @param {string} id The `queued-export` ID.
1250
+ * @param {*} [options] Override http request option.
1251
+ * @throws {RequiredError}
1252
+ */
1253
+ getQueuedExport(id, options) {
1254
+ return __awaiter(this, void 0, void 0, function* () {
1255
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getQueuedExport(id, options);
1256
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1257
+ });
1258
+ },
1259
+ };
1260
+ };
1261
+ /**
1262
+ * ExportsApi - factory interface
1263
+ * @export
1264
+ */
1265
+ export const ExportsApiFactory = function (configuration, basePath, axios) {
1266
+ const localVarFp = ExportsApiFp(configuration);
1267
+ return {
1268
+ /**
1269
+ * Create an `export`. This API is asynchronous, returning the location of a `queued-export`. Check the status via the getQueuedExport API.
1270
+ * @param {CreateExportRequest} createExportRequest
1271
+ * @param {*} [options] Override http request option.
1272
+ * @throws {RequiredError}
1273
+ */
1274
+ createExport(createExportRequest, options) {
1275
+ return localVarFp
1276
+ .createExport(createExportRequest, options)
1277
+ .then((request) => request(axios, basePath));
1278
+ },
1279
+ /**
1280
+ * Get an `export` by ID.
1281
+ * @param {string} id The `export` ID.
1282
+ * @param {*} [options] Override http request option.
1283
+ * @throws {RequiredError}
1284
+ */
1285
+ getExport(id, options) {
1286
+ return localVarFp
1287
+ .getExport(id, options)
1288
+ .then((request) => request(axios, basePath));
1289
+ },
1290
+ /**
1291
+ * Get a `queued-export`. The response is either the status if `running` or `error` or, upon completion, redirects to the created `export`.
1292
+ * @param {string} id The `queued-export` ID.
1293
+ * @param {*} [options] Override http request option.
1294
+ * @throws {RequiredError}
1295
+ */
1296
+ getQueuedExport(id, options) {
1297
+ return localVarFp
1298
+ .getQueuedExport(id, options)
1299
+ .then((request) => request(axios, basePath));
1300
+ },
1301
+ };
1302
+ };
1303
+ /**
1304
+ * ExportsApi - object-oriented interface
1305
+ * @export
1306
+ * @class ExportsApi
1307
+ * @extends {BaseAPI}
1308
+ */
1309
+ export class ExportsApi extends BaseAPI {
1310
+ /**
1311
+ * Create an `export`. This API is asynchronous, returning the location of a `queued-export`. Check the status via the getQueuedExport API.
1312
+ * @param {ExportsApiCreateExportRequest} requestParameters Request parameters.
1313
+ * @param {*} [options] Override http request option.
1314
+ * @throws {RequiredError}
1315
+ * @memberof ExportsApi
1316
+ */
1317
+ createExport(requestParameters, options) {
1318
+ return ExportsApiFp(this.configuration)
1319
+ .createExport(requestParameters.createExportRequest, options)
1320
+ .then((request) => request(this.axios, this.basePath));
1321
+ }
1322
+ /**
1323
+ * Get an `export` by ID.
1324
+ * @param {ExportsApiGetExportRequest} requestParameters Request parameters.
1325
+ * @param {*} [options] Override http request option.
1326
+ * @throws {RequiredError}
1327
+ * @memberof ExportsApi
1328
+ */
1329
+ getExport(requestParameters, options) {
1330
+ return ExportsApiFp(this.configuration)
1331
+ .getExport(requestParameters.id, options)
1332
+ .then((request) => request(this.axios, this.basePath));
1333
+ }
1334
+ /**
1335
+ * Get a `queued-export`. The response is either the status if `running` or `error` or, upon completion, redirects to the created `export`.
1336
+ * @param {ExportsApiGetQueuedExportRequest} requestParameters Request parameters.
1337
+ * @param {*} [options] Override http request option.
1338
+ * @throws {RequiredError}
1339
+ * @memberof ExportsApi
1340
+ */
1341
+ getQueuedExport(requestParameters, options) {
1342
+ return ExportsApiFp(this.configuration)
1343
+ .getQueuedExport(requestParameters.id, options)
1344
+ .then((request) => request(this.axios, this.basePath));
1345
+ }
1346
+ }
1113
1347
  /**
1114
1348
  * FilesApi - axios parameter creator
1115
1349
  * @export
@@ -0,0 +1,15 @@
1
+ import { CreateExportRequest, Export } from '../../index';
2
+ import { BaseReq } from '../index';
3
+ /**
4
+ * Create export arguments.
5
+ */
6
+ export interface CreateExportReq extends BaseReq {
7
+ /** Function returning a {@link CreateExportRequest}. */
8
+ readonly createExportReq: () => CreateExportRequest;
9
+ }
10
+ /**
11
+ * Create an export.
12
+ *
13
+ * @param args - The {@link CreateExportReq}.
14
+ */
15
+ export declare function createExport({ client, createExportReq, onMsg, verbose, }: CreateExportReq): Promise<Export>;
@@ -0,0 +1,35 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { isPollError, MaxAttempts, PollIntervalMs, pollQueuedJob, throwOnError, } from '../index';
11
+ /**
12
+ * Create an export.
13
+ *
14
+ * @param args - The {@link CreateExportReq}.
15
+ */
16
+ export function createExport({ client, createExportReq, onMsg = console.log, verbose, }) {
17
+ return __awaiter(this, void 0, void 0, function* () {
18
+ const res = yield client.exports.createExport({
19
+ createExportRequest: createExportReq(),
20
+ });
21
+ const queuedId = res.data.data.id;
22
+ if (verbose)
23
+ onMsg(`Created export with queued-export ${queuedId}`);
24
+ const pollRes = yield pollQueuedJob({
25
+ id: queuedId,
26
+ getQueuedJob: (id) => client.exports.getQueuedExport({ id }),
27
+ polling: { intervalMs: PollIntervalMs, maxAttempts: MaxAttempts },
28
+ });
29
+ if (isPollError(pollRes.res))
30
+ throwOnError(pollRes);
31
+ if (verbose)
32
+ onMsg(`Completed export ${pollRes.res.data.id}`);
33
+ return pollRes.res;
34
+ });
35
+ }
@@ -1,3 +1,4 @@
1
+ export * from './exports';
1
2
  export * from './files';
2
3
  export * from './parts';
3
4
  export * from './scenes';
@@ -1,3 +1,4 @@
1
+ export * from './exports';
1
2
  export * from './files';
2
3
  export * from './parts';
3
4
  export * from './scenes';
@@ -1 +1 @@
1
- export declare const version = "0.15.6";
1
+ export declare const version = "0.17.0";
@@ -1 +1 @@
1
- export const version = '0.15.6';
1
+ export const version = '0.17.0';
@@ -1,5 +1,5 @@
1
1
  import { AxiosInstance, AxiosRequestConfig } from 'axios';
2
- import { AccountsApi, ApplicationsApi, BatchesApi, Configuration, FilesApi, GeometrySetsApi, HitsApi, Oauth2Api, OAuth2Token, PartRevisionsApi, PartsApi, SceneAlterationsApi, SceneItemOverridesApi, SceneItemsApi, ScenesApi, SceneViewsApi, SceneViewStatesApi, StreamKeysApi, TranslationInspectionsApi, WebhookSubscriptionsApi } from '../index';
2
+ import { AccountsApi, ApplicationsApi, BatchesApi, Configuration, ExportsApi, FilesApi, GeometrySetsApi, HitsApi, Oauth2Api, OAuth2Token, PartRevisionsApi, PartsApi, SceneAlterationsApi, SceneItemOverridesApi, SceneItemsApi, ScenesApi, SceneViewsApi, SceneViewStatesApi, StreamKeysApi, TranslationInspectionsApi, WebhookSubscriptionsApi } from '../index';
3
3
  import { BasePath } from './index';
4
4
  /**
5
5
  * Static `build` function arguments.
@@ -72,6 +72,7 @@ export declare class VertexClient {
72
72
  accounts: AccountsApi;
73
73
  applications: ApplicationsApi;
74
74
  batches: BatchesApi;
75
+ exports: ExportsApi;
75
76
  files: FilesApi;
76
77
  geometrySets: GeometrySetsApi;
77
78
  hits: HitsApi;
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  var _a;
11
11
  import axios from 'axios';
12
- import { AccountsApi, ApplicationsApi, BatchesApi, Configuration, FilesApi, GeometrySetsApi, HitsApi, Oauth2Api, PartRevisionsApi, PartsApi, SceneAlterationsApi, SceneItemOverridesApi, SceneItemsApi, ScenesApi, SceneViewsApi, SceneViewStatesApi, StreamKeysApi, TranslationInspectionsApi, WebhookSubscriptionsApi, } from '../index';
12
+ import { AccountsApi, ApplicationsApi, BatchesApi, Configuration, ExportsApi, FilesApi, GeometrySetsApi, HitsApi, Oauth2Api, PartRevisionsApi, PartsApi, SceneAlterationsApi, SceneItemOverridesApi, SceneItemsApi, ScenesApi, SceneViewsApi, SceneViewStatesApi, StreamKeysApi, TranslationInspectionsApi, WebhookSubscriptionsApi, } from '../index';
13
13
  import { createToken, isFailure, nowEpochMs, prettyJson, } from './index';
14
14
  import { version } from './version';
15
15
  const TenMinsInMs = 600000;
@@ -73,6 +73,7 @@ export class VertexClient {
73
73
  this.accounts = new AccountsApi(this.config, undefined, axiosInst);
74
74
  this.applications = new ApplicationsApi(this.config, undefined, axiosInst);
75
75
  this.batches = new BatchesApi(this.config, undefined, axiosInst);
76
+ this.exports = new ExportsApi(this.config, undefined, axiosInst);
76
77
  this.files = new FilesApi(this.config, undefined, axiosInst);
77
78
  this.geometrySets = new GeometrySetsApi(this.config, undefined, axiosInst);
78
79
  this.hits = new HitsApi(this.config, undefined, axiosInst);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertexvis/api-client-node",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "The Vertex REST API client for Node.js.",
5
5
  "license": "MIT",
6
6
  "author": "Vertex Developers <support@vertexvis.com> (https://developer.vertexvis.com)",