@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.
@@ -195,7 +195,11 @@ export function isEncoded(s) {
195
195
  }
196
196
  export function isApiError(error) {
197
197
  const ae = error;
198
- return defined(ae.id) && defined(ae.status) && defined(ae.code);
198
+ return defined(ae.status) && defined(ae.code);
199
+ }
200
+ export function isSceneItemRelationship(data) {
201
+ const rd = data;
202
+ return defined(rd.id) && defined(rd.type) && rd.type === 'scene-item';
199
203
  }
200
204
  export function isFailure(obj) {
201
205
  const f = obj;
@@ -391,3 +395,16 @@ export function isWebhookValid(body, secret, signature) {
391
395
  function arrayLenEq(a, b) {
392
396
  return Array.isArray(a) && Array.isArray(b) && a.length === b.length;
393
397
  }
398
+ /**
399
+ * Formats a number in seconds as a time formatted string.
400
+ * @param seconds number of seconds to be formatted
401
+ * @returns `string` in the form of HH:MM:SS based on input
402
+ */
403
+ export function formatTime(seconds) {
404
+ const h = Math.floor(seconds / 3600);
405
+ const m = Math.floor((seconds % 3600) / 60);
406
+ const s = Math.round(seconds % 60);
407
+ return [h, m > 9 ? m : h ? '0' + m : m || '0', s > 9 ? s : '0' + s]
408
+ .filter(Boolean)
409
+ .join(':');
410
+ }
@@ -1 +1 @@
1
- export declare const version = "0.20.9";
1
+ export declare const version = "0.21.0";
@@ -1 +1 @@
1
- export const version = '0.20.9';
1
+ export const version = '0.21.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertexvis/api-client-node",
3
- "version": "0.20.9",
3
+ "version": "0.21.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)",