@izara_project/izara-core-library-service-schemas 1.0.80 → 1.0.81
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 +2 -2
- package/src/SharedUtils.js +1 -1
- package/src/ValidatorSchema.js +15 -3
- package/src/libs/DeliminatorTree.js +1 -2
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.81",
|
|
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.24",
|
|
33
33
|
"glob": "^11.0.3",
|
|
34
34
|
"lodash": "^4.17.21",
|
|
35
35
|
"object-hash": "^3.0.0",
|
package/src/SharedUtils.js
CHANGED
|
@@ -475,7 +475,7 @@ async function _processObjectLinksGroup(_izContext, relationshipTag, objectLinks
|
|
|
475
475
|
storageResourceTags,
|
|
476
476
|
objectRelationships,
|
|
477
477
|
relationshipSchema,
|
|
478
|
-
|
|
478
|
+
process.env.iz_serviceSchemaBucketName
|
|
479
479
|
);
|
|
480
480
|
results.push(...firstNodeResults);
|
|
481
481
|
} catch (error) {
|
package/src/ValidatorSchema.js
CHANGED
|
@@ -466,7 +466,7 @@ async function generateValidatorSchemaForCreate(_izContext, objType, settings =
|
|
|
466
466
|
// ------- create return validatorSchema -------
|
|
467
467
|
let validatorSchemaForCreate = {
|
|
468
468
|
type: "object",
|
|
469
|
-
required: ["fieldNames"],
|
|
469
|
+
required: ["fieldNames", "objectType"],
|
|
470
470
|
properties: {
|
|
471
471
|
fieldNames: {
|
|
472
472
|
additionalProperties: false,
|
|
@@ -476,6 +476,10 @@ async function generateValidatorSchemaForCreate(_izContext, objType, settings =
|
|
|
476
476
|
...allValidatorSchemaFieldNames
|
|
477
477
|
}
|
|
478
478
|
},
|
|
479
|
+
objectType: {
|
|
480
|
+
type: "string",
|
|
481
|
+
pattern: "^[a-zA-Z0-9_-]+$"
|
|
482
|
+
},
|
|
479
483
|
additionalParams: {
|
|
480
484
|
type: "object"
|
|
481
485
|
}
|
|
@@ -555,8 +559,12 @@ async function generateValidatorSchemaForUpdate(_izContext, objType, settings =
|
|
|
555
559
|
|
|
556
560
|
let initialValidatorSchemaForUpdate = {
|
|
557
561
|
type: "object",
|
|
558
|
-
required: ["objInstanceFull"],
|
|
562
|
+
required: ["objInstanceFull", "objectType"],
|
|
559
563
|
properties: {
|
|
564
|
+
objectType: {
|
|
565
|
+
type: "string",
|
|
566
|
+
pattern: "^[a-zA-Z0-9_-]+$"
|
|
567
|
+
},
|
|
560
568
|
objInstanceFull: {
|
|
561
569
|
type: "object",
|
|
562
570
|
required: ["identifiers", "fields"],
|
|
@@ -640,8 +648,12 @@ async function generateValidatorSchemaForIdentifier(_izContext, objType, setting
|
|
|
640
648
|
|
|
641
649
|
return {
|
|
642
650
|
type: "object",
|
|
643
|
-
required: ["identifiers"],
|
|
651
|
+
required: ["identifiers", "objectType"],
|
|
644
652
|
properties: {
|
|
653
|
+
objectType: {
|
|
654
|
+
type: "string",
|
|
655
|
+
pattern: "^[a-zA-Z0-9_-]+$"
|
|
656
|
+
},
|
|
645
657
|
identifiers: {
|
|
646
658
|
type: "object",
|
|
647
659
|
required: Object.keys(generatedIdentifiersValidatorSchema),
|
|
@@ -43,11 +43,10 @@ async function generateDeliminatorTreePerFieldName(_izContext, fieldName, fieldN
|
|
|
43
43
|
[fieldName]: {},
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
-
if (
|
|
46
|
+
if (objType) {
|
|
47
47
|
Object.assign(deliminatorTree[fieldName], objType);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
|
|
51
50
|
// ------- create tree first -------
|
|
52
51
|
|
|
53
52
|
if (fieldNameSetting.fromServiceNameTag && fieldNameSetting.fromObjectType) {
|