@vertexvis/api-client-node 0.15.6 → 0.17.1

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.
@@ -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.1";
@@ -1 +1 @@
1
- export const version = '0.15.6';
1
+ export const version = '0.17.1';
@@ -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.15.6",
3
+ "version": "0.17.1",
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)",