@engine9-io/input-tools 1.9.10 → 1.9.11
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/index.js +3 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -254,7 +254,7 @@ function getEntryTypeId(o, { defaults = {} } = {}) {
|
|
|
254
254
|
if (id) return id;
|
|
255
255
|
const etype = o.entry_type || defaults.entry_type;
|
|
256
256
|
if (!etype) {
|
|
257
|
-
throw new Error('No entry_type, nor entry_type_id specified, specify a
|
|
257
|
+
throw new Error('No entry_type, nor entry_type_id specified, specify one to generate a timeline suitable ID');
|
|
258
258
|
}
|
|
259
259
|
id = TIMELINE_ENTRY_TYPES[etype];
|
|
260
260
|
if (id === undefined) throw new Error(`Invalid entry_type: ${etype}`);
|
|
@@ -299,7 +299,7 @@ function getTimelineEntryUUID(inputObject, { defaults = {} } = {}) {
|
|
|
299
299
|
// may not match this standard, uuid sorting isn't guaranteed
|
|
300
300
|
return getUUIDv7(o.ts, uuid);
|
|
301
301
|
}
|
|
302
|
-
|
|
302
|
+
o.entry_type_id = getEntryTypeId(o);
|
|
303
303
|
|
|
304
304
|
const missing = requiredTimelineEntryFields.filter((d) => o[d] === undefined); // 0 could be an entry type value
|
|
305
305
|
|
|
@@ -309,7 +309,7 @@ function getTimelineEntryUUID(inputObject, { defaults = {} } = {}) {
|
|
|
309
309
|
// attempted conversion here
|
|
310
310
|
|
|
311
311
|
if (isNaN(ts)) throw new Error(`getTimelineEntryUUID got an invalid date:${o.ts || '<blank>'}`);
|
|
312
|
-
const idString = `${ts.toISOString()}-${o.person_id}-${entry_type_id}-${o.source_code_id || 0}`;
|
|
312
|
+
const idString = `${ts.toISOString()}-${o.person_id}-${o.entry_type_id}-${o.source_code_id || 0}`;
|
|
313
313
|
|
|
314
314
|
if (!uuidIsValid(o.input_id)) {
|
|
315
315
|
throw new Error(`Invalid input_id:'${o.input_id}', type ${typeof o.input_id} -- should be a uuid`);
|