@squidcloud/local-backend 1.0.159 → 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 +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/application.public-types.d.ts +201 -0
- package/dist/internal-common/src/public-types/application.public-types.js +90 -0
- package/dist/internal-common/src/public-types/application.public-types.js.map +1 -0
- package/dist/internal-common/src/public-types/bundle-api.public-types.d.ts +55 -0
- 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.public-types.d.ts +24 -0
- 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.public-types.d.ts +25 -0
- 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.public-types.d.ts +9 -0
- 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.public-types.d.ts +62 -0
- package/dist/internal-common/src/public-types/integration.public-types.js +69 -0
- 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 +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/mutation.public-context.d.ts +13 -0
- package/dist/internal-common/src/public-types/mutation.public-context.js +27 -0
- package/dist/internal-common/src/public-types/mutation.public-context.js.map +1 -0
- package/dist/internal-common/src/public-types/mutation.public-types.d.ts +44 -0
- 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.public-context.d.ts +47 -0
- package/dist/internal-common/src/public-types/query.public-context.js +161 -0
- package/dist/internal-common/src/public-types/query.public-context.js.map +1 -0
- package/dist/internal-common/src/public-types/query.public-types.d.ts +56 -0
- 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/schema.public-types.js +3 -0
- 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/secret.public-types.js +3 -0
- 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.public-types.js +10 -0
- package/dist/internal-common/src/public-types/socket.public-types.js.map +1 -0
- package/dist/internal-common/src/public-types/topic.public-context.d.ts +10 -0
- 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.d.ts +21 -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.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/api-call.context.d.ts +13 -0
- package/dist/internal-common/src/types/api-call.context.js +17 -0
- package/dist/internal-common/src/types/api-call.context.js.map +1 -0
- package/dist/internal-common/src/types/api.types.d.ts +22 -0
- package/dist/internal-common/src/types/api.types.js +3 -0
- package/dist/internal-common/src/types/api.types.js.map +1 -0
- package/dist/internal-common/src/types/backend-run.types.d.ts +53 -0
- package/dist/internal-common/src/types/backend-run.types.js +30 -0
- package/dist/internal-common/src/types/backend-run.types.js.map +1 -0
- package/dist/internal-common/src/types/bundle-data.types.d.ts +82 -0
- package/dist/internal-common/src/types/bundle-data.types.js +3 -0
- package/dist/internal-common/src/types/bundle-data.types.js.map +1 -0
- package/dist/internal-common/src/types/communication.types.d.ts +13 -0
- package/dist/internal-common/src/types/communication.types.js +40 -0
- package/dist/internal-common/src/types/communication.types.js.map +1 -0
- package/dist/internal-common/src/types/distributed-lock.context.d.ts +4 -0
- package/dist/internal-common/src/types/distributed-lock.context.js +10 -0
- package/dist/internal-common/src/types/distributed-lock.context.js.map +1 -0
- package/dist/internal-common/src/types/graphql.context.d.ts +14 -0
- package/dist/internal-common/src/types/graphql.context.js +13 -0
- package/dist/internal-common/src/types/graphql.context.js.map +1 -0
- package/dist/internal-common/src/types/logger.types.d.ts +21 -0
- package/dist/internal-common/src/types/logger.types.js +12 -0
- package/dist/internal-common/src/types/logger.types.js.map +1 -0
- package/dist/internal-common/src/types/native-query.context.d.ts +7 -0
- package/dist/internal-common/src/types/native-query.context.js +12 -0
- package/dist/internal-common/src/types/native-query.context.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/openapi.types.d.ts +26 -0
- package/dist/internal-common/src/types/openapi.types.js +3 -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/types/query.types.js +94 -0
- package/dist/internal-common/src/types/query.types.js.map +1 -0
- package/dist/internal-common/src/types/secret.types.d.ts +55 -0
- package/dist/internal-common/src/types/secret.types.js +6 -0
- package/dist/internal-common/src/types/secret.types.js.map +1 -0
- package/dist/internal-common/src/types/security.types.d.ts +22 -0
- package/dist/internal-common/src/types/security.types.js +3 -0
- package/dist/internal-common/src/types/security.types.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 +93 -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 +57 -0
- package/dist/internal-common/src/utils/http.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/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 +213 -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 +9 -0
- package/dist/local-backend/src/local-backend.controller.js +50 -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 +54 -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 +180 -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 +2 -2
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ClientId } from '../public-types/communication.public-types';
|
|
2
|
+
export declare class NativeQueryContext {
|
|
3
|
+
readonly query: string;
|
|
4
|
+
readonly params: Record<string, any>;
|
|
5
|
+
readonly clientId: ClientId;
|
|
6
|
+
constructor(query: string, params: Record<string, any>, clientId: ClientId);
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NativeQueryContext = void 0;
|
|
4
|
+
class NativeQueryContext {
|
|
5
|
+
constructor(query, params, clientId) {
|
|
6
|
+
this.query = query;
|
|
7
|
+
this.params = params;
|
|
8
|
+
this.clientId = clientId;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.NativeQueryContext = NativeQueryContext;
|
|
12
|
+
//# sourceMappingURL=native-query.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native-query.context.js","sourceRoot":"","sources":["../../../../../internal-common/src/types/native-query.context.ts"],"names":[],"mappings":";;;AAGA,MAAa,kBAAkB;IAE7B,YACW,KAAa,EACb,MAA2B,EAC3B,QAAkB;QAFlB,UAAK,GAAL,KAAK,CAAQ;QACb,WAAM,GAAN,MAAM,CAAqB;QAC3B,aAAQ,GAAR,QAAQ,CAAU;IAC1B,CAAC;CACL;AAPD,gDAOC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi-response.js","sourceRoot":"","sources":["../../../../../internal-common/src/types/openapi-response.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface OpenApiController {
|
|
2
|
+
actions: OpenApiAction[];
|
|
3
|
+
modulePath: string;
|
|
4
|
+
name: string;
|
|
5
|
+
path: string;
|
|
6
|
+
}
|
|
7
|
+
export interface OpenApiAction {
|
|
8
|
+
fullPath: string;
|
|
9
|
+
method: OpenApiHttpMethod;
|
|
10
|
+
name: string;
|
|
11
|
+
parameters: Record<string, OpenApiParameter>;
|
|
12
|
+
path: string;
|
|
13
|
+
uploadFile: boolean;
|
|
14
|
+
uploadFiles: boolean;
|
|
15
|
+
security: any[];
|
|
16
|
+
successStatus: string | null;
|
|
17
|
+
}
|
|
18
|
+
export interface OpenApiParameter {
|
|
19
|
+
in: OpenApiParameterLocation;
|
|
20
|
+
name: string;
|
|
21
|
+
required?: boolean;
|
|
22
|
+
dataType?: string;
|
|
23
|
+
ref?: string;
|
|
24
|
+
}
|
|
25
|
+
export type OpenApiHttpMethod = 'get' | 'post' | 'put' | 'delete';
|
|
26
|
+
export type OpenApiParameterLocation = 'path' | 'query' | 'header' | 'body';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi.types.js","sourceRoot":"","sources":["../../../../../internal-common/src/types/openapi.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { AppId, ClientId, ClientRequestId } from '../public-types/communication.public-types';
|
|
2
|
+
import { Condition, Operator, Query } from '../public-types/query.public-types';
|
|
3
|
+
import { PrimitiveFieldType } from '../public-types/document.public-types';
|
|
4
|
+
export type QuerySubscriptionId = `${ClientId}_${ClientRequestId}`;
|
|
5
|
+
export interface QueryRequest {
|
|
6
|
+
clientRequestId: ClientRequestId;
|
|
7
|
+
query: Query;
|
|
8
|
+
subscribe: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface QueryUnsubscribeRequest {
|
|
11
|
+
clientRequestId: ClientRequestId;
|
|
12
|
+
}
|
|
13
|
+
interface QueryMetadata {
|
|
14
|
+
condCount: number;
|
|
15
|
+
}
|
|
16
|
+
export declare function encodeCondition(condition: Condition<any>): EncodedCondition;
|
|
17
|
+
export type EncodedCondition = string;
|
|
18
|
+
export type QueryMapping<QueryReferenceType extends string> = {
|
|
19
|
+
unconditional: Array<QueryReferenceType>;
|
|
20
|
+
conditional: Record<EncodedCondition, Array<QueryReferenceType>>;
|
|
21
|
+
queriesMetadata: Record<QueryReferenceType, QueryMetadata>;
|
|
22
|
+
};
|
|
23
|
+
export declare abstract class QueryMappingManager<T> {
|
|
24
|
+
abstract addQuery(appId: AppId, query: Query, key: T): Promise<void>;
|
|
25
|
+
abstract removeQuery(appId: AppId, key: T): Promise<Query | undefined>;
|
|
26
|
+
abstract removeLocalDevAppData(appId: AppId): Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
export declare function compareOperator(conditionValue: PrimitiveFieldType, valueInDocument: PrimitiveFieldType, operator: Operator): boolean;
|
|
29
|
+
export declare function getQuerySubscriptionId(clientId: string, clientRequestId: string): QuerySubscriptionId;
|
|
30
|
+
export declare function parseQuerySubscriptionId(querySubscriptionId: QuerySubscriptionId): {
|
|
31
|
+
clientId: string;
|
|
32
|
+
clientRequestId: string;
|
|
33
|
+
};
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseQuerySubscriptionId = exports.getQuerySubscriptionId = exports.compareOperator = exports.QueryMappingManager = exports.encodeCondition = void 0;
|
|
4
|
+
const lodash_1 = require("lodash");
|
|
5
|
+
const serialization_1 = require("../utils/serialization");
|
|
6
|
+
function encodeCondition(condition) {
|
|
7
|
+
return (0, serialization_1.normalizeJsonAsString)(condition);
|
|
8
|
+
}
|
|
9
|
+
exports.encodeCondition = encodeCondition;
|
|
10
|
+
class QueryMappingManager {
|
|
11
|
+
}
|
|
12
|
+
exports.QueryMappingManager = QueryMappingManager;
|
|
13
|
+
function compareOperator(conditionValue, valueInDocument, operator) {
|
|
14
|
+
conditionValue = conditionValue instanceof Date ? conditionValue.getTime() : conditionValue !== null && conditionValue !== void 0 ? conditionValue : null;
|
|
15
|
+
valueInDocument = valueInDocument instanceof Date ? valueInDocument.getTime() : valueInDocument !== null && valueInDocument !== void 0 ? valueInDocument : null;
|
|
16
|
+
if (operator === '==') {
|
|
17
|
+
return lodash_1.default.isEqual(conditionValue, valueInDocument);
|
|
18
|
+
}
|
|
19
|
+
if (operator === '!=') {
|
|
20
|
+
return !lodash_1.default.isEqual(conditionValue, valueInDocument);
|
|
21
|
+
}
|
|
22
|
+
switch (operator) {
|
|
23
|
+
case '<':
|
|
24
|
+
if (lodash_1.default.isNil(conditionValue))
|
|
25
|
+
return false;
|
|
26
|
+
if (lodash_1.default.isNil(valueInDocument))
|
|
27
|
+
return true;
|
|
28
|
+
return valueInDocument < conditionValue;
|
|
29
|
+
case '<=':
|
|
30
|
+
if (lodash_1.default.isNil(valueInDocument)) {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
if (lodash_1.default.isNil(conditionValue)) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
return valueInDocument <= conditionValue;
|
|
37
|
+
case '>':
|
|
38
|
+
if (lodash_1.default.isNil(valueInDocument))
|
|
39
|
+
return false;
|
|
40
|
+
if (lodash_1.default.isNil(conditionValue))
|
|
41
|
+
return true;
|
|
42
|
+
return valueInDocument > conditionValue;
|
|
43
|
+
case '>=':
|
|
44
|
+
if (lodash_1.default.isNil(conditionValue)) {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
if (lodash_1.default.isNil(valueInDocument)) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
return valueInDocument >= conditionValue;
|
|
51
|
+
case 'like':
|
|
52
|
+
return (typeof valueInDocument === 'string' &&
|
|
53
|
+
typeof conditionValue === 'string' &&
|
|
54
|
+
isStringMatch(valueInDocument, conditionValue, false));
|
|
55
|
+
case 'not like':
|
|
56
|
+
return !(typeof valueInDocument === 'string' &&
|
|
57
|
+
typeof conditionValue === 'string' &&
|
|
58
|
+
isStringMatch(valueInDocument, conditionValue, false));
|
|
59
|
+
case 'like_cs':
|
|
60
|
+
return (typeof valueInDocument === 'string' &&
|
|
61
|
+
typeof conditionValue === 'string' &&
|
|
62
|
+
isStringMatch(valueInDocument, conditionValue, true));
|
|
63
|
+
case 'not like_cs':
|
|
64
|
+
return !(typeof valueInDocument === 'string' &&
|
|
65
|
+
typeof conditionValue === 'string' &&
|
|
66
|
+
isStringMatch(valueInDocument, conditionValue, true));
|
|
67
|
+
default:
|
|
68
|
+
throw new Error(`Unsupported operator comparison: ${operator}`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.compareOperator = compareOperator;
|
|
72
|
+
function isStringMatch(str, pattern, caseSensitive) {
|
|
73
|
+
if (!caseSensitive) {
|
|
74
|
+
str = str.toLowerCase();
|
|
75
|
+
pattern = pattern.toLowerCase();
|
|
76
|
+
}
|
|
77
|
+
const escapedPattern = pattern.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
78
|
+
const regexPattern = escapedPattern.replace(/%/g, '[\\s\\S]*');
|
|
79
|
+
const regex = new RegExp(`^${regexPattern}$`);
|
|
80
|
+
return regex.test(str);
|
|
81
|
+
}
|
|
82
|
+
function getQuerySubscriptionId(clientId, clientRequestId) {
|
|
83
|
+
return `${clientId}_${clientRequestId}`;
|
|
84
|
+
}
|
|
85
|
+
exports.getQuerySubscriptionId = getQuerySubscriptionId;
|
|
86
|
+
function parseQuerySubscriptionId(querySubscriptionId) {
|
|
87
|
+
const splitString = querySubscriptionId.split('_');
|
|
88
|
+
return {
|
|
89
|
+
clientId: splitString[0],
|
|
90
|
+
clientRequestId: splitString[1],
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
exports.parseQuerySubscriptionId = parseQuerySubscriptionId;
|
|
94
|
+
//# sourceMappingURL=query.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.types.js","sourceRoot":"","sources":["../../../../../internal-common/src/types/query.types.ts"],"names":[],"mappings":";;;AAAA,mCAAuB;AACvB,0DAA+D;AA4C/D,SAAgB,eAAe,CAAC,SAAyB;IACvD,OAAO,IAAA,qCAAqB,EAAC,SAAS,CAAC,CAAC;AAC1C,CAAC;AAFD,0CAEC;AAYD,MAAsB,mBAAmB;CAMxC;AAND,kDAMC;AAGD,SAAgB,eAAe,CAC7B,cAAkC,EAClC,eAAmC,EACnC,QAAkB;IAElB,cAAc,GAAG,cAAc,YAAY,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,IAAI,CAAC;IACpG,eAAe,GAAG,eAAe,YAAY,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,eAAe,aAAf,eAAe,cAAf,eAAe,GAAI,IAAI,CAAC;IAExG,IAAI,QAAQ,KAAK,IAAI,EAAE;QACrB,OAAO,gBAAC,CAAC,OAAO,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC;KACnD;IACD,IAAI,QAAQ,KAAK,IAAI,EAAE;QACrB,OAAO,CAAC,gBAAC,CAAC,OAAO,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC;KACpD;IAGD,QAAQ,QAAQ,EAAE;QAChB,KAAK,GAAG;YACN,IAAI,gBAAC,CAAC,KAAK,CAAC,cAAc,CAAC;gBAAE,OAAO,KAAK,CAAC;YAC1C,IAAI,gBAAC,CAAC,KAAK,CAAC,eAAe,CAAC;gBAAE,OAAO,IAAI,CAAC;YAC1C,OAAO,eAAe,GAAG,cAAc,CAAC;QAC1C,KAAK,IAAI;YACP,IAAI,gBAAC,CAAC,KAAK,CAAC,eAAe,CAAC,E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AAC;QACJ;YACE,MAAM,IAAI,KAAK,CAAC,oCAAoC,QAAQ,EAAE,CAAC,CAAC;KACnE;AACH,CAAC;AApED,0CAoEC;AAGD,SAAS,aAAa,CAAC,GAAW,EAAE,OAAe,EAAE,aAAsB;IACzE,IAAI,CAAC,aAAa,EAAE;QAClB,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;QACxB,OAAO,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;KACjC;IAED,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC;IAIzE,MAAM,YAAY,GAAG,cAAc,CAAC,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAG/D,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,IAAI,YAAY,GAAG,CAAC,CAAC;IAC9C,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC;AAMD,SAAgB,sBAAsB,CAAC,QAAgB,EAAE,eAAuB;IAC9E,OAAO,GAAG,QAAQ,IAAI,eAAe,EAAE,CAAC;AAC1C,CAAC;AAFD,wDAEC;AAGD,SAAgB,wBAAwB,CAAC,mBAAwC;IAI/E,MAAM,WAAW,GAAG,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnD,OAAO;QACL,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;QACxB,eAAe,EAAE,WAAW,CAAC,CAAC,CAAC;KAChC,CAAC;AACJ,CAAC;AATD,4DASC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ApiKeyEntry, SecretEntry, SecretKey, SecretMetadata, SecretValue } from '../public-types/secret.public-types';
|
|
2
|
+
export type ApiKeyName = string;
|
|
3
|
+
export type SetSecretEntry = {
|
|
4
|
+
key: SecretKey;
|
|
5
|
+
value?: SecretValue;
|
|
6
|
+
};
|
|
7
|
+
export declare const BACKEND_API_KEY = "_BACKEND_API_KEY";
|
|
8
|
+
export declare const APP_API_KEY = "APP_API_KEY";
|
|
9
|
+
export interface ApplicationSecrets {
|
|
10
|
+
custom: Record<SecretKey, SecretEntry>;
|
|
11
|
+
apiKeys: Record<SecretKey, ApiKeyEntry>;
|
|
12
|
+
}
|
|
13
|
+
export interface SystemSecrets {
|
|
14
|
+
sharedMongo: {
|
|
15
|
+
password: string;
|
|
16
|
+
};
|
|
17
|
+
datadog: {
|
|
18
|
+
appKey: string;
|
|
19
|
+
apiKey: string;
|
|
20
|
+
};
|
|
21
|
+
openai: {
|
|
22
|
+
apiKey: string;
|
|
23
|
+
};
|
|
24
|
+
anthropic: {
|
|
25
|
+
apiKey: string;
|
|
26
|
+
};
|
|
27
|
+
pinecone: {
|
|
28
|
+
apiKey: string;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export interface SetSecretRequest {
|
|
32
|
+
entries: Array<SetSecretRequestEntry>;
|
|
33
|
+
}
|
|
34
|
+
export interface SetSecretRequestEntry {
|
|
35
|
+
key: SecretKey;
|
|
36
|
+
value: SecretValue;
|
|
37
|
+
}
|
|
38
|
+
export interface DeleteSecretRequest {
|
|
39
|
+
keys: Array<SecretKey>;
|
|
40
|
+
}
|
|
41
|
+
export interface GetCustomSecretRequest {
|
|
42
|
+
key: SecretKey;
|
|
43
|
+
}
|
|
44
|
+
export interface GetApiKeyRequest {
|
|
45
|
+
key: SecretKey;
|
|
46
|
+
}
|
|
47
|
+
export type DeleteApiKeyRequest = Pick<SecretMetadata, 'key'>;
|
|
48
|
+
export interface ListApplicationSecretMetadataResponse {
|
|
49
|
+
custom: SecretMetadata[];
|
|
50
|
+
apiKeys: SecretMetadata[];
|
|
51
|
+
}
|
|
52
|
+
export type GenerateNewApiKeyRequest = Pick<SecretMetadata, 'key'>;
|
|
53
|
+
export interface GenerateNewApiKeyResponse {
|
|
54
|
+
apiKey: string;
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secret.types.js","sourceRoot":"","sources":["../../../../../internal-common/src/types/secret.types.ts"],"names":[],"mappings":";;;AAUa,QAAA,eAAe,GAAG,kBAAkB,CAAC;AACrC,QAAA,WAAW,GAAG,aAAa,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Auth, RunContext } from '../public-types/context.public-types';
|
|
2
|
+
import { SecretKey } from '../public-types/secret.public-types';
|
|
3
|
+
import { EnvironmentId, SquidDeveloperId, SquidDocId } from '../public-types/communication.public-types';
|
|
4
|
+
export interface SecureNamedQueryRequest {
|
|
5
|
+
params: Record<string, any>;
|
|
6
|
+
}
|
|
7
|
+
export type DocHash = string;
|
|
8
|
+
export type SecurityResponse = {
|
|
9
|
+
docsToHash: Record<SquidDocId, DocHash | undefined>;
|
|
10
|
+
rulesPassed: true;
|
|
11
|
+
} | {
|
|
12
|
+
rulesPassed: false;
|
|
13
|
+
};
|
|
14
|
+
export interface ServiceConfig {
|
|
15
|
+
auth: Auth | undefined;
|
|
16
|
+
backendApiKey: string;
|
|
17
|
+
codeDir: string;
|
|
18
|
+
context: RunContext;
|
|
19
|
+
environmentId?: EnvironmentId;
|
|
20
|
+
secrets: Record<SecretKey, any>;
|
|
21
|
+
squidDeveloperId?: SquidDeveloperId;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security.types.js","sourceRoot":"","sources":["../../../../../internal-common/src/types/security.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ExecuteFunctionAnnotationType } from '../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,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transformResponse = exports.transformParams = void 0;
|
|
4
|
+
const query_public_context_1 = require("../public-types/query.public-context");
|
|
5
|
+
const mutation_public_context_1 = require("../public-types/mutation.public-context");
|
|
6
|
+
const native_query_context_1 = require("../types/native-query.context");
|
|
7
|
+
const distributed_lock_context_1 = require("../types/distributed-lock.context");
|
|
8
|
+
const graphql_context_1 = require("../types/graphql.context");
|
|
9
|
+
const api_call_context_1 = require("../types/api-call.context");
|
|
10
|
+
const backend_run_types_1 = require("../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_public_context_1.QueryContext(params[0].query)];
|
|
18
|
+
case 'secureMutation':
|
|
19
|
+
return [
|
|
20
|
+
new mutation_public_context_1.MutationPublicContext(params[0].mutation, params[0]['beforeAndAfterDocs'], params[0]['serverTimestamp']),
|
|
21
|
+
];
|
|
22
|
+
case 'secureNativeQuery':
|
|
23
|
+
return [new native_query_context_1.NativeQueryContext(params[0], params[1], params[2])];
|
|
24
|
+
case 'secureDistributedLock':
|
|
25
|
+
return [new distributed_lock_context_1.DistributedLockContext(params[0].mutex)];
|
|
26
|
+
case 'secureGraphQL':
|
|
27
|
+
return [new graphql_context_1.GraphqlContext(params[0])];
|
|
28
|
+
case 'secureApi':
|
|
29
|
+
return [new api_call_context_1.ApiCallContext(params[0])];
|
|
30
|
+
case 'secureAiChatbotChat':
|
|
31
|
+
return [new ai_chatbot_context_1.AiChatbotChatContext(params[0])];
|
|
32
|
+
case 'secureAiChatbotMutation':
|
|
33
|
+
return [new ai_chatbot_context_1.AiChatbotMutationContext(params[0])];
|
|
34
|
+
default:
|
|
35
|
+
return params;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.transformParams = transformParams;
|
|
39
|
+
function transformResponse(functionResponse, executeFunctionAnnotationType) {
|
|
40
|
+
if (backend_run_types_1.ExecuteFunctionSecureAnnotations.includes(executeFunctionAnnotationType)) {
|
|
41
|
+
return {
|
|
42
|
+
rulesPassed: functionResponse,
|
|
43
|
+
docsToHash: functionResponse ? {} : undefined,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
if (executeFunctionAnnotationType === 'webhook') {
|
|
47
|
+
if (isWebhookResponse(functionResponse)) {
|
|
48
|
+
delete functionResponse['__isWebhookResponse__'];
|
|
49
|
+
return functionResponse;
|
|
50
|
+
}
|
|
51
|
+
functionResponse = functionResponse !== null && functionResponse !== void 0 ? functionResponse : null;
|
|
52
|
+
const isStringOrNullBody = functionResponse === null || typeof functionResponse === 'string';
|
|
53
|
+
const headers = {
|
|
54
|
+
'content-type': isStringOrNullBody ? 'text/plain' : 'application/json',
|
|
55
|
+
'cache-control': 'no-cache',
|
|
56
|
+
};
|
|
57
|
+
const body = isStringOrNullBody ? functionResponse || '' : JSON.stringify(functionResponse);
|
|
58
|
+
const webhookResponse = {
|
|
59
|
+
headers,
|
|
60
|
+
body,
|
|
61
|
+
statusCode: functionResponse === null ? 204 : 200,
|
|
62
|
+
};
|
|
63
|
+
return webhookResponse;
|
|
64
|
+
}
|
|
65
|
+
if (executeFunctionAnnotationType === 'openapi') {
|
|
66
|
+
if (isOpenApiResponse(functionResponse)) {
|
|
67
|
+
delete functionResponse['__isOpenApiResponse__'];
|
|
68
|
+
return functionResponse;
|
|
69
|
+
}
|
|
70
|
+
functionResponse = functionResponse !== null && functionResponse !== void 0 ? functionResponse : null;
|
|
71
|
+
const isStringOrNullBody = functionResponse === null || typeof functionResponse === 'string';
|
|
72
|
+
const headers = {
|
|
73
|
+
'content-type': isStringOrNullBody ? 'text/plain' : 'application/json',
|
|
74
|
+
'cache-control': 'no-cache',
|
|
75
|
+
};
|
|
76
|
+
const body = isStringOrNullBody ? functionResponse || '' : JSON.stringify(functionResponse);
|
|
77
|
+
const openApiResponse = {
|
|
78
|
+
headers,
|
|
79
|
+
body,
|
|
80
|
+
statusCode: functionResponse === null ? 204 : 200,
|
|
81
|
+
};
|
|
82
|
+
return openApiResponse;
|
|
83
|
+
}
|
|
84
|
+
return functionResponse;
|
|
85
|
+
}
|
|
86
|
+
exports.transformResponse = transformResponse;
|
|
87
|
+
function isWebhookResponse(response) {
|
|
88
|
+
return response && response.__isWebhookResponse__;
|
|
89
|
+
}
|
|
90
|
+
function isOpenApiResponse(response) {
|
|
91
|
+
return response && response.__isOpenApiResponse__;
|
|
92
|
+
}
|
|
93
|
+
//# 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,+EAAoE;AACpE,qFAAgF;AAChF,wEAAmE;AACnE,gFAA2E;AAC3E,8DAA0D;AAC1D,gEAA2D;AAE3D,kEAIoC;AAEpC,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,mCAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QAC7C,KAAK,gBAAgB;YACnB,OAAO;gBACL,IAAI,+CAAqB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC;aAC7G,CAAC;QACJ,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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Aa;IACtC,OAAO,QAAQ,IAAI,QAAQ,CAAC,qBAAqB,CAAC;AACpD,CAAC;AAED,SAAS,iBAAiB,CAAC,QAAa;IACtC,OAAO,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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kCA0BC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getApplicationHttpHeaders = exports.getApplicationUrl = void 0;
|
|
4
|
+
const kotlinControllers = [
|
|
5
|
+
'query',
|
|
6
|
+
'aiData',
|
|
7
|
+
'api',
|
|
8
|
+
'backend-function',
|
|
9
|
+
'webhooks',
|
|
10
|
+
'ws',
|
|
11
|
+
'quota',
|
|
12
|
+
'named-query',
|
|
13
|
+
'native-query',
|
|
14
|
+
'application-kotlin',
|
|
15
|
+
'openapi',
|
|
16
|
+
'secret',
|
|
17
|
+
'queue',
|
|
18
|
+
'mutation',
|
|
19
|
+
];
|
|
20
|
+
function getApplicationUrl(regionPrefix, appId, path) {
|
|
21
|
+
const baseUrl = 'https://squid.cloud';
|
|
22
|
+
const parsedBaseUrl = new URL(baseUrl);
|
|
23
|
+
parsedBaseUrl.host = `${appId}.${regionPrefix}.${parsedBaseUrl.host}`;
|
|
24
|
+
const controller = path.replace(/^\//g, '').split('/')[0] || '';
|
|
25
|
+
if (isLocal(regionPrefix)) {
|
|
26
|
+
parsedBaseUrl.protocol = 'http';
|
|
27
|
+
parsedBaseUrl.port = kotlinControllers.includes(controller) ? '8001' : '8000';
|
|
28
|
+
if (isAndroid(regionPrefix)) {
|
|
29
|
+
parsedBaseUrl.host = '10.0.2.2';
|
|
30
|
+
}
|
|
31
|
+
else if (isIOS(regionPrefix)) {
|
|
32
|
+
parsedBaseUrl.host = 'localhost';
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const url = parsedBaseUrl.toString();
|
|
36
|
+
path = path.startsWith('/') ? path.slice(1) : path;
|
|
37
|
+
return (url.endsWith('/') ? url : url + '/') + path;
|
|
38
|
+
}
|
|
39
|
+
exports.getApplicationUrl = getApplicationUrl;
|
|
40
|
+
function getApplicationHttpHeaders(regionPrefix, appId) {
|
|
41
|
+
const headers = {};
|
|
42
|
+
if (isLocal(regionPrefix)) {
|
|
43
|
+
headers['x-squid-appid'] = appId;
|
|
44
|
+
}
|
|
45
|
+
return headers;
|
|
46
|
+
}
|
|
47
|
+
exports.getApplicationHttpHeaders = getApplicationHttpHeaders;
|
|
48
|
+
function isLocal(regionPrefix) {
|
|
49
|
+
return /^local/.test(regionPrefix);
|
|
50
|
+
}
|
|
51
|
+
function isAndroid(regionPrefix) {
|
|
52
|
+
return /android$/.test(regionPrefix);
|
|
53
|
+
}
|
|
54
|
+
function isIOS(regionPrefix) {
|
|
55
|
+
return /ios$/.test(regionPrefix);
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=http.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../../../../internal-common/src/utils/http.ts"],"names":[],"mappings":";;;AAAA,MAAM,iBAAiB,GAAG;IACxB,OAAO;IACP,QAAQ;IACR,KAAK;IACL,kBAAkB;IAClB,UAAU;IACV,IAAI;IACJ,OAAO;IACP,aAAa;IACb,cAAc;IACd,oBAAoB;IACpB,SAAS;IACT,QAAQ;IACR,OAAO;IACP,UAAU;CACX,CAAC;AAEF,SAAgB,iBAAiB,CAAC,YAAoB,EAAE,KAAa,EAAE,IAAY;IACjF,MAAM,OAAO,GAAG,qBAAqB,CAAC;IACtC,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;IACvC,aAAa,CAAC,IAAI,GAAG,GAAG,KAAK,IAAI,YAAY,IAAI,aAAa,CAAC,IAAI,EAAE,CAAC;IACtE,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAEhE,IAAI,OAAO,CAAC,YAAY,CAAC,EAAE;QACzB,aAAa,CAAC,QAAQ,GAAG,MAAM,CAAC;QAChC,aAAa,CAAC,IAAI,GAAG,iBAAiB,C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export declare function serializeObj(obj: unknown): string;
|
|
3
|
+
export declare function deserializeObj<T = any>(str: string): T;
|
|
4
|
+
export declare function encodeValueForMapping(value: any): string;
|
|
5
|
+
export declare function decodeValueForMapping(encodedString: string): any;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.decodeValueForMapping = exports.encodeValueForMapping = exports.deserializeObj = exports.serializeObj = exports.normalizeJsonAsString = void 0;
|
|
4
|
+
const _ = require("lodash");
|
|
5
|
+
function sortKeys(json) {
|
|
6
|
+
if (Array.isArray(json)) {
|
|
7
|
+
return json.map(o => sortKeys(o));
|
|
8
|
+
}
|
|
9
|
+
if (typeof json !== 'object' || json === null || json instanceof Date) {
|
|
10
|
+
return json;
|
|
11
|
+
}
|
|
12
|
+
const keys = Object.keys(json);
|
|
13
|
+
const result = {};
|
|
14
|
+
keys.sort().forEach(key => {
|
|
15
|
+
result[key] = sortKeys(json[key]);
|
|
16
|
+
});
|
|
17
|
+
return result;
|
|
18
|
+
}
|
|
19
|
+
function normalizeJsonAsString(json) {
|
|
20
|
+
return serializeObj(sortKeys(json));
|
|
21
|
+
}
|
|
22
|
+
exports.normalizeJsonAsString = normalizeJsonAsString;
|
|
23
|
+
function serializeObj(obj) {
|
|
24
|
+
if (obj === undefined)
|
|
25
|
+
return null;
|
|
26
|
+
const objWithReplacedDates = _.cloneDeepWith(obj, value => {
|
|
27
|
+
return _.isDate(value) ? { $date: value.toISOString() } : undefined;
|
|
28
|
+
});
|
|
29
|
+
return JSON.stringify(objWithReplacedDates);
|
|
30
|
+
}
|
|
31
|
+
exports.serializeObj = serializeObj;
|
|
32
|
+
function deserializeObj(str) {
|
|
33
|
+
const deserializedObj = JSON.parse(str);
|
|
34
|
+
return _.cloneDeepWith(deserializedObj, value => {
|
|
35
|
+
return _.isObject(value) && _.has(value, '$date') && Object.keys(value).length === 1
|
|
36
|
+
? new Date(value['$date'])
|
|
37
|
+
: undefined;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
exports.deserializeObj = deserializeObj;
|
|
41
|
+
function encodeValueForMapping(value) {
|
|
42
|
+
if (value === undefined)
|
|
43
|
+
throw new Error('INVALID_ENCODE_VALUE');
|
|
44
|
+
const serializedValue = serializeObj(value);
|
|
45
|
+
if (typeof Buffer !== 'undefined') {
|
|
46
|
+
return Buffer.from(serializedValue, 'utf8').toString('base64');
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
const bytes = new TextEncoder().encode(serializedValue);
|
|
50
|
+
let binary = '';
|
|
51
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
52
|
+
binary += String.fromCharCode(bytes[i]);
|
|
53
|
+
}
|
|
54
|
+
return btoa(binary);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.encodeValueForMapping = encodeValueForMapping;
|
|
58
|
+
function decodeValueForMapping(encodedString) {
|
|
59
|
+
let decodedValue;
|
|
60
|
+
if (typeof Buffer !== 'undefined') {
|
|
61
|
+
decodedValue = Buffer.from(encodedString, 'base64').toString('utf8');
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
const binary = atob(encodedString);
|
|
65
|
+
const bytes = new Uint8Array(binary.length);
|
|
66
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
67
|
+
bytes[i] = binary.charCodeAt(i);
|
|
68
|
+
}
|
|
69
|
+
decodedValue = new TextDecoder().decode(bytes);
|
|
70
|
+
}
|
|
71
|
+
return deserializeObj(decodedValue);
|
|
72
|
+
}
|
|
73
|
+
exports.decodeValueForMapping = decodeValueForMapping;
|
|
74
|
+
//# sourceMappingURL=serialization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialization.js","sourceRoot":"","sources":["../../../../../internal-common/src/utils/serialization.ts"],"names":[],"mappings":";;;AAAA,4BAA4B;AAE5B,SAAS,QAAQ,CAAC,IAAS;IACzB,IAAI,KAAK,CAAC,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