@squidcloud/local-backend 1.0.160 → 1.0.161
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/dist/internal-common/src/code-executor.types.d.ts +3 -3
- package/dist/internal-common/src/local-dev.types.d.ts +3 -3
- package/dist/internal-common/src/public-types/{application.types.d.ts → application.public-types.d.ts} +5 -5
- package/dist/internal-common/src/public-types/{application.types.js → application.public-types.js} +1 -1
- package/dist/internal-common/src/public-types/application.public-types.js.map +1 -0
- package/dist/internal-common/src/public-types/{bundle-api.types.d.ts → bundle-api.public-types.d.ts} +13 -13
- package/dist/internal-common/src/public-types/bundle-api.public-types.js +3 -0
- package/dist/internal-common/src/public-types/bundle-api.public-types.js.map +1 -0
- package/dist/internal-common/src/public-types/bundle-data.public-types.d.ts +5 -0
- package/dist/internal-common/src/public-types/bundle-data.public-types.js +3 -0
- package/dist/internal-common/src/public-types/bundle-data.public-types.js.map +1 -0
- package/dist/internal-common/src/public-types/communication.public-types.d.ts +9 -0
- package/dist/internal-common/src/public-types/communication.public-types.js +6 -0
- package/dist/internal-common/src/public-types/communication.public-types.js.map +1 -0
- package/dist/internal-common/src/public-types/{context.types.d.ts → context.public-types.d.ts} +1 -1
- package/dist/internal-common/src/public-types/context.public-types.js +3 -0
- package/dist/internal-common/src/public-types/context.public-types.js.map +1 -0
- package/dist/internal-common/src/public-types/{document.types.d.ts → document.public-types.d.ts} +11 -18
- package/dist/internal-common/src/public-types/document.public-types.js +3 -0
- package/dist/internal-common/src/public-types/document.public-types.js.map +1 -0
- package/dist/internal-common/src/public-types/{graphql.types.d.ts → graphql.public-types.d.ts} +0 -2
- package/dist/internal-common/src/public-types/graphql.public-types.js +3 -0
- package/dist/internal-common/src/public-types/graphql.public-types.js.map +1 -0
- package/dist/internal-common/src/public-types/{integration-types.js → integration.public-types.js} +1 -1
- package/dist/internal-common/src/public-types/integration.public-types.js.map +1 -0
- package/dist/internal-common/src/public-types/integrations/ai_chatbot.types.d.ts +2 -2
- package/dist/internal-common/src/public-types/integrations/api.types.d.ts +3 -3
- package/dist/internal-common/src/public-types/integrations/auth.types.d.ts +1 -1
- package/dist/internal-common/src/public-types/integrations/database.types.d.ts +3 -3
- package/dist/internal-common/src/public-types/integrations/observability.types.d.ts +1 -1
- package/dist/internal-common/src/public-types/integrations/queue-types.d.ts +1 -1
- package/dist/internal-common/src/public-types/integrations/schemas.d.ts +2 -2
- package/dist/internal-common/src/public-types/integrations/schemas.js +22 -22
- package/dist/internal-common/src/public-types/integrations/schemas.js.map +1 -1
- package/dist/internal-common/src/public-types/{mutation.context.d.ts → mutation.public-context.d.ts} +4 -4
- package/dist/internal-common/src/public-types/{mutation.context.js → mutation.public-context.js} +4 -4
- package/dist/internal-common/src/public-types/mutation.public-context.js.map +1 -0
- package/dist/internal-common/src/public-types/{mutation.types.d.ts → mutation.public-types.d.ts} +3 -22
- package/dist/internal-common/src/public-types/mutation.public-types.js +3 -0
- package/dist/internal-common/src/public-types/mutation.public-types.js.map +1 -0
- package/dist/internal-common/src/public-types/{query-context.d.ts → query.public-context.d.ts} +4 -4
- package/dist/internal-common/src/public-types/{query-context.js → query.public-context.js} +5 -4
- package/dist/internal-common/src/public-types/query.public-context.js.map +1 -0
- package/dist/internal-common/src/public-types/{query.types.d.ts → query.public-types.d.ts} +4 -34
- package/dist/internal-common/src/public-types/query.public-types.js +8 -0
- package/dist/internal-common/src/public-types/query.public-types.js.map +1 -0
- package/dist/internal-common/src/public-types/schema.public-types.d.ts +22 -0
- package/dist/internal-common/src/public-types/{bundle-api.types.js → schema.public-types.js} +1 -1
- package/dist/internal-common/src/public-types/schema.public-types.js.map +1 -0
- package/dist/internal-common/src/public-types/secret.public-types.d.ts +13 -0
- package/dist/internal-common/src/public-types/{context.types.js → secret.public-types.js} +1 -1
- package/dist/internal-common/src/public-types/secret.public-types.js.map +1 -0
- package/dist/internal-common/src/public-types/socket.public-types.d.ts +5 -0
- package/dist/internal-common/src/public-types/{socket.types.js → socket.public-types.js} +1 -1
- package/dist/internal-common/src/public-types/socket.public-types.js.map +1 -0
- package/dist/internal-common/src/public-types/{topic.context.d.ts → topic.public-context.d.ts} +1 -1
- package/dist/internal-common/src/public-types/topic.public-context.js +3 -0
- package/dist/internal-common/src/public-types/topic.public-context.js.map +1 -0
- package/dist/internal-common/src/public-types/typescript.public-types.js +3 -0
- package/dist/internal-common/src/public-types/typescript.public-types.js.map +1 -0
- package/dist/internal-common/src/types/ai-chatbot.types.d.ts +1 -1
- package/dist/internal-common/src/{public-types → types}/api-call.context.d.ts +1 -1
- package/dist/internal-common/src/types/api-call.context.js.map +1 -0
- package/dist/internal-common/src/{public-types → types}/api.types.d.ts +2 -2
- package/dist/internal-common/src/types/api.types.js.map +1 -0
- package/dist/internal-common/src/{public-types → types}/backend-run.types.d.ts +3 -2
- package/dist/internal-common/src/types/backend-run.types.js.map +1 -0
- package/dist/internal-common/src/{public-types → types}/bundle-data.types.d.ts +5 -9
- package/dist/internal-common/src/types/bundle-data.types.js.map +1 -0
- package/dist/internal-common/src/{public-types → types}/communication.types.d.ts +1 -8
- package/dist/internal-common/src/{public-types → types}/communication.types.js +1 -3
- package/dist/internal-common/src/types/communication.types.js.map +1 -0
- package/dist/internal-common/src/types/distributed-lock.context.js.map +1 -0
- package/dist/internal-common/src/types/graphql.context.js.map +1 -0
- package/dist/internal-common/src/types/logger.types.js.map +1 -0
- package/dist/internal-common/src/{public-types → types}/native-query.context.d.ts +1 -1
- package/dist/internal-common/src/types/native-query.context.js.map +1 -0
- package/dist/internal-common/src/types/openapi.types.js.map +1 -0
- package/dist/internal-common/src/types/query.types.d.ts +34 -0
- package/dist/internal-common/src/{public-types → types}/query.types.js +1 -5
- package/dist/internal-common/src/types/query.types.js.map +1 -0
- package/dist/internal-common/src/{public-types → types}/secret.types.d.ts +1 -14
- package/dist/internal-common/src/types/secret.types.js.map +1 -0
- package/dist/internal-common/src/types/{security-internal.types.d.ts → security.types.d.ts} +10 -8
- package/dist/internal-common/src/{public-types/topic.context.js → types/security.types.js} +1 -1
- package/dist/internal-common/src/types/security.types.js.map +1 -0
- package/dist/internal-common/src/utils/backend-transforms.d.ts +1 -1
- package/dist/internal-common/src/utils/backend-transforms.js +11 -9
- package/dist/internal-common/src/utils/backend-transforms.js.map +1 -1
- package/dist/internal-common/src/utils/http.js +1 -0
- package/dist/internal-common/src/utils/http.js.map +1 -1
- package/dist/local-backend/package.json +2 -2
- package/dist/local-backend/src/local-backend-socket.service.js +5 -4
- package/dist/local-backend/src/local-backend-socket.service.js.map +1 -1
- package/dist/local-backend/src/local-backend.controller.d.ts +2 -1
- package/dist/local-backend/src/local-backend.controller.js +2 -1
- package/dist/local-backend/src/local-backend.controller.js.map +1 -1
- package/dist/local-backend/src/local-backend.module.d.ts +2 -2
- package/dist/local-backend/src/local-backend.module.js +4 -2
- package/dist/local-backend/src/local-backend.module.js.map +1 -1
- package/dist/local-backend/src/local-backend.service.d.ts +5 -5
- package/dist/local-backend/src/local-backend.service.js +12 -7
- package/dist/local-backend/src/local-backend.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/internal-common/src/public-types/api-call.context.js.map +0 -1
- package/dist/internal-common/src/public-types/api.types.js.map +0 -1
- package/dist/internal-common/src/public-types/application.types.js.map +0 -1
- package/dist/internal-common/src/public-types/backend-run.types.js.map +0 -1
- package/dist/internal-common/src/public-types/bundle-api.types.js.map +0 -1
- package/dist/internal-common/src/public-types/bundle-data.types.js.map +0 -1
- package/dist/internal-common/src/public-types/communication.types.js.map +0 -1
- package/dist/internal-common/src/public-types/context.types.js.map +0 -1
- package/dist/internal-common/src/public-types/distributed-lock.context.js.map +0 -1
- package/dist/internal-common/src/public-types/document.types.js +0 -51
- package/dist/internal-common/src/public-types/document.types.js.map +0 -1
- package/dist/internal-common/src/public-types/graphql.context.js.map +0 -1
- package/dist/internal-common/src/public-types/graphql.types.js +0 -35
- package/dist/internal-common/src/public-types/graphql.types.js.map +0 -1
- package/dist/internal-common/src/public-types/http-status.enum.d.ts +0 -50
- package/dist/internal-common/src/public-types/http-status.enum.js +0 -55
- package/dist/internal-common/src/public-types/http-status.enum.js.map +0 -1
- package/dist/internal-common/src/public-types/integration-types.js.map +0 -1
- package/dist/internal-common/src/public-types/logger.types.js.map +0 -1
- package/dist/internal-common/src/public-types/mutation.context.js.map +0 -1
- package/dist/internal-common/src/public-types/mutation.types.js +0 -143
- package/dist/internal-common/src/public-types/mutation.types.js.map +0 -1
- package/dist/internal-common/src/public-types/native-query.context.js.map +0 -1
- package/dist/internal-common/src/public-types/openapi.types.js.map +0 -1
- package/dist/internal-common/src/public-types/query-context.js.map +0 -1
- package/dist/internal-common/src/public-types/query.types.js.map +0 -1
- package/dist/internal-common/src/public-types/secret.types.js.map +0 -1
- package/dist/internal-common/src/public-types/socket.types.d.ts +0 -132
- package/dist/internal-common/src/public-types/socket.types.js.map +0 -1
- package/dist/internal-common/src/public-types/topic.context.js.map +0 -1
- package/dist/internal-common/src/public-types/types.js +0 -3
- package/dist/internal-common/src/public-types/types.js.map +0 -1
- package/dist/internal-common/src/schema/schema.types.d.ts +0 -30
- package/dist/internal-common/src/schema/schema.types.js +0 -167
- package/dist/internal-common/src/schema/schema.types.js.map +0 -1
- package/dist/internal-common/src/types/security-internal.types.js +0 -3
- package/dist/internal-common/src/types/security-internal.types.js.map +0 -1
- package/dist/internal-common/src/utils/assert.d.ts +0 -3
- package/dist/internal-common/src/utils/assert.js +0 -15
- package/dist/internal-common/src/utils/assert.js.map +0 -1
- package/dist/internal-common/src/utils/object.d.ts +0 -5
- package/dist/internal-common/src/utils/object.js +0 -76
- package/dist/internal-common/src/utils/object.js.map +0 -1
- package/dist/internal-common/src/utils/validation.d.ts +0 -19
- package/dist/internal-common/src/utils/validation.js +0 -210
- package/dist/internal-common/src/utils/validation.js.map +0 -1
- /package/dist/internal-common/src/public-types/{integration-types.d.ts → integration.public-types.d.ts} +0 -0
- /package/dist/internal-common/src/public-types/{types.d.ts → typescript.public-types.d.ts} +0 -0
- /package/dist/internal-common/src/{public-types → types}/api-call.context.js +0 -0
- /package/dist/internal-common/src/{public-types → types}/api.types.js +0 -0
- /package/dist/internal-common/src/{public-types → types}/backend-run.types.js +0 -0
- /package/dist/internal-common/src/{public-types → types}/bundle-data.types.js +0 -0
- /package/dist/internal-common/src/{public-types → types}/distributed-lock.context.d.ts +0 -0
- /package/dist/internal-common/src/{public-types → types}/distributed-lock.context.js +0 -0
- /package/dist/internal-common/src/{public-types → types}/graphql.context.d.ts +0 -0
- /package/dist/internal-common/src/{public-types → types}/graphql.context.js +0 -0
- /package/dist/internal-common/src/{public-types → types}/logger.types.d.ts +0 -0
- /package/dist/internal-common/src/{public-types → types}/logger.types.js +0 -0
- /package/dist/internal-common/src/{public-types → types}/native-query.context.js +0 -0
- /package/dist/internal-common/src/{public-types → types}/openapi.types.d.ts +0 -0
- /package/dist/internal-common/src/{public-types → types}/openapi.types.js +0 -0
- /package/dist/internal-common/src/{public-types → types}/secret.types.js +0 -0
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { JSONSchema } from 'json-schema-typed';
|
|
2
|
-
export type FieldPlaceholder = '__SQUID_SERVER_TIMESTAMP__' | '__SQUID_CLIENT_IP__' | '__SQUID_USER_ID__' | '__SQUID_API_KEY__';
|
|
3
|
-
export declare const BASIC_FIELD_TYPES: readonly ["string", "integer", "number", "boolean", "map", "array", "any"];
|
|
4
|
-
export declare const CUSTOM_FIELD_TYPES: readonly ["date", "json", "objectId"];
|
|
5
|
-
export declare const DATA_SCHEMA_FIELD_TYPES: readonly ["string", "integer", "number", "boolean", "map", "array", "any", "date", "json", "objectId"];
|
|
6
|
-
export type DataSchemaFieldType = (typeof DATA_SCHEMA_FIELD_TYPES)[number];
|
|
7
|
-
type ConvertDeep<T extends JSONSchema> = Exclude<T, boolean> & {
|
|
8
|
-
properties?: Record<string, ConvertDeep<JSONSchema>>;
|
|
9
|
-
patternProperties?: Record<string, ConvertDeep<JSONSchema>>;
|
|
10
|
-
nullable?: boolean;
|
|
11
|
-
applyDefaultValueOn?: 'always' | 'empty' | 'updateOrEmpty';
|
|
12
|
-
isDate?: boolean;
|
|
13
|
-
isJSON?: boolean;
|
|
14
|
-
insertable?: boolean;
|
|
15
|
-
deletable?: boolean;
|
|
16
|
-
};
|
|
17
|
-
export type PropertySchema = ConvertDeep<JSONSchema>;
|
|
18
|
-
export type TopLevelPropertySchema = PropertySchema & {
|
|
19
|
-
primaryKey?: boolean;
|
|
20
|
-
isComputed?: boolean;
|
|
21
|
-
isDefaultComputed?: boolean;
|
|
22
|
-
dataType?: string;
|
|
23
|
-
};
|
|
24
|
-
export type CollectionSchema = Omit<ConvertDeep<JSONSchema>, 'properties'> & {
|
|
25
|
-
properties?: Record<string, TopLevelPropertySchema>;
|
|
26
|
-
};
|
|
27
|
-
export declare function compileSchema<S extends CollectionSchema>(schema: S): any;
|
|
28
|
-
export declare function validateSchema<S extends CollectionSchema>(schema: S, data: any, updatedPaths?: Array<string>, dataBefore?: any): void;
|
|
29
|
-
export declare function findMatchingPropertiesForKey<S extends CollectionSchema | PropertySchema>(schema: S, key: string): Array<PropertySchema>;
|
|
30
|
-
export {};
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.findMatchingPropertiesForKey = exports.validateSchema = exports.compileSchema = exports.DATA_SCHEMA_FIELD_TYPES = exports.CUSTOM_FIELD_TYPES = exports.BASIC_FIELD_TYPES = void 0;
|
|
4
|
-
const ajv_1 = require("ajv");
|
|
5
|
-
const ajv_formats_1 = require("ajv-formats");
|
|
6
|
-
const deep_diff_1 = require("deep-diff");
|
|
7
|
-
const validation_1 = require("../utils/validation");
|
|
8
|
-
const assertic_1 = require("assertic");
|
|
9
|
-
const http_status_enum_1 = require("../public-types/http-status.enum");
|
|
10
|
-
const ajv = new ajv_1.default({ allErrors: true, allowUnionTypes: false, useDefaults: false });
|
|
11
|
-
(0, ajv_formats_1.default)(ajv);
|
|
12
|
-
ajv.addKeyword({
|
|
13
|
-
keyword: 'isDate',
|
|
14
|
-
type: 'object',
|
|
15
|
-
validate: (isDate, value) => {
|
|
16
|
-
return isDate === value instanceof Date;
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
|
-
ajv.addKeyword({
|
|
20
|
-
keyword: 'isJSON',
|
|
21
|
-
type: 'object',
|
|
22
|
-
validate: (isJSON, value) => {
|
|
23
|
-
try {
|
|
24
|
-
const jsonString = JSON.stringify(value);
|
|
25
|
-
JSON.parse(jsonString);
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
28
|
-
catch (_a) {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
ajv.addKeyword({
|
|
34
|
-
keyword: 'isComputed',
|
|
35
|
-
validate: (isComputed, value) => {
|
|
36
|
-
return isComputed ? value !== null : true;
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
ajv.addKeyword({
|
|
40
|
-
keyword: 'isDefaultComputed',
|
|
41
|
-
validate: (isDefaultComputed, value) => {
|
|
42
|
-
return isDefaultComputed ? value !== null : true;
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
ajv.addKeyword({
|
|
46
|
-
keyword: 'primaryKey',
|
|
47
|
-
validate: (isPrimaryKey, value) => {
|
|
48
|
-
return isPrimaryKey ? value !== null : true;
|
|
49
|
-
},
|
|
50
|
-
});
|
|
51
|
-
ajv.addKeyword({
|
|
52
|
-
keyword: 'insertable',
|
|
53
|
-
validate: (insertable, value) => {
|
|
54
|
-
return insertable ? value !== null : true;
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
ajv.addKeyword({
|
|
58
|
-
keyword: 'deletable',
|
|
59
|
-
validate: (deletable, value) => {
|
|
60
|
-
return deletable ? value !== null : true;
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
ajv.addKeyword({
|
|
64
|
-
keyword: 'applyDefaultValueOn',
|
|
65
|
-
validate: (applyDefaultValueOn) => {
|
|
66
|
-
return applyDefaultValueOn ? ['always', 'empty', 'updateOrEmpty'].includes(applyDefaultValueOn) : true;
|
|
67
|
-
},
|
|
68
|
-
});
|
|
69
|
-
ajv.addKeyword({
|
|
70
|
-
keyword: 'dataType',
|
|
71
|
-
validate: () => {
|
|
72
|
-
return true;
|
|
73
|
-
},
|
|
74
|
-
});
|
|
75
|
-
exports.BASIC_FIELD_TYPES = ['string', 'integer', 'number', 'boolean', 'map', 'array', 'any'];
|
|
76
|
-
exports.CUSTOM_FIELD_TYPES = ['date', 'json', 'objectId'];
|
|
77
|
-
exports.DATA_SCHEMA_FIELD_TYPES = [...exports.BASIC_FIELD_TYPES, ...exports.CUSTOM_FIELD_TYPES];
|
|
78
|
-
function compileSchema(schema) {
|
|
79
|
-
return ajv.compile(schema);
|
|
80
|
-
}
|
|
81
|
-
exports.compileSchema = compileSchema;
|
|
82
|
-
function validateSchema(schema, data, updatedPaths = [], dataBefore = {}) {
|
|
83
|
-
const validator = compileSchema(schema);
|
|
84
|
-
const isValid = validator(data);
|
|
85
|
-
if (!updatedPaths.length && !isValid) {
|
|
86
|
-
throw new validation_1.ValidationError(`The data does not conform with the collection schema.`, http_status_enum_1.HttpStatus.BAD_REQUEST, {
|
|
87
|
-
errors: validator.errors,
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
if (!isValid && updatedPaths.length) {
|
|
91
|
-
for (const schemaError of (0, assertic_1.truthy)(validator.errors)) {
|
|
92
|
-
let fieldPath = schemaError.instancePath;
|
|
93
|
-
if (schemaError.params['missingProperty']) {
|
|
94
|
-
fieldPath = `${fieldPath}/${schemaError.params['missingProperty']}`;
|
|
95
|
-
}
|
|
96
|
-
fieldPath = fieldPath.slice(1).replace(/\//g, '.') + '.';
|
|
97
|
-
if (updatedPaths.some(updatedPath => fieldPath.startsWith(updatedPath + '.'))) {
|
|
98
|
-
throw new validation_1.ValidationError(`${fieldPath} does not conform with the collection schema.`, http_status_enum_1.HttpStatus.BAD_REQUEST);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
const diff = (0, assertic_1.truthy)((0, deep_diff_1.default)(dataBefore, data));
|
|
103
|
-
validateRestrictedFieldsForDiff(diff, schema, !!updatedPaths.length);
|
|
104
|
-
}
|
|
105
|
-
exports.validateSchema = validateSchema;
|
|
106
|
-
function validateRestrictedFieldsForDiff(diffs, schema, isUpdateMutation) {
|
|
107
|
-
if ((isUpdateMutation && schema.readOnly) || (schema.insertable === false && !isUpdateMutation)) {
|
|
108
|
-
throw new validation_1.ValidationError(`The schema does not allow this action`, http_status_enum_1.HttpStatus.BAD_REQUEST);
|
|
109
|
-
}
|
|
110
|
-
for (const diff of diffs) {
|
|
111
|
-
const path = (0, assertic_1.truthy)(diff.path).join('.');
|
|
112
|
-
const relevantProperties = getMatchingProperties((0, assertic_1.truthy)(diff.path), schema);
|
|
113
|
-
for (const property of relevantProperties.exactMatch) {
|
|
114
|
-
if (property.readOnly && diff.kind === 'E') {
|
|
115
|
-
throw new validation_1.ValidationError(`${path} is readonly`, http_status_enum_1.HttpStatus.BAD_REQUEST);
|
|
116
|
-
}
|
|
117
|
-
if (isUpdateMutation && property.deletable === false && diff.kind === 'D') {
|
|
118
|
-
throw new validation_1.ValidationError(`${path} is not deletable`, http_status_enum_1.HttpStatus.BAD_REQUEST);
|
|
119
|
-
}
|
|
120
|
-
if (property.insertable === false && diff.kind === 'N') {
|
|
121
|
-
throw new validation_1.ValidationError(`${path} is not insertable`, http_status_enum_1.HttpStatus.BAD_REQUEST);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
for (const property of relevantProperties.parentsMatch) {
|
|
125
|
-
if (isUpdateMutation && property.readOnly) {
|
|
126
|
-
throw new validation_1.ValidationError(`${path} is readonly`, http_status_enum_1.HttpStatus.BAD_REQUEST);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
function getMatchingProperties(path, schema) {
|
|
132
|
-
const result = {
|
|
133
|
-
exactMatch: [],
|
|
134
|
-
parentsMatch: [],
|
|
135
|
-
};
|
|
136
|
-
if (!path.length) {
|
|
137
|
-
result.exactMatch.push(schema);
|
|
138
|
-
return result;
|
|
139
|
-
}
|
|
140
|
-
result.parentsMatch.push(schema);
|
|
141
|
-
const pathToUse = [...path];
|
|
142
|
-
while (pathToUse.length) {
|
|
143
|
-
const key = pathToUse.shift();
|
|
144
|
-
(0, assertic_1.assertTruthy)(key !== undefined);
|
|
145
|
-
const matchingPropertiesForKey = findMatchingPropertiesForKey(schema, key);
|
|
146
|
-
for (const property of matchingPropertiesForKey) {
|
|
147
|
-
const subMatchingProperties = getMatchingProperties(pathToUse, property);
|
|
148
|
-
result.parentsMatch.push(...subMatchingProperties.parentsMatch);
|
|
149
|
-
result.exactMatch.push(...subMatchingProperties.exactMatch);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
return result;
|
|
153
|
-
}
|
|
154
|
-
function findMatchingPropertiesForKey(schema, key) {
|
|
155
|
-
var _a, _b;
|
|
156
|
-
const matchingProperties = ((_a = schema.properties) === null || _a === void 0 ? void 0 : _a[key]) ? [(_b = schema.properties) === null || _b === void 0 ? void 0 : _b[key]] : [];
|
|
157
|
-
if (schema.patternProperties) {
|
|
158
|
-
matchingProperties.push(...Object.entries(schema.patternProperties)
|
|
159
|
-
.filter(([pattern]) => {
|
|
160
|
-
return new RegExp(pattern).test(key);
|
|
161
|
-
})
|
|
162
|
-
.map(([, matchedProperty]) => matchedProperty));
|
|
163
|
-
}
|
|
164
|
-
return matchingProperties;
|
|
165
|
-
}
|
|
166
|
-
exports.findMatchingPropertiesForKey = findMatchingPropertiesForKey;
|
|
167
|
-
//# sourceMappingURL=schema.types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.types.js","sourceRoot":"","sources":["../../../../../internal-common/src/schema/schema.types.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AAI,CAAC,GAAG,qBAAqB,CAAC,YAAY,CAAC,CAAC;YAChE,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAC;SAC7D;KACF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAgB,4BAA4B,CAC1C,MAAS,EACT,GAAW;;IAEX,MAAM,kBAAkB,GAA0B,CAAA,MAAA,MAAM,CAAC,UAAU,0CAAG,GAAG,CAAC,EAAC,CAAC,CAAC,CAAC,MAAA,MAAM,CAAC,UAAU,0CAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7G,IAAI,MAAM,CAAC,iBAAiB,EAAE;QAC5B,kBAAkB,CAAC,IAAI,CACrB,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC;aACxC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE;YACpB,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACvC,CAAC,CAAC;aACD,GAAG,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,CACjD,CAAC;KACH;IACD,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AAfD,oEAeC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"security-internal.types.js","sourceRoot":"","sources":["../../../../../internal-common/src/types/security-internal.types.ts"],"names":[],"mappings":""}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { StatusCode } from './validation';
|
|
2
|
-
export declare function assertValidateTruthy(value: unknown, message: string, statusCode?: StatusCode, details?: Record<string, any>): asserts value;
|
|
3
|
-
export declare function validateTruthy<T>(value: T, message: string, statusCode?: StatusCode, details?: Record<string, any>): NonNullable<T>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateTruthy = exports.assertValidateTruthy = void 0;
|
|
4
|
-
const validation_1 = require("./validation");
|
|
5
|
-
const assertic_1 = require("assertic");
|
|
6
|
-
const http_status_enum_1 = require("../public-types/http-status.enum");
|
|
7
|
-
function assertValidateTruthy(value, message, statusCode = http_status_enum_1.HttpStatus.BAD_REQUEST, details) {
|
|
8
|
-
(0, assertic_1.assertTruthy)(value, () => new validation_1.ValidationError(message, statusCode, details));
|
|
9
|
-
}
|
|
10
|
-
exports.assertValidateTruthy = assertValidateTruthy;
|
|
11
|
-
function validateTruthy(value, message, statusCode = http_status_enum_1.HttpStatus.BAD_REQUEST, details) {
|
|
12
|
-
return (0, assertic_1.truthy)(value, () => new validation_1.ValidationError(message, statusCode, details));
|
|
13
|
-
}
|
|
14
|
-
exports.validateTruthy = validateTruthy;
|
|
15
|
-
//# sourceMappingURL=assert.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assert.js","sourceRoot":"","sources":["../../../../../internal-common/src/utils/assert.ts"],"names":[],"mappings":";;;AAAA,6CAA2D;AAC3D,uCAAgD;AAChD,uEAA8D;AAG9D,SAAgB,oBAAoB,CAClC,KAAc,EACd,OAAe,EACf,aAAyB,6BAAU,CAAC,WAAW,EAC/C,OAA6B;IAE7B,IAAA,uBAAY,EAAC,KAAK,EAAE,GAAG,EAAE,CAAC,IAAI,4BAAe,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;AAC/E,CAAC;AAPD,oDAOC;AAGD,SAAgB,cAAc,CAC5B,KAAQ,EACR,OAAe,EACf,aAAyB,6BAAU,CAAC,WAAW,EAC/C,OAA6B;IAE7B,OAAO,IAAA,iBAAM,EAAC,KAAK,EAAE,GAAG,EAAE,CAAC,IAAI,4BAAe,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;AAChF,CAAC;AAPD,wCAOC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare function getInPath(obj: any, path: string, delimiter?: string): any;
|
|
2
|
-
export declare function setInPath(obj: any, path: string, value: any, delimiter?: string): void;
|
|
3
|
-
export declare function deleteInPath(obj: any, path: string, delimiter?: string): void;
|
|
4
|
-
export declare function replaceKeyInMap<K, T>(map: Map<K, T | undefined>, a: K, b: K): void;
|
|
5
|
-
export declare function replaceKeyInRecord<K extends keyof any, T>(record: Record<K, T>, a: K, b: K): void;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.replaceKeyInRecord = exports.replaceKeyInMap = exports.deleteInPath = exports.setInPath = exports.getInPath = void 0;
|
|
4
|
-
const _ = require("lodash");
|
|
5
|
-
const assertic_1 = require("assertic");
|
|
6
|
-
function getInPath(obj, path, delimiter = '.') {
|
|
7
|
-
const splitPath = path.split(delimiter);
|
|
8
|
-
let value = undefined;
|
|
9
|
-
let currentObj = obj;
|
|
10
|
-
while (currentObj && splitPath.length) {
|
|
11
|
-
const key = (0, assertic_1.truthy)(splitPath.shift());
|
|
12
|
-
if (!(currentObj instanceof Object) || !(key in currentObj)) {
|
|
13
|
-
return undefined;
|
|
14
|
-
}
|
|
15
|
-
value = currentObj[key];
|
|
16
|
-
currentObj = value;
|
|
17
|
-
}
|
|
18
|
-
return value;
|
|
19
|
-
}
|
|
20
|
-
exports.getInPath = getInPath;
|
|
21
|
-
function isJsObject(obj) {
|
|
22
|
-
if (typeof obj !== 'object')
|
|
23
|
-
return false;
|
|
24
|
-
return Reflect.getPrototypeOf(obj) === Object.prototype;
|
|
25
|
-
}
|
|
26
|
-
function setInPath(obj, path, value, delimiter = '.') {
|
|
27
|
-
var _a;
|
|
28
|
-
const splitPath = path.split(delimiter);
|
|
29
|
-
let currentObj = obj;
|
|
30
|
-
while (splitPath.length) {
|
|
31
|
-
const key = (0, assertic_1.truthy)(splitPath.shift());
|
|
32
|
-
if (splitPath.length) {
|
|
33
|
-
const newCurrentObj = isJsObject(currentObj[key]) ? (_a = _.clone(currentObj[key])) !== null && _a !== void 0 ? _a : {} : {};
|
|
34
|
-
currentObj[key] = newCurrentObj;
|
|
35
|
-
currentObj = newCurrentObj;
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
currentObj[key] = value;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
exports.setInPath = setInPath;
|
|
43
|
-
function deleteInPath(obj, path, delimiter = '.') {
|
|
44
|
-
var _a;
|
|
45
|
-
const splitPath = path.split(delimiter);
|
|
46
|
-
let currentObj = obj;
|
|
47
|
-
while (splitPath.length) {
|
|
48
|
-
const key = (0, assertic_1.truthy)(splitPath.shift());
|
|
49
|
-
if (splitPath.length) {
|
|
50
|
-
const newCurrentObj = isJsObject(currentObj[key]) ? (_a = _.clone(currentObj[key])) !== null && _a !== void 0 ? _a : {} : {};
|
|
51
|
-
currentObj[key] = newCurrentObj;
|
|
52
|
-
currentObj = newCurrentObj;
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
delete currentObj[key];
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
exports.deleteInPath = deleteInPath;
|
|
60
|
-
function replaceKeyInMap(map, a, b) {
|
|
61
|
-
if (map.has(a)) {
|
|
62
|
-
const value = map.get(a);
|
|
63
|
-
map.delete(a);
|
|
64
|
-
map.set(b, value);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
exports.replaceKeyInMap = replaceKeyInMap;
|
|
68
|
-
function replaceKeyInRecord(record, a, b) {
|
|
69
|
-
const value = record[a];
|
|
70
|
-
if (typeof value !== 'undefined') {
|
|
71
|
-
record[b] = value;
|
|
72
|
-
delete record[a];
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
exports.replaceKeyInRecord = replaceKeyInRecord;
|
|
76
|
-
//# sourceMappingURL=object.js.map
|
|
@@ -1 +0,0 @@
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,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACd,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;KACnB;AACH,CAAC;AAND,0CAMC;AAED,SAAgB,kBAAkB,CAAyB,MAAoB,EAAE,CAAI,EAAE,CAAI;IACzF,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACxB,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;QAChC,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;QAClB,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;KAClB;AACH,CAAC;AAND,gDAMC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { HttpStatus } from '../public-types/http-status.enum';
|
|
2
|
-
import { OpenIdProvider } from '../public-types/application.types';
|
|
3
|
-
export type StatusCode = HttpStatus.BAD_REQUEST | HttpStatus.NOT_FOUND | HttpStatus.FORBIDDEN | HttpStatus.UNAUTHORIZED | HttpStatus.CONFLICT;
|
|
4
|
-
export declare class ValidationError extends Error {
|
|
5
|
-
readonly statusCode: StatusCode;
|
|
6
|
-
readonly details?: any;
|
|
7
|
-
constructor(error: string, statusCode: StatusCode, details?: Record<string, any>);
|
|
8
|
-
}
|
|
9
|
-
export declare function isValidId(id: unknown): boolean;
|
|
10
|
-
export declare function validateId(id: unknown, message: string): void;
|
|
11
|
-
export declare function validateFieldSort(fieldSort: any): void;
|
|
12
|
-
export declare function validateOpenIdProvider(openIdProvider: OpenIdProvider | undefined): OpenIdProvider;
|
|
13
|
-
export declare function validateOpenIdProviderType(providerType: any): void;
|
|
14
|
-
export declare function validateMutations(mutations: any): void;
|
|
15
|
-
export declare function validateQueryLimit(limit: any): void;
|
|
16
|
-
export declare function isNotEmpty(value: string | undefined | null): value is string;
|
|
17
|
-
export type JavascriptTypeName = 'undefined' | 'object' | 'boolean' | 'number' | 'bigint' | 'string' | 'symbol' | 'function';
|
|
18
|
-
export declare function isRightType(value: unknown, type: JavascriptTypeName): boolean;
|
|
19
|
-
export declare function hasOnlyKeys(obj: object, keys: string[]): boolean;
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hasOnlyKeys = exports.isRightType = exports.isNotEmpty = exports.validateQueryLimit = exports.validateMutations = exports.validateOpenIdProviderType = exports.validateOpenIdProvider = exports.validateFieldSort = exports.validateId = exports.isValidId = exports.ValidationError = void 0;
|
|
4
|
-
const assertic_1 = require("assertic");
|
|
5
|
-
const assert_1 = require("./assert");
|
|
6
|
-
const http_status_enum_1 = require("../public-types/http-status.enum");
|
|
7
|
-
class ValidationError extends Error {
|
|
8
|
-
constructor(error, statusCode, details) {
|
|
9
|
-
super(error);
|
|
10
|
-
this.statusCode = statusCode;
|
|
11
|
-
this.details = details;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
exports.ValidationError = ValidationError;
|
|
15
|
-
function validatePathPart(part) {
|
|
16
|
-
if (!part || !part.match(/^[a-zA-Z][a-zA-Z0-9!@#$%^&*~_]{0,49}$/)) {
|
|
17
|
-
throw new Error('A document id and a collection id can contain only a-z, A-Z, 0-9,!@#$%^&*~_, starting' +
|
|
18
|
-
'with a letter, at least one character, and up to 50.');
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
function validateCollectionName(collectionName) {
|
|
22
|
-
if (typeof collectionName !== 'string' || !collectionName) {
|
|
23
|
-
throw new Error('Collection path has to be a non empty string');
|
|
24
|
-
}
|
|
25
|
-
validatePathPart(collectionName);
|
|
26
|
-
}
|
|
27
|
-
function validateFieldName(fieldName) {
|
|
28
|
-
if (!fieldName || typeof fieldName !== 'string') {
|
|
29
|
-
throw new Error('Field name has to be a non-empty string');
|
|
30
|
-
}
|
|
31
|
-
if (fieldName === '__docId__') {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
if (!fieldName.match(/^[a-zA-Z_$][a-zA-Z0-9!@#$%^&*~_ ]{0,49}$/)) {
|
|
35
|
-
throw new Error('A Field name can contain only a-z, A-Z, 0-9,!@#$%^&*~_, starting with a letter, at least one character, and up to 50. Field name: ' +
|
|
36
|
-
fieldName);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
function isValidId(id) {
|
|
40
|
-
return typeof id === 'string' && !!id && id.length <= 50 && /^[a-zA-Z0-9_-]+$/.test(id);
|
|
41
|
-
}
|
|
42
|
-
exports.isValidId = isValidId;
|
|
43
|
-
function validateId(id, message) {
|
|
44
|
-
(0, assert_1.validateTruthy)(isValidId(id), message, http_status_enum_1.HttpStatus.BAD_REQUEST);
|
|
45
|
-
}
|
|
46
|
-
exports.validateId = validateId;
|
|
47
|
-
function validateFieldSort(fieldSort) {
|
|
48
|
-
if (!(fieldSort instanceof Object)) {
|
|
49
|
-
throw new Error('Field sort has to be an object');
|
|
50
|
-
}
|
|
51
|
-
(0, assertic_1.assertTruthy)(hasOnlyKeys(fieldSort, ['fieldName', 'asc']), 'Field sort should only contain a fieldName and asc');
|
|
52
|
-
(0, assertic_1.assertTruthy)(isRightType(fieldSort.asc, 'boolean'), 'Asc needs to be boolean');
|
|
53
|
-
validateFieldName(fieldSort.fieldName);
|
|
54
|
-
}
|
|
55
|
-
exports.validateFieldSort = validateFieldSort;
|
|
56
|
-
function validateOpenIdProvider(openIdProvider) {
|
|
57
|
-
(0, assertic_1.assertTruthy)(openIdProvider, 'INVALID_PROVIDER');
|
|
58
|
-
validateOpenIdProviderType(openIdProvider.providerType);
|
|
59
|
-
(0, assertic_1.assertTruthy)(openIdProvider.providerType, 'INVALID_CLIENT_ID');
|
|
60
|
-
(0, assertic_1.assertTruthy)(openIdProvider.clientId, 'INVALID_CLIENT_ID');
|
|
61
|
-
(0, assertic_1.assertTruthy)(openIdProvider.domain, 'INVALID_DOMAIN');
|
|
62
|
-
return openIdProvider;
|
|
63
|
-
}
|
|
64
|
-
exports.validateOpenIdProvider = validateOpenIdProvider;
|
|
65
|
-
function validateOpenIdProviderType(providerType) {
|
|
66
|
-
const providerArray = ['auth0'];
|
|
67
|
-
(0, assertic_1.assertTruthy)(providerArray.includes(providerType), 'INVALID_OPEN_ID_PROVIDER_TYPE');
|
|
68
|
-
}
|
|
69
|
-
exports.validateOpenIdProviderType = validateOpenIdProviderType;
|
|
70
|
-
function validateDeleteMutation(mutation) {
|
|
71
|
-
if (!mutation || mutation.type !== 'delete') {
|
|
72
|
-
throw new Error('Mutation has to be non empty with type delete.');
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
function validateInsertMutation(mutation) {
|
|
76
|
-
if (!mutation || mutation.type !== 'insert') {
|
|
77
|
-
throw new Error('Mutation has to be non empty with type insert.');
|
|
78
|
-
}
|
|
79
|
-
if (!mutation.properties || typeof mutation.properties !== 'object') {
|
|
80
|
-
throw new Error('The properties in insert mutation need to be a JSON object.');
|
|
81
|
-
}
|
|
82
|
-
for (const [fieldName] of Object.entries(mutation.properties)) {
|
|
83
|
-
validateFieldName(fieldName);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
function validateUpdatePropertyMutation(propertyMutation) {
|
|
87
|
-
if (!propertyMutation || propertyMutation.type !== 'update') {
|
|
88
|
-
throw new Error('Update value property mutation has to be of type update');
|
|
89
|
-
}
|
|
90
|
-
if (propertyMutation.value === undefined) {
|
|
91
|
-
throw new Error('Value has to exist in an update value property mutation..');
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
function validateApplyNumericFnPropertyMutation(propertyMutation) {
|
|
95
|
-
if (!propertyMutation || propertyMutation.type !== 'applyNumericFn') {
|
|
96
|
-
throw new Error('Apply numeric fn mutation has to be of type applyNumericFn');
|
|
97
|
-
}
|
|
98
|
-
if (!['increment'].includes(propertyMutation.fn)) {
|
|
99
|
-
throw new Error('Invalid fn for apply numeric fn.');
|
|
100
|
-
}
|
|
101
|
-
if (typeof propertyMutation.value !== 'number') {
|
|
102
|
-
throw new Error('The value in an apply numeric fn function has to be numeric.');
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
function validateApplyStringFnPropertyMutation(propertyMutation) {
|
|
106
|
-
if (!propertyMutation || propertyMutation.type !== 'applyStringFn') {
|
|
107
|
-
throw new Error('Apply string fn mutation has to be of type applyStringFn');
|
|
108
|
-
}
|
|
109
|
-
if (!['trim', 'extendString'].includes(propertyMutation.fn)) {
|
|
110
|
-
throw new Error('Invalid fn for apply string fn.');
|
|
111
|
-
}
|
|
112
|
-
if (typeof propertyMutation.value !== 'string') {
|
|
113
|
-
throw new Error('The value in an apply string fn function has to be a string.');
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
function validatePropertyMutation(propertyMutation) {
|
|
117
|
-
if (!propertyMutation || typeof propertyMutation !== 'object') {
|
|
118
|
-
throw new Error('Property mutation need to be a JSON object.');
|
|
119
|
-
}
|
|
120
|
-
if (!['update', 'applyNumericFn', 'applyStringFn'].includes(propertyMutation.type)) {
|
|
121
|
-
throw new Error(`Property mutation can be of type 'update', 'applyNumericFn', 'applyStringFn'`);
|
|
122
|
-
}
|
|
123
|
-
switch (propertyMutation.type) {
|
|
124
|
-
case 'update':
|
|
125
|
-
validateUpdatePropertyMutation(propertyMutation);
|
|
126
|
-
break;
|
|
127
|
-
case 'applyNumericFn':
|
|
128
|
-
validateApplyNumericFnPropertyMutation(propertyMutation);
|
|
129
|
-
break;
|
|
130
|
-
case 'applyStringFn':
|
|
131
|
-
validateApplyStringFnPropertyMutation(propertyMutation);
|
|
132
|
-
break;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
function validateUpdateMutation(mutation) {
|
|
136
|
-
if (!mutation || mutation.type !== 'update') {
|
|
137
|
-
throw new Error('Mutation has to be non empty with type update.');
|
|
138
|
-
}
|
|
139
|
-
if (!mutation.properties || typeof mutation.properties !== 'object') {
|
|
140
|
-
throw new Error('The properties in update mutation need to be a JSON object.');
|
|
141
|
-
}
|
|
142
|
-
const entries = Object.entries(mutation.properties);
|
|
143
|
-
for (const [fieldName, propertyMutations] of entries) {
|
|
144
|
-
validateFieldName(fieldName);
|
|
145
|
-
for (const propertyMutation of propertyMutations) {
|
|
146
|
-
validatePropertyMutation(propertyMutation);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
function validateMutation(mutation) {
|
|
151
|
-
if (!mutation) {
|
|
152
|
-
throw new Error('Mutation cannot be empty');
|
|
153
|
-
}
|
|
154
|
-
if (!['insert', 'delete', 'update'].includes(mutation.type)) {
|
|
155
|
-
throw new Error(`Mutation type has to be one of 'insert', 'delete', or 'update'`);
|
|
156
|
-
}
|
|
157
|
-
validateCollectionName(mutation.squidDocIdObj.collectionName);
|
|
158
|
-
validatePathPart(mutation.squidDocIdObj.docId);
|
|
159
|
-
switch (mutation.type) {
|
|
160
|
-
case 'delete':
|
|
161
|
-
validateDeleteMutation(mutation);
|
|
162
|
-
break;
|
|
163
|
-
case 'insert':
|
|
164
|
-
validateInsertMutation(mutation);
|
|
165
|
-
break;
|
|
166
|
-
case 'update':
|
|
167
|
-
validateUpdateMutation(mutation);
|
|
168
|
-
break;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
function validateMutations(mutations) {
|
|
172
|
-
if (!mutations || !(mutations instanceof Array) || !mutations.length) {
|
|
173
|
-
throw new Error('The list of mutations has to be a non-empty array.');
|
|
174
|
-
}
|
|
175
|
-
for (const mutation of mutations) {
|
|
176
|
-
validateMutation(mutation);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
exports.validateMutations = validateMutations;
|
|
180
|
-
function validateQueryLimit(limit) {
|
|
181
|
-
(0, assertic_1.assertTruthy)(isRightType(limit, 'number'), 'Limit needs to be a number');
|
|
182
|
-
if (limit === -1)
|
|
183
|
-
return;
|
|
184
|
-
(0, assertic_1.assertTruthy)(limit > 0, 'query limit has to be greater than 0');
|
|
185
|
-
(0, assertic_1.assertTruthy)(Math.floor(limit) === limit, 'query limit has to be an integer');
|
|
186
|
-
(0, assertic_1.assertTruthy)(limit <= 20000, 'Limit can be maximum 20000');
|
|
187
|
-
}
|
|
188
|
-
exports.validateQueryLimit = validateQueryLimit;
|
|
189
|
-
function isNotEmpty(value) {
|
|
190
|
-
validateCorrectStringType(value);
|
|
191
|
-
return typeof value === 'string' && !!value;
|
|
192
|
-
}
|
|
193
|
-
exports.isNotEmpty = isNotEmpty;
|
|
194
|
-
function validateCorrectStringType(value) {
|
|
195
|
-
if (value !== null && value !== undefined && typeof value !== 'string') {
|
|
196
|
-
throw new Error(`Unexpected input type ${typeof value}`);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
function isRightType(value, type) {
|
|
200
|
-
if (Array.isArray(value)) {
|
|
201
|
-
return value.every(element => typeof element === type);
|
|
202
|
-
}
|
|
203
|
-
return typeof value === type;
|
|
204
|
-
}
|
|
205
|
-
exports.isRightType = isRightType;
|
|
206
|
-
function hasOnlyKeys(obj, keys) {
|
|
207
|
-
return !Array.isArray(obj) && [...Object.keys(obj)].every(key => keys.includes(key));
|
|
208
|
-
}
|
|
209
|
-
exports.hasOnlyKeys = hasOnlyKeys;
|
|
210
|
-
//# sourceMappingURL=validation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../../../internal-common/src/utils/validation.ts"],"names":[],"mappings":";;;AAKA,uCAAwC;AACxC,qCAA0C;AAC1C,uEAA8D;AAU9D,MAAa,eAAgB,SAAQ,KAAK;IAIxC,YAAY,KAAa,EAAE,UAAsB,EAAE,OAA6B;QAC9E,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF;AATD,0CASC;AAED,SAAS,gBAAgB,CAAC,IAAY;IACpC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,uCAAuC,CAAC,EAAE;QACjE,MAAM,IAA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
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|