@vertexvis/api-client-node 0.20.9 → 0.21.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/cjs/api.d.ts +43 -1
- package/dist/cjs/api.js +176 -88
- package/dist/cjs/client/helpers/scene-items.d.ts +21 -0
- package/dist/cjs/client/helpers/scene-items.js +40 -1
- package/dist/cjs/client/helpers/scenes.d.ts +21 -38
- package/dist/cjs/client/helpers/scenes.js +231 -192
- package/dist/cjs/client/utils.d.ts +8 -1
- package/dist/cjs/client/utils.js +21 -2
- package/dist/cjs/client/version.d.ts +1 -1
- package/dist/cjs/client/version.js +1 -1
- package/dist/esm/api.d.ts +43 -1
- package/dist/esm/api.js +176 -88
- package/dist/esm/client/helpers/scene-items.d.ts +21 -0
- package/dist/esm/client/helpers/scene-items.js +38 -1
- package/dist/esm/client/helpers/scenes.d.ts +21 -38
- package/dist/esm/client/helpers/scenes.js +229 -188
- package/dist/esm/client/utils.d.ts +8 -1
- package/dist/esm/client/utils.js +18 -1
- package/dist/esm/client/version.d.ts +1 -1
- package/dist/esm/client/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { AxiosError, AxiosResponse, Method } from 'axios';
|
|
3
3
|
import { ParsedUrlQuery } from 'querystring';
|
|
4
|
-
import { ApiError, Failure, ImageType, Matrix4, Oauth2Api, OAuth2Token, QueuedJob } from '../index';
|
|
4
|
+
import { ApiError, Failure, ImageType, Matrix4, Oauth2Api, OAuth2Token, QueuedJob, RelationshipData } from '../index';
|
|
5
5
|
export interface Cursors {
|
|
6
6
|
readonly next?: string;
|
|
7
7
|
readonly self?: string;
|
|
@@ -136,6 +136,7 @@ export declare function is4x4Identity(transform: number[][]): boolean;
|
|
|
136
136
|
*/
|
|
137
137
|
export declare function isEncoded(s: string): boolean;
|
|
138
138
|
export declare function isApiError(error: unknown): error is ApiError;
|
|
139
|
+
export declare function isSceneItemRelationship(data: unknown): data is RelationshipData;
|
|
139
140
|
export declare function isFailure(obj: unknown): obj is Failure;
|
|
140
141
|
export declare function isQueuedJob(obj: unknown): obj is QueuedJob;
|
|
141
142
|
export declare function hasVertexError(error: unknown): error is VertexError;
|
|
@@ -225,3 +226,9 @@ export declare function tryStream<T>(fn: () => Promise<T>): Promise<T>;
|
|
|
225
226
|
* @returns `true` if webhook signature is valid and body is safe to parse.
|
|
226
227
|
*/
|
|
227
228
|
export declare function isWebhookValid(body: string, secret: string, signature: string): boolean;
|
|
229
|
+
/**
|
|
230
|
+
* Formats a number in seconds as a time formatted string.
|
|
231
|
+
* @param seconds number of seconds to be formatted
|
|
232
|
+
* @returns `string` in the form of HH:MM:SS based on input
|
|
233
|
+
*/
|
|
234
|
+
export declare function formatTime(seconds: number): string;
|
package/dist/cjs/client/utils.js
CHANGED
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.isWebhookValid = exports.tryStream = exports.toTransform = exports.to4x4Transform = exports.toFloats = exports.toAccept = exports.thrw = exports.required = exports.prettyJson = exports.partition = exports.parseUrl = exports.defined = exports.nowEpochMs = exports.multiply = exports.logError = exports.hasVertexErrorMessage = exports.hasVertexError = exports.isQueuedJob = exports.isFailure = exports.isApiError = exports.isEncoded = exports.is4x4Identity = exports.head = exports.groupBy = exports.getPage = exports.getErrorMessage = exports.getBySuppliedId = exports.envVar = exports.encodeIfNotEncoded = exports.delay = exports.createToken = exports.arrayChunked = exports.arrayEq2d = exports.arrayEq = exports.Utf8 = void 0;
|
|
12
|
+
exports.formatTime = exports.isWebhookValid = exports.tryStream = exports.toTransform = exports.to4x4Transform = exports.toFloats = exports.toAccept = exports.thrw = exports.required = exports.prettyJson = exports.partition = exports.parseUrl = exports.defined = exports.nowEpochMs = exports.multiply = exports.logError = exports.hasVertexErrorMessage = exports.hasVertexError = exports.isQueuedJob = exports.isFailure = exports.isSceneItemRelationship = exports.isApiError = exports.isEncoded = exports.is4x4Identity = exports.head = exports.groupBy = exports.getPage = exports.getErrorMessage = exports.getBySuppliedId = exports.envVar = exports.encodeIfNotEncoded = exports.delay = exports.createToken = exports.arrayChunked = exports.arrayEq2d = exports.arrayEq = exports.Utf8 = void 0;
|
|
13
13
|
const crypto_1 = require("crypto");
|
|
14
14
|
const querystring_1 = require("querystring");
|
|
15
15
|
const common_1 = require("../common");
|
|
@@ -212,9 +212,14 @@ function isEncoded(s) {
|
|
|
212
212
|
exports.isEncoded = isEncoded;
|
|
213
213
|
function isApiError(error) {
|
|
214
214
|
const ae = error;
|
|
215
|
-
return defined(ae.
|
|
215
|
+
return defined(ae.status) && defined(ae.code);
|
|
216
216
|
}
|
|
217
217
|
exports.isApiError = isApiError;
|
|
218
|
+
function isSceneItemRelationship(data) {
|
|
219
|
+
const rd = data;
|
|
220
|
+
return defined(rd.id) && defined(rd.type) && rd.type === 'scene-item';
|
|
221
|
+
}
|
|
222
|
+
exports.isSceneItemRelationship = isSceneItemRelationship;
|
|
218
223
|
function isFailure(obj) {
|
|
219
224
|
const f = obj;
|
|
220
225
|
return !defined(f.errors) || f.errors.size === 0
|
|
@@ -428,3 +433,17 @@ exports.isWebhookValid = isWebhookValid;
|
|
|
428
433
|
function arrayLenEq(a, b) {
|
|
429
434
|
return Array.isArray(a) && Array.isArray(b) && a.length === b.length;
|
|
430
435
|
}
|
|
436
|
+
/**
|
|
437
|
+
* Formats a number in seconds as a time formatted string.
|
|
438
|
+
* @param seconds number of seconds to be formatted
|
|
439
|
+
* @returns `string` in the form of HH:MM:SS based on input
|
|
440
|
+
*/
|
|
441
|
+
function formatTime(seconds) {
|
|
442
|
+
const h = Math.floor(seconds / 3600);
|
|
443
|
+
const m = Math.floor((seconds % 3600) / 60);
|
|
444
|
+
const s = Math.round(seconds % 60);
|
|
445
|
+
return [h, m > 9 ? m : h ? '0' + m : m || '0', s > 9 ? s : '0' + s]
|
|
446
|
+
.filter(Boolean)
|
|
447
|
+
.join(':');
|
|
448
|
+
}
|
|
449
|
+
exports.formatTime = formatTime;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.
|
|
1
|
+
export declare const version = "0.21.0";
|
package/dist/esm/api.d.ts
CHANGED
|
@@ -1277,6 +1277,12 @@ export interface CreateSceneItemOverrideRequestDataAttributes {
|
|
|
1277
1277
|
* @memberof CreateSceneItemOverrideRequestDataAttributes
|
|
1278
1278
|
*/
|
|
1279
1279
|
selected?: ColorMaterial;
|
|
1280
|
+
/**
|
|
1281
|
+
* Phantom state of the item.
|
|
1282
|
+
* @type {boolean}
|
|
1283
|
+
* @memberof CreateSceneItemOverrideRequestDataAttributes
|
|
1284
|
+
*/
|
|
1285
|
+
phantom?: boolean;
|
|
1280
1286
|
}
|
|
1281
1287
|
/**
|
|
1282
1288
|
*
|
|
@@ -1348,7 +1354,13 @@ export interface CreateSceneItemRequestDataAttributes {
|
|
|
1348
1354
|
*/
|
|
1349
1355
|
name?: string;
|
|
1350
1356
|
/**
|
|
1351
|
-
*
|
|
1357
|
+
* A 0-based index used for defining a consistent ordering amongst sibling scene items.
|
|
1358
|
+
* @type {number}
|
|
1359
|
+
* @memberof CreateSceneItemRequestDataAttributes
|
|
1360
|
+
*/
|
|
1361
|
+
ordinal?: number;
|
|
1362
|
+
/**
|
|
1363
|
+
* Optional ability to specify a parent scene item by scene item supplied ID. For example, an existing ID from a PLM system. This approach is an alternative to providing a specific scene item ID with the relationship parent property.
|
|
1352
1364
|
* @type {string}
|
|
1353
1365
|
* @memberof CreateSceneItemRequestDataAttributes
|
|
1354
1366
|
*/
|
|
@@ -1383,6 +1395,12 @@ export interface CreateSceneItemRequestDataAttributes {
|
|
|
1383
1395
|
* @memberof CreateSceneItemRequestDataAttributes
|
|
1384
1396
|
*/
|
|
1385
1397
|
visible?: boolean;
|
|
1398
|
+
/**
|
|
1399
|
+
* Phantom state of the item.
|
|
1400
|
+
* @type {boolean}
|
|
1401
|
+
* @memberof CreateSceneItemRequestDataAttributes
|
|
1402
|
+
*/
|
|
1403
|
+
phantom?: boolean;
|
|
1386
1404
|
/**
|
|
1387
1405
|
* Additional metadata for the scene-item. This metadata will take precedence over any metadata that belongs to the part file.
|
|
1388
1406
|
* @type {{ [key: string]: MetadataLongType | MetadataFloatType | MetadataDateType | MetadataStringType | MetadataNullType; }}
|
|
@@ -4030,6 +4048,12 @@ export interface SceneItemDataAttributes {
|
|
|
4030
4048
|
* @memberof SceneItemDataAttributes
|
|
4031
4049
|
*/
|
|
4032
4050
|
name?: string;
|
|
4051
|
+
/**
|
|
4052
|
+
*
|
|
4053
|
+
* @type {boolean}
|
|
4054
|
+
* @memberof SceneItemDataAttributes
|
|
4055
|
+
*/
|
|
4056
|
+
phantom?: boolean;
|
|
4033
4057
|
/**
|
|
4034
4058
|
*
|
|
4035
4059
|
* @type {string}
|
|
@@ -4191,6 +4215,12 @@ export interface SceneItemOverrideDataAttributes {
|
|
|
4191
4215
|
* @memberof SceneItemOverrideDataAttributes
|
|
4192
4216
|
*/
|
|
4193
4217
|
selected?: ColorMaterial;
|
|
4218
|
+
/**
|
|
4219
|
+
*
|
|
4220
|
+
* @type {boolean}
|
|
4221
|
+
* @memberof SceneItemOverrideDataAttributes
|
|
4222
|
+
*/
|
|
4223
|
+
phantom?: boolean;
|
|
4194
4224
|
}
|
|
4195
4225
|
/**
|
|
4196
4226
|
*
|
|
@@ -5179,6 +5209,12 @@ export interface UpdateSceneItemOverrideRequestDataAttributes {
|
|
|
5179
5209
|
* @memberof UpdateSceneItemOverrideRequestDataAttributes
|
|
5180
5210
|
*/
|
|
5181
5211
|
selected?: ColorMaterialNullable | null;
|
|
5212
|
+
/**
|
|
5213
|
+
*
|
|
5214
|
+
* @type {boolean}
|
|
5215
|
+
* @memberof UpdateSceneItemOverrideRequestDataAttributes
|
|
5216
|
+
*/
|
|
5217
|
+
phantom?: boolean | null;
|
|
5182
5218
|
}
|
|
5183
5219
|
/**
|
|
5184
5220
|
*
|
|
@@ -5262,6 +5298,12 @@ export interface UpdateSceneItemRequestDataAttributes {
|
|
|
5262
5298
|
metadata?: {
|
|
5263
5299
|
[key: string]: MetadataLongType | MetadataFloatType | MetadataDateType | MetadataStringType | MetadataNullType;
|
|
5264
5300
|
};
|
|
5301
|
+
/**
|
|
5302
|
+
* Phantom state of the item.
|
|
5303
|
+
* @type {boolean}
|
|
5304
|
+
* @memberof UpdateSceneItemRequestDataAttributes
|
|
5305
|
+
*/
|
|
5306
|
+
phantom?: boolean;
|
|
5265
5307
|
}
|
|
5266
5308
|
/**
|
|
5267
5309
|
*
|