@squidcloud/local-backend 1.0.159 → 1.0.160
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 +15 -0
- package/dist/internal-common/src/code-executor.types.js +3 -0
- package/dist/internal-common/src/code-executor.types.js.map +1 -0
- package/dist/internal-common/src/local-dev.types.d.ts +54 -0
- package/dist/internal-common/src/local-dev.types.js +11 -0
- package/dist/internal-common/src/local-dev.types.js.map +1 -0
- package/dist/internal-common/src/public-types/ai-chatbot.public-types.d.ts +27 -0
- package/dist/internal-common/src/public-types/ai-chatbot.public-types.js +11 -0
- package/dist/internal-common/src/public-types/ai-chatbot.public-types.js.map +1 -0
- package/dist/internal-common/src/public-types/api-call.context.d.ts +13 -0
- package/dist/internal-common/src/public-types/api-call.context.js +17 -0
- package/dist/internal-common/src/public-types/api-call.context.js.map +1 -0
- package/dist/internal-common/src/public-types/api.types.d.ts +22 -0
- package/dist/internal-common/src/public-types/api.types.js +3 -0
- package/dist/internal-common/src/public-types/api.types.js.map +1 -0
- package/dist/internal-common/src/public-types/application.types.d.ts +201 -0
- package/dist/internal-common/src/public-types/application.types.js +90 -0
- package/dist/internal-common/src/public-types/application.types.js.map +1 -0
- package/dist/internal-common/src/public-types/backend-run.types.d.ts +52 -0
- package/dist/internal-common/src/public-types/backend-run.types.js +30 -0
- package/dist/internal-common/src/public-types/backend-run.types.js.map +1 -0
- package/dist/internal-common/src/public-types/bundle-api.types.d.ts +55 -0
- package/dist/internal-common/src/public-types/bundle-api.types.js +3 -0
- package/dist/internal-common/src/public-types/bundle-api.types.js.map +1 -0
- package/dist/internal-common/src/public-types/bundle-data.types.d.ts +86 -0
- package/dist/internal-common/src/public-types/bundle-data.types.js +3 -0
- package/dist/internal-common/src/public-types/bundle-data.types.js.map +1 -0
- package/dist/internal-common/src/public-types/communication.types.d.ts +20 -0
- package/dist/internal-common/src/public-types/communication.types.js +42 -0
- package/dist/internal-common/src/public-types/communication.types.js.map +1 -0
- package/dist/internal-common/src/public-types/context.types.d.ts +24 -0
- package/dist/internal-common/src/public-types/context.types.js +3 -0
- package/dist/internal-common/src/public-types/context.types.js.map +1 -0
- package/dist/internal-common/src/public-types/distributed-lock.context.d.ts +4 -0
- package/dist/internal-common/src/public-types/distributed-lock.context.js +10 -0
- package/dist/internal-common/src/public-types/distributed-lock.context.js.map +1 -0
- package/dist/internal-common/src/public-types/document.types.d.ts +32 -0
- package/dist/internal-common/src/public-types/document.types.js +51 -0
- package/dist/internal-common/src/public-types/document.types.js.map +1 -0
- package/dist/internal-common/src/public-types/graphql.context.d.ts +14 -0
- package/dist/internal-common/src/public-types/graphql.context.js +13 -0
- package/dist/internal-common/src/public-types/graphql.context.js.map +1 -0
- package/dist/internal-common/src/public-types/graphql.types.d.ts +11 -0
- package/dist/internal-common/src/public-types/graphql.types.js +35 -0
- package/dist/internal-common/src/public-types/graphql.types.js.map +1 -0
- package/dist/internal-common/src/public-types/http-status.enum.d.ts +50 -0
- package/dist/internal-common/src/public-types/http-status.enum.js +55 -0
- package/dist/internal-common/src/public-types/http-status.enum.js.map +1 -0
- package/dist/internal-common/src/public-types/integration-types.d.ts +62 -0
- package/dist/internal-common/src/public-types/integration-types.js +69 -0
- package/dist/internal-common/src/public-types/integration-types.js.map +1 -0
- package/dist/internal-common/src/public-types/integrations/ai_chatbot.types.d.ts +32 -0
- package/dist/internal-common/src/public-types/integrations/ai_chatbot.types.js +3 -0
- package/dist/internal-common/src/public-types/integrations/ai_chatbot.types.js.map +1 -0
- package/dist/internal-common/src/public-types/integrations/api.types.d.ts +81 -0
- package/dist/internal-common/src/public-types/integrations/api.types.js +3 -0
- package/dist/internal-common/src/public-types/integrations/api.types.js.map +1 -0
- package/dist/internal-common/src/public-types/integrations/auth.types.d.ts +46 -0
- package/dist/internal-common/src/public-types/integrations/auth.types.js +3 -0
- package/dist/internal-common/src/public-types/integrations/auth.types.js.map +1 -0
- package/dist/internal-common/src/public-types/integrations/database.types.d.ts +275 -0
- package/dist/internal-common/src/public-types/integrations/database.types.js +3 -0
- package/dist/internal-common/src/public-types/integrations/database.types.js.map +1 -0
- package/dist/internal-common/src/public-types/integrations/observability.types.d.ts +24 -0
- package/dist/internal-common/src/public-types/integrations/observability.types.js +24 -0
- package/dist/internal-common/src/public-types/integrations/observability.types.js.map +1 -0
- package/dist/internal-common/src/public-types/integrations/queue-types.d.ts +40 -0
- package/dist/internal-common/src/public-types/integrations/queue-types.js +3 -0
- package/dist/internal-common/src/public-types/integrations/queue-types.js.map +1 -0
- package/dist/internal-common/src/public-types/integrations/schemas.d.ts +79 -0
- package/dist/internal-common/src/public-types/integrations/schemas.js +48 -0
- package/dist/internal-common/src/public-types/integrations/schemas.js.map +1 -0
- package/dist/internal-common/src/public-types/logger.types.d.ts +21 -0
- package/dist/internal-common/src/public-types/logger.types.js +12 -0
- package/dist/internal-common/src/public-types/logger.types.js.map +1 -0
- package/dist/internal-common/src/public-types/mutation.context.d.ts +13 -0
- package/dist/internal-common/src/public-types/mutation.context.js +27 -0
- package/dist/internal-common/src/public-types/mutation.context.js.map +1 -0
- package/dist/internal-common/src/public-types/mutation.types.d.ts +63 -0
- package/dist/internal-common/src/public-types/mutation.types.js +143 -0
- package/dist/internal-common/src/public-types/mutation.types.js.map +1 -0
- package/dist/internal-common/src/public-types/native-query.context.d.ts +7 -0
- package/dist/internal-common/src/public-types/native-query.context.js +12 -0
- package/dist/internal-common/src/public-types/native-query.context.js.map +1 -0
- package/dist/internal-common/src/public-types/openapi.types.d.ts +26 -0
- package/dist/internal-common/src/public-types/openapi.types.js +3 -0
- package/dist/internal-common/src/public-types/openapi.types.js.map +1 -0
- package/dist/internal-common/src/public-types/query-context.d.ts +47 -0
- package/dist/internal-common/src/public-types/query-context.js +160 -0
- package/dist/internal-common/src/public-types/query-context.js.map +1 -0
- package/dist/internal-common/src/public-types/query.types.d.ts +86 -0
- package/dist/internal-common/src/public-types/query.types.js +98 -0
- package/dist/internal-common/src/public-types/query.types.js.map +1 -0
- package/dist/internal-common/src/public-types/secret.types.d.ts +68 -0
- package/dist/internal-common/src/public-types/secret.types.js +6 -0
- package/dist/internal-common/src/public-types/secret.types.js.map +1 -0
- package/dist/internal-common/src/public-types/socket.types.d.ts +132 -0
- package/dist/internal-common/src/public-types/socket.types.js +10 -0
- package/dist/internal-common/src/public-types/socket.types.js.map +1 -0
- package/dist/internal-common/src/public-types/topic.context.d.ts +10 -0
- package/dist/internal-common/src/public-types/topic.context.js +3 -0
- package/dist/internal-common/src/public-types/topic.context.js.map +1 -0
- package/dist/internal-common/src/public-types/types.d.ts +21 -0
- package/dist/internal-common/src/public-types/types.js +3 -0
- package/dist/internal-common/src/public-types/types.js.map +1 -0
- package/dist/internal-common/src/schema/schema.types.d.ts +30 -0
- package/dist/internal-common/src/schema/schema.types.js +167 -0
- package/dist/internal-common/src/schema/schema.types.js.map +1 -0
- package/dist/internal-common/src/types/ai-chatbot.context.d.ts +13 -0
- package/dist/internal-common/src/types/ai-chatbot.context.js +20 -0
- package/dist/internal-common/src/types/ai-chatbot.context.js.map +1 -0
- package/dist/internal-common/src/types/ai-chatbot.types.d.ts +101 -0
- package/dist/internal-common/src/types/ai-chatbot.types.js +21 -0
- package/dist/internal-common/src/types/ai-chatbot.types.js.map +1 -0
- package/dist/internal-common/src/types/openapi-response.d.ts +6 -0
- package/dist/internal-common/src/types/openapi-response.js +3 -0
- package/dist/internal-common/src/types/openapi-response.js.map +1 -0
- package/dist/internal-common/src/types/security-internal.types.d.ts +20 -0
- package/dist/internal-common/src/types/security-internal.types.js +3 -0
- package/dist/internal-common/src/types/security-internal.types.js.map +1 -0
- package/dist/internal-common/src/utils/assert.d.ts +3 -0
- package/dist/internal-common/src/utils/assert.js +15 -0
- package/dist/internal-common/src/utils/assert.js.map +1 -0
- package/dist/internal-common/src/utils/backend-transforms.d.ts +3 -0
- package/dist/internal-common/src/utils/backend-transforms.js +91 -0
- package/dist/internal-common/src/utils/backend-transforms.js.map +1 -0
- package/dist/internal-common/src/utils/global.utils.d.ts +11 -0
- package/dist/internal-common/src/utils/global.utils.js +51 -0
- package/dist/internal-common/src/utils/global.utils.js.map +1 -0
- package/dist/internal-common/src/utils/http.d.ts +2 -0
- package/dist/internal-common/src/utils/http.js +56 -0
- package/dist/internal-common/src/utils/http.js.map +1 -0
- package/dist/internal-common/src/utils/object.d.ts +5 -0
- package/dist/internal-common/src/utils/object.js +76 -0
- package/dist/internal-common/src/utils/object.js.map +1 -0
- package/dist/internal-common/src/utils/serialization.d.ts +5 -0
- package/dist/internal-common/src/utils/serialization.js +74 -0
- package/dist/internal-common/src/utils/serialization.js.map +1 -0
- package/dist/internal-common/src/utils/validation.d.ts +19 -0
- package/dist/internal-common/src/utils/validation.js +210 -0
- package/dist/internal-common/src/utils/validation.js.map +1 -0
- package/dist/internal-common/src/websocket.impl.d.ts +21 -0
- package/dist/internal-common/src/websocket.impl.js +80 -0
- package/dist/internal-common/src/websocket.impl.js.map +1 -0
- package/dist/local-backend/openapi-template.hbs +1 -0
- package/dist/local-backend/package.json +54 -0
- package/dist/local-backend/src/index.d.ts +4 -0
- package/dist/local-backend/src/index.js.map +1 -0
- package/dist/local-backend/src/local-backend-socket.service.d.ts +22 -0
- package/dist/local-backend/src/local-backend-socket.service.js +212 -0
- package/dist/local-backend/src/local-backend-socket.service.js.map +1 -0
- package/dist/local-backend/src/local-backend.app.d.ts +2 -0
- package/dist/local-backend/src/local-backend.app.js +26 -0
- package/dist/local-backend/src/local-backend.app.js.map +1 -0
- package/dist/local-backend/src/local-backend.controller.d.ts +8 -0
- package/dist/local-backend/src/local-backend.controller.js +49 -0
- package/dist/local-backend/src/local-backend.controller.js.map +1 -0
- package/dist/local-backend/src/local-backend.module.d.ts +8 -0
- package/dist/local-backend/src/local-backend.module.js +52 -0
- package/dist/local-backend/src/local-backend.module.js.map +1 -0
- package/dist/local-backend/src/local-backend.service.d.ts +17 -0
- package/dist/local-backend/src/local-backend.service.js +175 -0
- package/dist/local-backend/src/local-backend.service.js.map +1 -0
- package/dist/local-backend/src/utils/shell-runner.d.ts +4 -0
- package/dist/local-backend/src/utils/shell-runner.js +28 -0
- package/dist/local-backend/src/utils/shell-runner.js.map +1 -0
- package/dist/local-backend/tsoa.json +15 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,167 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.types.js","sourceRoot":"","sources":["../../../../../internal-common/src/schema/schema.types.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AACtB,6CAAqC;AACrC,yCAAiC;AAEjC,oDAAsD;AACtD,uCAAgD;AAChD,uEAA8D;AAE9D,MAAM,GAAG,GAAG,IAAI,aAAG,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,CAAC;AACrF,IAAA,qBAAU,EAAC,GAAG,CAAC,CAAC;AAEhB,GAAG,CAAC,UAAU,CAAC;IACb,OAAO,EAAE,QAAQ;IACjB,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,MAAe,EAAE,KAAc,EAAW,EAAE;QACrD,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AC,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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AiChatbotChatRequest, AiChatbotMutateRequest, AiChatbotMutationType, AiChatbotResourceType } from './ai-chatbot.types';
|
|
2
|
+
export declare class AiChatbotChatContext {
|
|
3
|
+
readonly prompt: string;
|
|
4
|
+
readonly profileId: string;
|
|
5
|
+
constructor(request: AiChatbotChatRequest);
|
|
6
|
+
}
|
|
7
|
+
export declare class AiChatbotMutationContext {
|
|
8
|
+
readonly type: AiChatbotMutationType;
|
|
9
|
+
readonly resource: AiChatbotResourceType;
|
|
10
|
+
readonly profileId: string;
|
|
11
|
+
readonly payload: any;
|
|
12
|
+
constructor(request: AiChatbotMutateRequest);
|
|
13
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AiChatbotMutationContext = exports.AiChatbotChatContext = void 0;
|
|
4
|
+
class AiChatbotChatContext {
|
|
5
|
+
constructor(request) {
|
|
6
|
+
this.profileId = request.profileId;
|
|
7
|
+
this.prompt = request.prompt;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.AiChatbotChatContext = AiChatbotChatContext;
|
|
11
|
+
class AiChatbotMutationContext {
|
|
12
|
+
constructor(request) {
|
|
13
|
+
this.profileId = request.profileId;
|
|
14
|
+
this.type = request.type;
|
|
15
|
+
this.resource = request.resource;
|
|
16
|
+
this.payload = request.payload;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.AiChatbotMutationContext = AiChatbotMutationContext;
|
|
20
|
+
//# sourceMappingURL=ai-chatbot.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-chatbot.context.js","sourceRoot":"","sources":["../../../../../internal-common/src/types/ai-chatbot.context.ts"],"names":[],"mappings":";;;AAOA,MAAa,oBAAoB;IAO/B,YAAY,OAA6B;QACvC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACnC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC/B,CAAC;CACF;AAXD,oDAWC;AAGD,MAAa,wBAAwB;IASnC,YAAY,OAA+B;QACzC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACnC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IACjC,CAAC;CACF;AAfD,4DAeC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { AiChatbotChatOptions, AiChatbotContext, AiModelName, ApiKeySource, OpenAiResponseFormat } from '../public-types/ai-chatbot.public-types';
|
|
2
|
+
import { ClientRequestId, IntegrationId } from '../public-types/communication.types';
|
|
3
|
+
import { AiChatbotProfileMetadata } from '../public-types/integrations/ai_chatbot.types';
|
|
4
|
+
type ModelDataType = {
|
|
5
|
+
tokens: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const AiModelData: Record<AiModelName, ModelDataType>;
|
|
8
|
+
export interface BaseAiChatbotRequest {
|
|
9
|
+
profileId: string;
|
|
10
|
+
integrationId: IntegrationId;
|
|
11
|
+
}
|
|
12
|
+
export interface AiChatbotChatRequest extends BaseAiChatbotRequest {
|
|
13
|
+
clientRequestId: ClientRequestId;
|
|
14
|
+
prompt: string;
|
|
15
|
+
options?: AiChatbotChatOptions;
|
|
16
|
+
}
|
|
17
|
+
export interface AskQuestionInternalRequest {
|
|
18
|
+
model: AiModelName;
|
|
19
|
+
prompt: string;
|
|
20
|
+
temperature?: number;
|
|
21
|
+
responseFormat?: OpenAiResponseFormat;
|
|
22
|
+
}
|
|
23
|
+
export interface AskQuestionInternalResponse {
|
|
24
|
+
answer: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ContextSizeRequest {
|
|
27
|
+
appId: string;
|
|
28
|
+
integrationId: string;
|
|
29
|
+
profileId: string;
|
|
30
|
+
}
|
|
31
|
+
export interface ContextSizeResponse {
|
|
32
|
+
sizeBytes: number;
|
|
33
|
+
}
|
|
34
|
+
export interface BaseAiChatbotMutateRequest extends BaseAiChatbotRequest {
|
|
35
|
+
type: AiChatbotMutationType;
|
|
36
|
+
resource: AiChatbotResourceType;
|
|
37
|
+
}
|
|
38
|
+
export interface AiChatbotInsertProfileRequest extends BaseAiChatbotMutateRequest {
|
|
39
|
+
type: 'insert';
|
|
40
|
+
resource: 'profile';
|
|
41
|
+
payload: Omit<AiChatbotProfileMetadata, 'instructions'>;
|
|
42
|
+
}
|
|
43
|
+
export interface AiChatbotInsertInstructionRequest extends BaseAiChatbotMutateRequest {
|
|
44
|
+
type: 'insert';
|
|
45
|
+
resource: 'instruction';
|
|
46
|
+
payload: {
|
|
47
|
+
id: string;
|
|
48
|
+
instruction: string;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export interface AiChatbotInsertContextRequest extends BaseAiChatbotMutateRequest {
|
|
52
|
+
type: 'insert';
|
|
53
|
+
resource: 'context';
|
|
54
|
+
payload: {
|
|
55
|
+
id: string;
|
|
56
|
+
title: string;
|
|
57
|
+
context: AiChatbotContext;
|
|
58
|
+
file?: any;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export interface AiChatbotUpdateProfileRequest extends BaseAiChatbotMutateRequest {
|
|
62
|
+
type: 'update';
|
|
63
|
+
resource: 'profile';
|
|
64
|
+
payload: Partial<Omit<AiChatbotProfileMetadata, 'instructions'>>;
|
|
65
|
+
}
|
|
66
|
+
export interface AiChatbotUpdateInstructionRequest extends BaseAiChatbotMutateRequest {
|
|
67
|
+
type: 'update';
|
|
68
|
+
resource: 'instruction';
|
|
69
|
+
payload: {
|
|
70
|
+
id: string;
|
|
71
|
+
instruction: string;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export interface AiChatbotUpdateContextRequest extends BaseAiChatbotMutateRequest {
|
|
75
|
+
type: 'update';
|
|
76
|
+
resource: 'context';
|
|
77
|
+
payload: {
|
|
78
|
+
id: string;
|
|
79
|
+
title?: string;
|
|
80
|
+
context?: AiChatbotContext;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
export interface AiChatbotDeleteRequest extends BaseAiChatbotMutateRequest {
|
|
84
|
+
type: 'delete';
|
|
85
|
+
payload: {
|
|
86
|
+
id?: string;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
export type AiChatbotInsertRequest = AiChatbotInsertProfileRequest | AiChatbotInsertInstructionRequest | AiChatbotInsertContextRequest;
|
|
90
|
+
export type AiChatbotUpdateRequest = AiChatbotUpdateProfileRequest | AiChatbotUpdateInstructionRequest | AiChatbotUpdateContextRequest;
|
|
91
|
+
export type AiChatbotMutateRequest = AiChatbotInsertRequest | AiChatbotUpdateRequest | AiChatbotDeleteRequest;
|
|
92
|
+
export type AiChatbotResourceType = 'instruction' | 'context' | 'profile';
|
|
93
|
+
export type AiChatbotMutationType = 'insert' | 'update' | 'delete';
|
|
94
|
+
export interface AiChatbotMetricTag extends Record<string, string> {
|
|
95
|
+
appId: string;
|
|
96
|
+
integrationId: string;
|
|
97
|
+
profileId: string;
|
|
98
|
+
model: AiModelName;
|
|
99
|
+
apiKeySource: ApiKeySource;
|
|
100
|
+
}
|
|
101
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AiModelData = void 0;
|
|
4
|
+
exports.AiModelData = {
|
|
5
|
+
'gpt-4': {
|
|
6
|
+
tokens: 8192,
|
|
7
|
+
},
|
|
8
|
+
'gpt-3.5-turbo': {
|
|
9
|
+
tokens: 4096,
|
|
10
|
+
},
|
|
11
|
+
'gpt-3.5-turbo-1106': {
|
|
12
|
+
tokens: 16385,
|
|
13
|
+
},
|
|
14
|
+
'claude-2': {
|
|
15
|
+
tokens: 100000,
|
|
16
|
+
},
|
|
17
|
+
'gpt-4-1106-preview': {
|
|
18
|
+
tokens: 8192,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=ai-chatbot.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-chatbot.types.js","sourceRoot":"","sources":["../../../../../internal-common/src/types/ai-chatbot.types.ts"],"names":[],"mappings":";;;AAea,QAAA,WAAW,GAAuC;IAC7D,OAAO,EAAE;QACP,MAAM,EAAE,IAAI;KACb;IACD,eAAe,EAAE;QACf,MAAM,EAAE,IAAI;KACb;IACD,oBAAoB,EAAE;QACpB,MAAM,EAAE,KAAM;KACf;IACD,UAAU,EAAE;QACV,MAAM,EAAE,MAAO;KAChB;IACD,oBAAoB,EAAE;QACpB,MAAM,EAAE,IAAI;KACb;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi-response.js","sourceRoot":"","sources":["../../../../../internal-common/src/types/openapi-response.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Auth, RunContext } from '../public-types/context.types';
|
|
2
|
+
import { SquidDocId } from '../public-types/document.types';
|
|
3
|
+
import { SecretKey } from '../public-types/secret.types';
|
|
4
|
+
import { EnvironmentId, SquidDeveloperId } from '../public-types/communication.types';
|
|
5
|
+
export type DocHash = string;
|
|
6
|
+
export type SecurityResponse = {
|
|
7
|
+
docsToHash: Record<SquidDocId, DocHash | undefined>;
|
|
8
|
+
rulesPassed: true;
|
|
9
|
+
} | {
|
|
10
|
+
rulesPassed: false;
|
|
11
|
+
};
|
|
12
|
+
export interface ServiceConfig {
|
|
13
|
+
context: RunContext;
|
|
14
|
+
secrets: Record<SecretKey, any>;
|
|
15
|
+
backendApiKey: string;
|
|
16
|
+
codeDir: string;
|
|
17
|
+
auth: Auth | undefined;
|
|
18
|
+
squidDeveloperId?: SquidDeveloperId;
|
|
19
|
+
environmentId?: EnvironmentId;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security-internal.types.js","sourceRoot":"","sources":["../../../../../internal-common/src/types/security-internal.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,3 @@
|
|
|
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>;
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ExecuteFunctionAnnotationType } from '../public-types/backend-run.types';
|
|
2
|
+
export declare function transformParams(params: Array<any>, executeFunctionAnnotationType: ExecuteFunctionAnnotationType): unknown[];
|
|
3
|
+
export declare function transformResponse(functionResponse: any, executeFunctionAnnotationType: ExecuteFunctionAnnotationType): any;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transformResponse = exports.transformParams = void 0;
|
|
4
|
+
const query_context_1 = require("../public-types/query-context");
|
|
5
|
+
const mutation_context_1 = require("../public-types/mutation.context");
|
|
6
|
+
const native_query_context_1 = require("../public-types/native-query.context");
|
|
7
|
+
const distributed_lock_context_1 = require("../public-types/distributed-lock.context");
|
|
8
|
+
const graphql_context_1 = require("../public-types/graphql.context");
|
|
9
|
+
const api_call_context_1 = require("../public-types/api-call.context");
|
|
10
|
+
const backend_run_types_1 = require("../public-types/backend-run.types");
|
|
11
|
+
const ai_chatbot_context_1 = require("../types/ai-chatbot.context");
|
|
12
|
+
function transformParams(params, executeFunctionAnnotationType) {
|
|
13
|
+
switch (executeFunctionAnnotationType) {
|
|
14
|
+
case 'scheduler':
|
|
15
|
+
return [];
|
|
16
|
+
case 'secureQuery':
|
|
17
|
+
return [new query_context_1.QueryContext(params[0].query)];
|
|
18
|
+
case 'secureMutation':
|
|
19
|
+
return [new mutation_context_1.MutationContext(params[0].mutation, params[0]['beforeAndAfterDocs'], params[0]['serverTimestamp'])];
|
|
20
|
+
case 'secureNativeQuery':
|
|
21
|
+
return [new native_query_context_1.NativeQueryContext(params[0], params[1], params[2])];
|
|
22
|
+
case 'secureDistributedLock':
|
|
23
|
+
return [new distributed_lock_context_1.DistributedLockContext(params[0].mutex)];
|
|
24
|
+
case 'secureGraphQL':
|
|
25
|
+
return [new graphql_context_1.GraphqlContext(params[0])];
|
|
26
|
+
case 'secureApi':
|
|
27
|
+
return [new api_call_context_1.ApiCallContext(params[0])];
|
|
28
|
+
case 'secureAiChatbotChat':
|
|
29
|
+
return [new ai_chatbot_context_1.AiChatbotChatContext(params[0])];
|
|
30
|
+
case 'secureAiChatbotMutation':
|
|
31
|
+
return [new ai_chatbot_context_1.AiChatbotMutationContext(params[0])];
|
|
32
|
+
default:
|
|
33
|
+
return params;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.transformParams = transformParams;
|
|
37
|
+
function transformResponse(functionResponse, executeFunctionAnnotationType) {
|
|
38
|
+
if (backend_run_types_1.ExecuteFunctionSecureAnnotations.includes(executeFunctionAnnotationType)) {
|
|
39
|
+
return {
|
|
40
|
+
rulesPassed: functionResponse,
|
|
41
|
+
docsToHash: functionResponse ? {} : undefined,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
if (executeFunctionAnnotationType === 'webhook') {
|
|
45
|
+
if (isWebhookResponse(functionResponse)) {
|
|
46
|
+
delete functionResponse['__isWebhookResponse__'];
|
|
47
|
+
return functionResponse;
|
|
48
|
+
}
|
|
49
|
+
functionResponse = functionResponse !== null && functionResponse !== void 0 ? functionResponse : null;
|
|
50
|
+
const isStringOrNullBody = functionResponse === null || typeof functionResponse === 'string';
|
|
51
|
+
const headers = {
|
|
52
|
+
'content-type': isStringOrNullBody ? 'text/plain' : 'application/json',
|
|
53
|
+
'cache-control': 'no-cache',
|
|
54
|
+
};
|
|
55
|
+
const body = isStringOrNullBody ? functionResponse || '' : JSON.stringify(functionResponse);
|
|
56
|
+
const webhookResponse = {
|
|
57
|
+
headers,
|
|
58
|
+
body,
|
|
59
|
+
statusCode: functionResponse === null ? 204 : 200,
|
|
60
|
+
};
|
|
61
|
+
return webhookResponse;
|
|
62
|
+
}
|
|
63
|
+
if (executeFunctionAnnotationType === 'openapi') {
|
|
64
|
+
if (isOpenApiResponse(functionResponse)) {
|
|
65
|
+
delete functionResponse['__isOpenApiResponse__'];
|
|
66
|
+
return functionResponse;
|
|
67
|
+
}
|
|
68
|
+
functionResponse = functionResponse !== null && functionResponse !== void 0 ? functionResponse : null;
|
|
69
|
+
const isStringOrNullBody = functionResponse === null || typeof functionResponse === 'string';
|
|
70
|
+
const headers = {
|
|
71
|
+
'content-type': isStringOrNullBody ? 'text/plain' : 'application/json',
|
|
72
|
+
'cache-control': 'no-cache',
|
|
73
|
+
};
|
|
74
|
+
const body = isStringOrNullBody ? functionResponse || '' : JSON.stringify(functionResponse);
|
|
75
|
+
const openApiResponse = {
|
|
76
|
+
headers,
|
|
77
|
+
body,
|
|
78
|
+
statusCode: functionResponse === null ? 204 : 200,
|
|
79
|
+
};
|
|
80
|
+
return openApiResponse;
|
|
81
|
+
}
|
|
82
|
+
return functionResponse;
|
|
83
|
+
}
|
|
84
|
+
exports.transformResponse = transformResponse;
|
|
85
|
+
function isWebhookResponse(response) {
|
|
86
|
+
return response && response.__isWebhookResponse__;
|
|
87
|
+
}
|
|
88
|
+
function isOpenApiResponse(response) {
|
|
89
|
+
return response && response.__isOpenApiResponse__;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=backend-transforms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend-transforms.js","sourceRoot":"","sources":["../../../../../internal-common/src/utils/backend-transforms.ts"],"names":[],"mappings":";;;AAAA,iEAA6D;AAC7D,uEAAmE;AACnE,+EAA0E;AAC1E,uFAAkF;AAClF,qEAAiE;AACjE,uEAAkE;AAElE,yEAI2C;AAE3C,oEAA6F;AAG7F,SAAgB,eAAe,CAC7B,MAAkB,EAClB,6BAA4D;IAE5D,QAAQ,6BAA6B,EAAE;QACrC,KAAK,WAAW;YACd,OAAO,EAAE,CAAC;QACZ,KAAK,aAAa;YAChB,OAAO,CAAC,IAAI,4BAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QAC7C,KAAK,gBAAgB;YACnB,OAAO,CAAC,IAAI,kCAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;QAClH,KAAK,mBAAmB;YACtB,OAAO,CAAC,IAAI,yCAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACnE,KAAK,uBAAuB;YAC1B,OAAO,CAAC,IAAI,iDAAsB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,C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,QAAQ,IAAI,QAAQ,CAAC,qBAAqB,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function getGlobal(): any;
|
|
2
|
+
export declare function isDebugEnabled(): boolean;
|
|
3
|
+
export declare function enableDebugLogs(): void;
|
|
4
|
+
export declare class DebugLogger {
|
|
5
|
+
static log(...args: any[]): void;
|
|
6
|
+
static info(...args: any[]): void;
|
|
7
|
+
static warn(...args: any[]): void;
|
|
8
|
+
static error(...args: any[]): void;
|
|
9
|
+
static debug(...args: any[]): void;
|
|
10
|
+
private static getTimestampString;
|
|
11
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DebugLogger = exports.enableDebugLogs = exports.isDebugEnabled = exports.getGlobal = void 0;
|
|
4
|
+
function getGlobal() {
|
|
5
|
+
if (typeof window !== 'undefined') {
|
|
6
|
+
return window;
|
|
7
|
+
}
|
|
8
|
+
if (typeof global !== 'undefined') {
|
|
9
|
+
return global;
|
|
10
|
+
}
|
|
11
|
+
if (typeof self !== 'undefined') {
|
|
12
|
+
return self;
|
|
13
|
+
}
|
|
14
|
+
throw new Error('Unable to locate global object');
|
|
15
|
+
}
|
|
16
|
+
exports.getGlobal = getGlobal;
|
|
17
|
+
function isDebugEnabled() {
|
|
18
|
+
const globalObj = getGlobal();
|
|
19
|
+
return globalObj && globalObj['SQUID_DEBUG_ENABLED'];
|
|
20
|
+
}
|
|
21
|
+
exports.isDebugEnabled = isDebugEnabled;
|
|
22
|
+
function enableDebugLogs() {
|
|
23
|
+
const globalObj = getGlobal();
|
|
24
|
+
globalObj['SQUID_DEBUG_ENABLED'] = true;
|
|
25
|
+
}
|
|
26
|
+
exports.enableDebugLogs = enableDebugLogs;
|
|
27
|
+
class DebugLogger {
|
|
28
|
+
static log(...args) {
|
|
29
|
+
DebugLogger.info(...args);
|
|
30
|
+
}
|
|
31
|
+
static info(...args) {
|
|
32
|
+
console.log(`%c[${DebugLogger.getTimestampString()}] INFO`, 'color:green', ...args);
|
|
33
|
+
}
|
|
34
|
+
static warn(...args) {
|
|
35
|
+
console.warn(`%c[${DebugLogger.getTimestampString()}] WARN`, 'color:yellow', ...args);
|
|
36
|
+
}
|
|
37
|
+
static error(...args) {
|
|
38
|
+
console.error(`%c[${DebugLogger.getTimestampString()}] ERROR`, 'color:red', ...args);
|
|
39
|
+
}
|
|
40
|
+
static debug(...args) {
|
|
41
|
+
if (!isDebugEnabled())
|
|
42
|
+
return;
|
|
43
|
+
console.log(`%c[${DebugLogger.getTimestampString()}] DEBUG`, 'color:cyan', ...args);
|
|
44
|
+
}
|
|
45
|
+
static getTimestampString() {
|
|
46
|
+
const date = new Date();
|
|
47
|
+
return `${date.toLocaleTimeString()}.${date.getMilliseconds()}`;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.DebugLogger = DebugLogger;
|
|
51
|
+
//# sourceMappingURL=global.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global.utils.js","sourceRoot":"","sources":["../../../../../internal-common/src/utils/global.utils.ts"],"names":[],"mappings":";;;AAKA,SAAgB,SAAS;IACvB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,OAAO,MAAM,CAAC;KACf;IACD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,OAAO,MAAM,CAAC;KACf;IACD,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;QAC/B,OAAO,IAAI,CAAC;KACb;IACD,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;AACpD,CAAC;AAXD,8BAWC;AAGD,SAAgB,cAAc;IAC5B,MAAM,SAAS,GAAG,SAAS,EAAE,CAAC;IAC9B,OAAO,SAAS,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;AACvD,CAAC;AAHD,wCAGC;AAGD,SAAgB,eAAe;IAC7B,MAAM,S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