@vertexvis/api-client-node 0.20.10 → 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.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.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";
|