@vertexvis/api-client-node 0.20.10 → 0.21.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.
@@ -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;
@@ -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.id) && defined(ae.status) && defined(ae.code);
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.20.10";
1
+ export declare const version = "0.21.1";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = void 0;
4
- exports.version = '0.20.10';
4
+ exports.version = '0.21.1';
package/dist/esm/api.d.ts CHANGED
@@ -1273,10 +1273,10 @@ export interface CreateSceneItemOverrideRequestDataAttributes {
1273
1273
  material?: ColorMaterial;
1274
1274
  /**
1275
1275
  *
1276
- * @type {ColorMaterial}
1276
+ * @type {boolean}
1277
1277
  * @memberof CreateSceneItemOverrideRequestDataAttributes
1278
1278
  */
1279
- selected?: ColorMaterial;
1279
+ selected?: boolean;
1280
1280
  /**
1281
1281
  * Phantom state of the item.
1282
1282
  * @type {boolean}
@@ -4211,10 +4211,10 @@ export interface SceneItemOverrideDataAttributes {
4211
4211
  material?: ColorMaterial;
4212
4212
  /**
4213
4213
  *
4214
- * @type {ColorMaterial}
4214
+ * @type {boolean}
4215
4215
  * @memberof SceneItemOverrideDataAttributes
4216
4216
  */
4217
- selected?: ColorMaterial;
4217
+ selected?: boolean;
4218
4218
  /**
4219
4219
  *
4220
4220
  * @type {boolean}
@@ -5205,10 +5205,10 @@ export interface UpdateSceneItemOverrideRequestDataAttributes {
5205
5205
  material?: ColorMaterialNullable | null;
5206
5206
  /**
5207
5207
  *
5208
- * @type {ColorMaterialNullable}
5208
+ * @type {boolean}
5209
5209
  * @memberof UpdateSceneItemOverrideRequestDataAttributes
5210
5210
  */
5211
- selected?: ColorMaterialNullable | null;
5211
+ selected?: boolean | null;
5212
5212
  /**
5213
5213
  *
5214
5214
  * @type {boolean}