@izara_project/izara-core-library-service-schemas 1.0.75 → 1.0.77
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@izara_project/izara-core-library-service-schemas",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.77",
|
|
4
4
|
"description": "Schemas for the service and objects it controls",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@izara_project/izara-core-library-lambda": "^1.0.4",
|
|
30
30
|
"@izara_project/izara-core-library-logger": "^1.0.7",
|
|
31
31
|
"@izara_project/izara-shared-core": "^1.0.2",
|
|
32
|
-
"@izara_project/izara-shared-service-schemas": "^1.0.
|
|
32
|
+
"@izara_project/izara-shared-service-schemas": "^1.0.22",
|
|
33
33
|
"glob": "^11.0.3",
|
|
34
34
|
"lodash": "^4.17.21",
|
|
35
35
|
"object-hash": "^3.0.0",
|
package/src/GetObjectSchema.js
CHANGED
|
@@ -544,10 +544,7 @@ async function getObjSchemaS3WithoutHierarchy(_izContext, objType) {
|
|
|
544
544
|
async function getObjectSchemaCombineFieldNames(_izContext, objType) {
|
|
545
545
|
|
|
546
546
|
const objSchema = await getObjSchemaS3WithHierarchy(_izContext, objType);
|
|
547
|
-
|
|
548
|
-
throw new NoRetryError(`getObjectSchemaCombineFieldNames: ${objSchema.errorsFound.join(', ')}`);
|
|
549
|
-
}
|
|
550
|
-
const combinedSchema = generateObjectSchemaForCombineFieldNames(_izContext, objSchema.result);
|
|
547
|
+
const combinedSchema = generateObjectSchemaForCombineFieldNames(_izContext, objSchema);
|
|
551
548
|
return combinedSchema
|
|
552
549
|
}
|
|
553
550
|
|
|
@@ -877,15 +874,16 @@ const getRequiredOnCreateLinksWithCache = inMemoryCacheLib(
|
|
|
877
874
|
* @param {String} relationshipTag
|
|
878
875
|
* @returns {Promise<{from:Object, to:Object}>}
|
|
879
876
|
*/
|
|
880
|
-
async function getLinkConfig(_izContext, firstObjType, secondObjType, relType, direction) {
|
|
877
|
+
async function getLinkConfig(_izContext, firstObjType, secondObjType, relType, direction, settings = {}) {
|
|
881
878
|
_izContext.logger.debug("getLinkConfig: ", {
|
|
882
879
|
firstObjType,
|
|
883
880
|
secondObjType,
|
|
884
881
|
relType,
|
|
885
|
-
direction
|
|
882
|
+
direction,
|
|
883
|
+
settings
|
|
886
884
|
});
|
|
887
885
|
|
|
888
|
-
return await getLinkConfigByLinkTypeId(_izContext, firstObjType, secondObjType, relType, direction);
|
|
886
|
+
return await getLinkConfigByLinkTypeId(_izContext, firstObjType, secondObjType, relType, direction, settings);
|
|
889
887
|
}
|
|
890
888
|
|
|
891
889
|
/**
|
|
@@ -922,7 +920,7 @@ async function getLinkConfigByLinkTypeId(_izContext, firstObjType, secondObjType
|
|
|
922
920
|
settings
|
|
923
921
|
});
|
|
924
922
|
|
|
925
|
-
await getLinkConfigByLinkTypeIdShared(getSchemaByNameWithCache, firstObjType, secondObjType, relType, direction, settings).then(res => {
|
|
923
|
+
return await getLinkConfigByLinkTypeIdShared(getSchemaByNameWithCache, firstObjType, secondObjType, relType, direction, settings).then(res => {
|
|
926
924
|
if (res.errorsFound.length && res.errorsFound.length > 0) {
|
|
927
925
|
throw new NoRetryError(res.errorsFound.join(","))
|
|
928
926
|
} else {
|
package/src/UploadObjSchema.js
CHANGED
|
@@ -54,7 +54,7 @@ const {
|
|
|
54
54
|
|
|
55
55
|
const {
|
|
56
56
|
DEFAULT_REL_ID_SETTING,
|
|
57
|
-
|
|
57
|
+
// ORIGIN_TIMESTAMP_FIELDNAME,
|
|
58
58
|
generateObjectSchemaForCreate,
|
|
59
59
|
generateObjectSchemaForUpdate,
|
|
60
60
|
generateObjectSchemaForCombineFieldNames,
|
|
@@ -208,6 +208,7 @@ async function uploadObjectSchemaByUseCase(_izContext) {
|
|
|
208
208
|
_izContext.logger.debug("DEFAULT_REL_ID_SETTING: ", DEFAULT_REL_ID_SETTING);
|
|
209
209
|
|
|
210
210
|
Object.assign(relSchemaData.fieldNames, DEFAULT_REL_ID_SETTING);
|
|
211
|
+
// Object.assign(relSchemaData.fieldNames, DEFAULT_REL_ID_SETTING, ORIGIN_TIMESTAMP_FIELDNAME);
|
|
211
212
|
}
|
|
212
213
|
}
|
|
213
214
|
|
|
@@ -484,7 +485,7 @@ async function uploadObjectSchemaByUseCase(_izContext) {
|
|
|
484
485
|
|
|
485
486
|
// upload relationshipTag
|
|
486
487
|
for (const relTagDetail of allObjectRelationships) {
|
|
487
|
-
|
|
488
|
+
// console.log("relTagDetail", JSON.stringify(relTagDetail, null, 2))
|
|
488
489
|
const relationshipTag = Object.keys(relTagDetail)[0];
|
|
489
490
|
|
|
490
491
|
|
|
@@ -545,9 +546,9 @@ async function uploadObjectSchemaByUseCase(_izContext) {
|
|
|
545
546
|
)
|
|
546
547
|
}
|
|
547
548
|
|
|
548
|
-
const
|
|
549
|
+
const linksPerObjectType = groupLinksPerObjectType(_izContext, allObjectRelationships, foundedObjectTypes)
|
|
549
550
|
|
|
550
|
-
for (const [relObjectType, relTagsData] of Object.entries(
|
|
551
|
+
for (const [relObjectType, relTagsData] of Object.entries(linksPerObjectType)) {
|
|
551
552
|
uploadList.push(
|
|
552
553
|
uploadObjectToS3(
|
|
553
554
|
_izContext,
|
|
@@ -49,6 +49,14 @@ const DEFAULT_REL_ID_SETTING = {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
// const ORIGIN_TIMESTAMP_FIELDNAME = {
|
|
53
|
+
// originTimestamp: {
|
|
54
|
+
// type: "number",
|
|
55
|
+
// requiredOnCreate: true,
|
|
56
|
+
// canUpdate: false,
|
|
57
|
+
// validation: {}
|
|
58
|
+
// }
|
|
59
|
+
// }
|
|
52
60
|
/**
|
|
53
61
|
* create object schema for create case
|
|
54
62
|
*
|
|
@@ -375,6 +383,10 @@ function generateLinksDataPerLinkTypeId(_izContext, relationshipTag, relationshi
|
|
|
375
383
|
from: link.from,
|
|
376
384
|
to: link.to
|
|
377
385
|
};
|
|
386
|
+
|
|
387
|
+
if (link.requestProperties) {
|
|
388
|
+
linksData[linkTypeId].requestProperties = link.requestProperties
|
|
389
|
+
}
|
|
378
390
|
}
|
|
379
391
|
|
|
380
392
|
return linksData;
|
|
@@ -477,6 +489,7 @@ module.exports = {
|
|
|
477
489
|
generateLinksDataPerLinkTypeId,
|
|
478
490
|
groupRefObjectRelPerObjectType,
|
|
479
491
|
DEFAULT_REL_ID_SETTING,
|
|
492
|
+
// ORIGIN_TIMESTAMP_FIELDNAME,
|
|
480
493
|
|
|
481
494
|
// external service
|
|
482
495
|
refRelationshipPerObjectSchema
|