@engine9-io/input-tools 2.0.3 → 2.0.4

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.
Files changed (2) hide show
  1. package/index.js +11 -6
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -167,7 +167,7 @@ function intToByteArray(_v) {
167
167
  return byteArray;
168
168
  }
169
169
  function getPluginUUID(uniqueNamespaceLikeDomainName, valueWithinNamespace) {
170
- // Random custom namespace for plugins -- not secure, just a namespace:
170
+ // Random custom namespace for plugins -- not intended for cryptographically secure, just a unique namespace:
171
171
  return uuidv5(`${uniqueNamespaceLikeDomainName}::${valueWithinNamespace}`, 'f9e1024d-21ac-473c-bac6-64796dd771dd');
172
172
  }
173
173
  function getInputUUID(a, b) {
@@ -253,11 +253,16 @@ function getTimelineEntryUUID(inputObject, { defaults = {} } = {}) {
253
253
  // get a temp ID
254
254
  if (!o.input_id)
255
255
  throw new Error('Error generating timeline entry uuid -- remote_entry_id specified, but no input_id');
256
- const uuid = uuidv5(String(o.remote_entry_id), o.input_id);
257
- // Change out the ts to match the v7 sorting.
258
- // But because outside specified remote_entry_uuid
259
- // may not match this standard, uuid sorting isn't guaranteed
260
- return getUUIDv7(o.ts, uuid);
256
+ try {
257
+ const uuid = uuidv5(String(o.remote_entry_id), o.input_id);
258
+ // Change out the ts to match the v7 sorting.
259
+ // But because outside specified remote_entry_uuid
260
+ // may not match this standard, uuid sorting isn't guaranteed
261
+ return getUUIDv7(o.ts, uuid);
262
+ } catch (e) {
263
+ debug('Error getting uuid with object:', o);
264
+ throw e;
265
+ }
261
266
  }
262
267
  o.entry_type_id = getEntryTypeId(o);
263
268
  const missing = requiredTimelineEntryFields.filter((d) => o[d] === undefined); // 0 could be an entry type value
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@engine9-io/input-tools",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "type": "module",
5
5
  "description": "Tools for dealing with Engine9 inputs",
6
6
  "main": "index.js",