@izara_project/izara-core-library-service-schemas 1.0.100 → 1.0.102
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 +37 -19
- package/package.json +15 -15
- package/src/Consts.js +12 -12
- package/src/GetObjectSchema.js +66 -112
- package/src/IdentifiersObject.js +24 -24
- package/src/ServiceConfig.js +11 -16
- package/src/SharedUtils.js +26 -34
- package/src/UploadObjSchema.js +55 -103
- package/src/Utils.js +25 -46
- package/src/ValidatorSchema.js +58 -96
- package/src/libs/CreateNodeLib.js +12 -14
- package/src/libs/DeliminatorTree.js +6 -6
- package/src/libs/ExplodedReqParams.js +3 -3
- package/src/libs/LambdaUtils.js +2 -4
- package/src/libs/RelSchemaLib.js +9 -12
- package/src/libs/SharedUtilsLibs.js +1 -1
- package/src/libs/UploadUseCase.js +12 -27
- package/src/libs/s3Utils.js +11 -11
package/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
/*
|
|
2
3
|
Copyright (C) 2021 Sven Mason <http://izara.io>
|
|
3
4
|
|
|
@@ -16,23 +17,40 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
16
17
|
*/
|
|
17
18
|
|
|
18
19
|
'use strict';
|
|
20
|
+
// .src
|
|
21
|
+
|
|
22
|
+
import deliminatorTree from './src/libs/DeliminatorTree.js';
|
|
23
|
+
import explodedReqParams from './src/libs/ExplodedReqParams.js';
|
|
24
|
+
import uploadUseCase from './src/libs/UploadUseCase.js';
|
|
25
|
+
import relSchemaLib from './src/libs/RelSchemaLib.js';
|
|
26
|
+
import s3Utils from './src/libs/s3Utils.js';
|
|
27
|
+
import createNodeLib from './src/libs/CreateNodeLib.js';
|
|
28
|
+
|
|
29
|
+
import consts from './src/Consts.js';
|
|
30
|
+
import getObjectSchema from './src/GetObjectSchema.js';
|
|
31
|
+
import uploadObjSchema from './src/UploadObjSchema.js';
|
|
32
|
+
import validator from './src/ValidatorSchema.js';
|
|
33
|
+
import serviceConfig from './src/ServiceConfig.js';
|
|
34
|
+
import utils from './src/Utils.js';
|
|
35
|
+
import identifiersObject from './src/IdentifiersObject.js';
|
|
36
|
+
import sharedUtils from './src/SharedUtils.js';
|
|
37
|
+
|
|
38
|
+
export {
|
|
39
|
+
// ./src/lib/
|
|
40
|
+
deliminatorTree,
|
|
41
|
+
explodedReqParams,
|
|
42
|
+
uploadUseCase,
|
|
43
|
+
relSchemaLib,
|
|
44
|
+
s3Utils,
|
|
45
|
+
createNodeLib,
|
|
19
46
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
consts: require('./src/Consts'),
|
|
31
|
-
getObjectSchema: require('./src/GetObjectSchema'),
|
|
32
|
-
uploadObjSchema: require('./src/UploadObjSchema'),
|
|
33
|
-
validator: require('./src/ValidatorSchema'),
|
|
34
|
-
serviceConfig: require('./src/ServiceConfig'),
|
|
35
|
-
utils: require('./src/Utils'),
|
|
36
|
-
identifiersObject: require('./src/IdentifiersObject'),
|
|
37
|
-
sharedUtils: require('./src/SharedUtils'),
|
|
38
|
-
}
|
|
47
|
+
// ./src/
|
|
48
|
+
consts,
|
|
49
|
+
getObjectSchema,
|
|
50
|
+
uploadObjSchema,
|
|
51
|
+
validator,
|
|
52
|
+
serviceConfig,
|
|
53
|
+
utils,
|
|
54
|
+
identifiersObject,
|
|
55
|
+
sharedUtils,
|
|
56
|
+
};
|
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.102",
|
|
4
4
|
"description": "Schemas for the service and objects it controls",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -14,26 +14,26 @@
|
|
|
14
14
|
"license": "AGPL-3.0-or-later",
|
|
15
15
|
"homepage": "https://bitbucket.org/izara-core-libraries/izara-core-library-service-schemas/src/master/README.md",
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"jest": "^30.0
|
|
17
|
+
"jest": "^30.2.0"
|
|
18
18
|
},
|
|
19
19
|
"jest": {
|
|
20
20
|
"testEnvironment": "node"
|
|
21
21
|
},
|
|
22
|
+
"type": "module",
|
|
22
23
|
"dependencies": {
|
|
23
|
-
"@aws-sdk/client-api-gateway": "^3.
|
|
24
|
-
"@aws-sdk/client-apigatewayv2": "^3.
|
|
25
|
-
"@aws-sdk/client-lambda": "^3.
|
|
26
|
-
"@aws-sdk/client-s3": "^3.
|
|
27
|
-
"@aws-sdk/crc64-nvme-crt": "^3.
|
|
28
|
-
"@izara_project/izara-core-library-core": "^1.0.
|
|
29
|
-
"@izara_project/izara-core-library-external-request": "^1.0.
|
|
30
|
-
"@izara_project/izara-core-library-lambda": "^1.0.
|
|
31
|
-
"@izara_project/izara-core-library-logger": "^1.0.
|
|
32
|
-
"@izara_project/izara-shared-core": "^1.0.
|
|
33
|
-
"@izara_project/izara-shared-service-schemas": "^1.0.
|
|
34
|
-
"glob": "^
|
|
24
|
+
"@aws-sdk/client-api-gateway": "^3.933.0",
|
|
25
|
+
"@aws-sdk/client-apigatewayv2": "^3.933.0",
|
|
26
|
+
"@aws-sdk/client-lambda": "^3.933.0",
|
|
27
|
+
"@aws-sdk/client-s3": "^3.933.0",
|
|
28
|
+
"@aws-sdk/crc64-nvme-crt": "^3.932.0",
|
|
29
|
+
"@izara_project/izara-core-library-core": "^1.0.28",
|
|
30
|
+
"@izara_project/izara-core-library-external-request": "^1.0.22",
|
|
31
|
+
"@izara_project/izara-core-library-lambda": "^1.0.6",
|
|
32
|
+
"@izara_project/izara-core-library-logger": "^1.0.8",
|
|
33
|
+
"@izara_project/izara-shared-core": "^1.0.5",
|
|
34
|
+
"@izara_project/izara-shared-service-schemas": "^1.0.33",
|
|
35
|
+
"glob": "^12.0.0",
|
|
35
36
|
"lodash": "^4.17.21",
|
|
36
|
-
"object-hash": "^3.0.0",
|
|
37
37
|
"read-yaml-file": "^2.1.0"
|
|
38
38
|
}
|
|
39
39
|
}
|
package/src/Consts.js
CHANGED
|
@@ -17,9 +17,9 @@ along with this program.If not, see < http://www.gnu.org/licenses/>.
|
|
|
17
17
|
|
|
18
18
|
'use strict';
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
import { NoRetryError } from '@izara_project/izara-core-library-core';
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
import { validateObjType } from '@izara_project/izara-shared-service-schemas';
|
|
23
23
|
|
|
24
24
|
const FIELDNAME_TYPES = {
|
|
25
25
|
string: "string",
|
|
@@ -107,7 +107,7 @@ const PREFIX_PATH_S3 = {
|
|
|
107
107
|
// --------- Upload path ---------------
|
|
108
108
|
|
|
109
109
|
function relationshipTagPathS3(_izContext, relType) {
|
|
110
|
-
const validateRelTypeResult = validateRelType(relType);
|
|
110
|
+
const validateRelTypeResult = validateObjType.validateRelType(relType);
|
|
111
111
|
if (validateRelTypeResult.errorsFound.length > 0) {
|
|
112
112
|
throw new NoRetryError(`function relationshipTagPathS3: invalid relType ${relType.name} - ${validateRelTypeResult.errorsFound.join(", ")}`);
|
|
113
113
|
}
|
|
@@ -115,7 +115,7 @@ function relationshipTagPathS3(_izContext, relType) {
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
function objectRelationshipPathS3(_izContext, objType) {
|
|
118
|
-
const validateObjTypeResult = validateObjType(objType);
|
|
118
|
+
const validateObjTypeResult = validateObjType.validateObjType(objType);
|
|
119
119
|
if (validateObjTypeResult.errorsFound.length > 0) {
|
|
120
120
|
throw new NoRetryError(`function objectRelationshipPathS3: invalid objType ${objType.name} - ${validateObjTypeResult.errorsFound.join(", ")}`);
|
|
121
121
|
}
|
|
@@ -132,7 +132,7 @@ function linkByLinkTypeIdPathS3(_izContext, serviceTag, linkTypeId) {
|
|
|
132
132
|
|
|
133
133
|
|
|
134
134
|
function refObjectRelationshipPathS3(_izContext, objType) {
|
|
135
|
-
const validateObjTypeResult = validateObjType(objType);
|
|
135
|
+
const validateObjTypeResult = validateObjType.validateObjType(objType);
|
|
136
136
|
if (validateObjTypeResult.errorsFound.length > 0) {
|
|
137
137
|
throw new NoRetryError(`function refObjectRelationshipPathS3: invalid objType ${objType.name} - ${validateObjTypeResult.errorsFound.join(", ")}`);
|
|
138
138
|
}
|
|
@@ -140,7 +140,7 @@ function refObjectRelationshipPathS3(_izContext, objType) {
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
function objectSchemaAllPathS3(_izContext, objType) {
|
|
143
|
-
const validateObjTypeResult = validateObjType(objType);
|
|
143
|
+
const validateObjTypeResult = validateObjType.validateObjType(objType);
|
|
144
144
|
if (validateObjTypeResult.errorsFound.length > 0) {
|
|
145
145
|
throw new NoRetryError(`function objectSchemaAllPathS3: invalid objType ${objType.name} - ${validateObjTypeResult.errorsFound.join(", ")}`);
|
|
146
146
|
}
|
|
@@ -148,7 +148,7 @@ function objectSchemaAllPathS3(_izContext, objType) {
|
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
function objectSchemaCreatePathS3(_izContext, objType) {
|
|
151
|
-
const validateObjTypeResult = validateObjType(objType);
|
|
151
|
+
const validateObjTypeResult = validateObjType.validateObjType(objType);
|
|
152
152
|
if (validateObjTypeResult.errorsFound.length > 0) {
|
|
153
153
|
throw new NoRetryError(`function objectSchemaCreatePathS3: invalid objType ${objType.name} - ${validateObjTypeResult.errorsFound.join(", ")}`);
|
|
154
154
|
}
|
|
@@ -156,7 +156,7 @@ function objectSchemaCreatePathS3(_izContext, objType) {
|
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
function objectSchemaDisplayPathS3(_izContext, objType) {
|
|
159
|
-
const validateObjTypeResult = validateObjType(objType);
|
|
159
|
+
const validateObjTypeResult = validateObjType.validateObjType(objType);
|
|
160
160
|
if (validateObjTypeResult.errorsFound.length > 0) {
|
|
161
161
|
throw new NoRetryError(`function objectSchemaDisplayPathS3: invalid objType ${objType.name} - ${validateObjTypeResult.errorsFound.join(", ")}`);
|
|
162
162
|
}
|
|
@@ -164,7 +164,7 @@ function objectSchemaDisplayPathS3(_izContext, objType) {
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
function objectSchemaCombineFieldNamesPathS3(_izContext, objType) {
|
|
167
|
-
const validateObjTypeResult = validateObjType(objType);
|
|
167
|
+
const validateObjTypeResult = validateObjType.validateObjType(objType);
|
|
168
168
|
if (validateObjTypeResult.errorsFound.length > 0) {
|
|
169
169
|
throw new NoRetryError(`function objectSchemaCombineFieldNamesPathS3: invalid objType ${objType.name} - ${validateObjTypeResult.errorsFound.join(", ")}`);
|
|
170
170
|
}
|
|
@@ -200,7 +200,7 @@ function serviceNamePathS3(_izContext, serviceTag) {
|
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
function flowSchemaPathS3(_izContext, flowType) {
|
|
203
|
-
const validateFlowTypeResult = validateFlowType(flowType);
|
|
203
|
+
const validateFlowTypeResult = validateObjType.validateFlowType(flowType);
|
|
204
204
|
if (validateFlowTypeResult.errorsFound.length > 0) {
|
|
205
205
|
throw new NoRetryError(`function flowSchemaPathS3: invalid flowType ${flowType.name} - ${validateFlowTypeResult.errorsFound.join(", ")}`);
|
|
206
206
|
}
|
|
@@ -304,7 +304,7 @@ function createValidationFieldNameForEachType(type, validation) {
|
|
|
304
304
|
// }
|
|
305
305
|
|
|
306
306
|
function getEndpointPerObjectType(_izContext, objType) {
|
|
307
|
-
let validateObjTypeResult = validateObjType(objType);
|
|
307
|
+
let validateObjTypeResult = validateObjType.validateObjType(objType);
|
|
308
308
|
if (validateObjTypeResult.errorsFound.length > 0) {
|
|
309
309
|
throw new NoRetryError(`function flowSchemaPathS3: invalid flowType ${flowType.name} - ${validateFlowTypeResult.errorsFound.join(", ")}`);
|
|
310
310
|
}
|
|
@@ -353,7 +353,7 @@ function firstLetterLowerCase(str) {
|
|
|
353
353
|
|
|
354
354
|
// --------- End Upload path ---------------
|
|
355
355
|
|
|
356
|
-
|
|
356
|
+
export default {
|
|
357
357
|
LOCAL_OBJECT_SCHEMA_PATH: './src/schemas', // schema folder path in lambda environment
|
|
358
358
|
|
|
359
359
|
OBJECT_SCHEMA_BUCKET_NAME: 'object-schema',
|