@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,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClientConnectionState = void 0;
|
|
4
|
+
var ClientConnectionState;
|
|
5
|
+
(function (ClientConnectionState) {
|
|
6
|
+
ClientConnectionState["CONNECTED"] = "CONNECTED";
|
|
7
|
+
ClientConnectionState["DISCONNECTED"] = "DISCONNECTED";
|
|
8
|
+
ClientConnectionState["REMOVED"] = "REMOVED";
|
|
9
|
+
})(ClientConnectionState || (exports.ClientConnectionState = ClientConnectionState = {}));
|
|
10
|
+
//# sourceMappingURL=socket.public-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"socket.public-types.js","sourceRoot":"","sources":["../../../../../internal-common/src/public-types/socket.public-types.ts"],"names":[],"mappings":";;;AAAA,IAAY,qBAOX;AAPD,WAAY,qBAAqB;IAE/B,gDAAuB,CAAA;IAEvB,sDAA6B,CAAA;IAE7B,4CAAmB,CAAA;AACrB,CAAC,EAPW,qBAAqB,qCAArB,qBAAqB,QAOhC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IntegrationId } from './communication.public-types';
|
|
2
|
+
export interface TopicReadContext {
|
|
3
|
+
integrationId: IntegrationId;
|
|
4
|
+
topicName: string;
|
|
5
|
+
}
|
|
6
|
+
export interface TopicWriteContext<T> {
|
|
7
|
+
integrationId: IntegrationId;
|
|
8
|
+
topicName: string;
|
|
9
|
+
messages: Array<T>;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topic.public-context.js","sourceRoot":"","sources":["../../../../../internal-common/src/public-types/topic.public-context.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface Type<T> extends Function {
|
|
2
|
+
new (...args: any[]): T;
|
|
3
|
+
}
|
|
4
|
+
export type Replace<TypeToBeChecked, KeyToBeReplaced extends keyof TypeToBeChecked, NewValueToUse> = Omit<TypeToBeChecked, KeyToBeReplaced> & {
|
|
5
|
+
[P in KeyToBeReplaced]: NewValueToUse;
|
|
6
|
+
};
|
|
7
|
+
export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
8
|
+
export type WithRequired<T, K extends keyof T> = T & {
|
|
9
|
+
[P in K]-?: T[P];
|
|
10
|
+
};
|
|
11
|
+
type PropertiesWithPrefix<Prefix extends string> = {
|
|
12
|
+
[key in `${Prefix}${string}`]: any;
|
|
13
|
+
};
|
|
14
|
+
type Pred = [0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
15
|
+
export type DeepRecord<T, RemainingDepth extends number & keyof Pred = 5, Prefix extends string = ''> = RemainingDepth extends 0 ? PropertiesWithPrefix<Prefix> : {
|
|
16
|
+
[k in keyof T]-?: k extends string | number ? Record<`${Prefix}${k}`, T[k]> | (Required<T>[k] extends any[] ? never : Required<T>[k] extends object ? DeepRecord<Required<T>[k], Pred[RemainingDepth], `${Prefix}${k}.`> : never) : never;
|
|
17
|
+
}[keyof T];
|
|
18
|
+
export type UnionKeys<T> = T extends any ? keyof T : never;
|
|
19
|
+
export type FieldOf<T, K extends UnionKeys<T>> = Extract<T, Record<K, any>>[K];
|
|
20
|
+
export type Paths<T> = UnionKeys<DeepRecord<T>>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript.public-types.js","sourceRoot":"","sources":["../../../../../internal-common/src/public-types/typescript.public-types.ts"],"names":[],"mappings":""}
|
|
@@ -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 { AiChatbotProfileMetadata } from '../public-types/integrations/ai_chatbot.types';
|
|
3
|
+
import { ClientRequestId, IntegrationId } from '../public-types/communication.public-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,13 @@
|
|
|
1
|
+
import { ApiHeaders, SecureApiRequest } from './api.types';
|
|
2
|
+
import { ApiEndpointId, HttpMethod } from '../public-types/integrations/api.types';
|
|
3
|
+
export declare class ApiCallContext {
|
|
4
|
+
readonly endpointId: ApiEndpointId;
|
|
5
|
+
readonly url: string;
|
|
6
|
+
readonly method: HttpMethod;
|
|
7
|
+
readonly headers: ApiHeaders;
|
|
8
|
+
readonly body: Record<string, any>;
|
|
9
|
+
readonly queryParams: Record<string, string | number | boolean>;
|
|
10
|
+
readonly pathParams: Record<string, string>;
|
|
11
|
+
readonly serverUrlOverride: string | undefined;
|
|
12
|
+
constructor(apiRequest: SecureApiRequest);
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApiCallContext = void 0;
|
|
4
|
+
class ApiCallContext {
|
|
5
|
+
constructor(apiRequest) {
|
|
6
|
+
this.endpointId = apiRequest.endpointId;
|
|
7
|
+
this.url = apiRequest.url;
|
|
8
|
+
this.method = apiRequest.method;
|
|
9
|
+
this.headers = apiRequest.headers;
|
|
10
|
+
this.body = apiRequest.body;
|
|
11
|
+
this.queryParams = apiRequest.queryParams;
|
|
12
|
+
this.pathParams = apiRequest.pathParams;
|
|
13
|
+
this.serverUrlOverride = apiRequest.serverUrlOverride;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.ApiCallContext = ApiCallContext;
|
|
17
|
+
//# sourceMappingURL=api-call.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-call.context.js","sourceRoot":"","sources":["../../../../../internal-common/src/types/api-call.context.ts"],"names":[],"mappings":";;;AAIA,MAAa,cAAc;IAWzB,YAAY,UAA4B;QACtC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;QACxC,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC,GAAG,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QAChC,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;QAClC,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC;QAC1C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;QACxC,IAAI,CAAC,iBAAiB,GAAG,UAAU,CAAC,iBAAiB,CAAC;IACxD,CAAC;CACF;AArBD,wCAqBC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ApiEndpointId, HttpMethod } from '../public-types/integrations/api.types';
|
|
2
|
+
import { IntegrationId } from '../public-types/communication.public-types';
|
|
3
|
+
export type ApiHeaders = Record<string, string | number | boolean>;
|
|
4
|
+
export type ApiQueryParams = Record<string, string | number | boolean>;
|
|
5
|
+
export interface CallApiRequest {
|
|
6
|
+
integrationId: IntegrationId;
|
|
7
|
+
endpointId: ApiEndpointId;
|
|
8
|
+
serverUrlOverride?: string;
|
|
9
|
+
request: Record<string, any>;
|
|
10
|
+
}
|
|
11
|
+
export interface ExtractedApiParams {
|
|
12
|
+
headers: ApiHeaders;
|
|
13
|
+
queryParams: ApiQueryParams;
|
|
14
|
+
body: Record<string, any>;
|
|
15
|
+
pathParams: Record<string, string>;
|
|
16
|
+
}
|
|
17
|
+
export interface SecureApiRequest extends ExtractedApiParams {
|
|
18
|
+
endpointId: ApiEndpointId;
|
|
19
|
+
url: string;
|
|
20
|
+
method: HttpMethod;
|
|
21
|
+
serverUrlOverride: string | undefined;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.types.js","sourceRoot":"","sources":["../../../../../internal-common/src/types/api.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Auth, RunContext } from '../public-types/context.public-types';
|
|
2
|
+
import { ApplicationSecrets } from './secret.types';
|
|
3
|
+
import { SecretKey, SecretValue } from '../public-types/secret.public-types';
|
|
4
|
+
export interface RunPermissions {
|
|
5
|
+
hosts: Array<string>;
|
|
6
|
+
}
|
|
7
|
+
export interface ErrorResponse extends GeneralResponse {
|
|
8
|
+
ok: false;
|
|
9
|
+
error: string;
|
|
10
|
+
details?: string;
|
|
11
|
+
functionName: string;
|
|
12
|
+
}
|
|
13
|
+
export interface GeneralResponse {
|
|
14
|
+
ok: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface RunConfiguration {
|
|
17
|
+
codeUrl: string;
|
|
18
|
+
codeUrlId: string;
|
|
19
|
+
isSecurityRules: boolean;
|
|
20
|
+
permissions: RunPermissions;
|
|
21
|
+
}
|
|
22
|
+
export interface LoadJsPayload {
|
|
23
|
+
codeUrl: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const ExecuteFunctionSecureAnnotations: readonly ["secureDistributedLock", "secureQuery", "secureMutation", "secureNamedQuery", "secureNativeQuery", "secureGraphQL", "secureApi", "secureAiChatbotChat", "secureAiChatbotMutation", "secureQueueWrite", "secureQueueRead"];
|
|
26
|
+
export type ExecuteFunctionSecureAnnotationType = (typeof ExecuteFunctionSecureAnnotations)[number];
|
|
27
|
+
export type ExecuteFunctionAnnotationType = 'executable' | 'webhook' | 'scheduler' | 'trigger' | 'transformRead' | 'transformWrite' | 'metadata' | 'aiFunction' | 'openapi' | ExecuteFunctionSecureAnnotationType;
|
|
28
|
+
export interface ExecuteFunctionPayload {
|
|
29
|
+
functionName: string;
|
|
30
|
+
params: Array<unknown>;
|
|
31
|
+
context: RunContext;
|
|
32
|
+
auth: Auth | undefined;
|
|
33
|
+
secrets?: Record<SecretKey, SecretValue>;
|
|
34
|
+
backendApiKey: string;
|
|
35
|
+
codeDir: string;
|
|
36
|
+
executeFunctionAnnotationType: ExecuteFunctionAnnotationType;
|
|
37
|
+
}
|
|
38
|
+
export type WorkerActionType = 'loadJs' | 'executeFunction' | 'ping' | 'terminate' | 'heartbeat';
|
|
39
|
+
export interface ActionRequest {
|
|
40
|
+
action: WorkerActionType;
|
|
41
|
+
payload?: LoadJsPayload | ExecuteFunctionPayload;
|
|
42
|
+
}
|
|
43
|
+
export type LoadJsResponse = GeneralResponse;
|
|
44
|
+
export type TerminateResponse = GeneralResponse;
|
|
45
|
+
export interface ExecuteFunctionResponse extends GeneralResponse {
|
|
46
|
+
ok: true;
|
|
47
|
+
functionResponse: unknown;
|
|
48
|
+
}
|
|
49
|
+
export interface RunSecrets {
|
|
50
|
+
custom: Record<SecretKey, SecretValue>;
|
|
51
|
+
backendApiKey: string;
|
|
52
|
+
}
|
|
53
|
+
export declare function convertToRunSecrets(appSecrets: ApplicationSecrets): RunSecrets;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertToRunSecrets = exports.ExecuteFunctionSecureAnnotations = void 0;
|
|
4
|
+
const secret_types_1 = require("./secret.types");
|
|
5
|
+
const assertic_1 = require("assertic");
|
|
6
|
+
exports.ExecuteFunctionSecureAnnotations = [
|
|
7
|
+
'secureDistributedLock',
|
|
8
|
+
'secureQuery',
|
|
9
|
+
'secureMutation',
|
|
10
|
+
'secureNamedQuery',
|
|
11
|
+
'secureNativeQuery',
|
|
12
|
+
'secureGraphQL',
|
|
13
|
+
'secureApi',
|
|
14
|
+
'secureAiChatbotChat',
|
|
15
|
+
'secureAiChatbotMutation',
|
|
16
|
+
'secureQueueWrite',
|
|
17
|
+
'secureQueueRead',
|
|
18
|
+
];
|
|
19
|
+
function convertToRunSecrets(appSecrets) {
|
|
20
|
+
const result = {
|
|
21
|
+
backendApiKey: (0, assertic_1.truthy)(appSecrets.apiKeys[secret_types_1.BACKEND_API_KEY].value, 'Cannot find backend API key'),
|
|
22
|
+
custom: {},
|
|
23
|
+
};
|
|
24
|
+
for (const [key, valueWrapper] of Object.entries(appSecrets.custom)) {
|
|
25
|
+
result.custom[key] = valueWrapper.value;
|
|
26
|
+
}
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
29
|
+
exports.convertToRunSecrets = convertToRunSecrets;
|
|
30
|
+
//# sourceMappingURL=backend-run.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend-run.types.js","sourceRoot":"","sources":["../../../../../internal-common/src/types/backend-run.types.ts"],"names":[],"mappings":";;;AACA,iDAAqE;AACrE,uCAAkC;AAmCrB,QAAA,gCAAgC,GAAG;IAC9C,uBAAuB;IACvB,aAAa;IACb,gBAAgB;IAChB,kBAAkB;IAClB,mBAAmB;IACnB,eAAe;IACf,WAAW;IACX,qBAAqB;IACrB,yBAAyB;IACzB,kBAAkB;IAClB,iBAAiB;CACT,CAAC;AAyDX,SAAgB,mBAAmB,CAAC,UAA8B;IAChE,MAAM,MAAM,GAAe;QACzB,aAAa,EAAE,IAAA,iBAAM,EAAC,UAAU,CAAC,OAAO,CAAC,8BAAe,CAAC,CAAC,KAAK,EAAE,6BAA6B,CAAW;QACzG,MAAM,EAAE,EAAE;KACX,CAAC;IAEF,KAAK,MAAM,CAAC,GAAG,EAAE,YAAY,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;QACnE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC;KACzC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAVD,kDAUC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { SchedulerConfig, SchedulerId, TriggerConfig, TriggerId, WebhookConfig, WebhookId } from '../public-types/application.public-types';
|
|
2
|
+
import { ApiEndpointId } from '../public-types/integrations/api.types';
|
|
3
|
+
import { OpenApiController } from './openapi.types';
|
|
4
|
+
import { AiChatbotActionType, AiFunctionParamType, DatabaseActionType, FunctionName, TopicActionType } from '../public-types/bundle-data.public-types';
|
|
5
|
+
import { IntegrationId } from '../public-types/communication.public-types';
|
|
6
|
+
import { CollectionName } from '../public-types/document.public-types';
|
|
7
|
+
export type TopicName = string;
|
|
8
|
+
export type ServiceName = string;
|
|
9
|
+
export type ServiceFunctionName = `${ServiceName}:${FunctionName}`;
|
|
10
|
+
export interface ApplicationBundleData {
|
|
11
|
+
databases: Record<IntegrationId, DatabaseMetadata>;
|
|
12
|
+
apis: Record<IntegrationId, {
|
|
13
|
+
endpoints: Record<ApiEndpointId, ApiMetadata>;
|
|
14
|
+
} & ApiMetadata>;
|
|
15
|
+
graphql: Record<IntegrationId, GraphQLMetadata>;
|
|
16
|
+
executables: Record<FunctionName, ExecutableMetadata>;
|
|
17
|
+
triggers: Record<TriggerId, TriggerConfig>;
|
|
18
|
+
schedulers: Record<SchedulerId, SchedulerConfig>;
|
|
19
|
+
webhooks: Record<WebhookId, WebhookConfig>;
|
|
20
|
+
nativeQueries: Record<IntegrationId, Array<ServiceFunctionName>>;
|
|
21
|
+
distributedLocks: {
|
|
22
|
+
security?: Array<ServiceFunctionName>;
|
|
23
|
+
mutexes?: Record<string, {
|
|
24
|
+
security?: Array<ServiceFunctionName>;
|
|
25
|
+
}>;
|
|
26
|
+
};
|
|
27
|
+
aiChatbots: Record<IntegrationId, {
|
|
28
|
+
profiles: Record<string, AiChatbotMetadata>;
|
|
29
|
+
} & AiChatbotMetadata>;
|
|
30
|
+
clientConnectionStateChangeHandlers?: Array<ServiceFunctionName>;
|
|
31
|
+
aiFunctions?: Record<FunctionName, AiFunctionMetadata>;
|
|
32
|
+
openApiControllers?: Array<OpenApiController>;
|
|
33
|
+
queues?: Record<IntegrationId, QueueMetadata>;
|
|
34
|
+
}
|
|
35
|
+
export interface LocalBackendData {
|
|
36
|
+
applicationBundleData: ApplicationBundleData;
|
|
37
|
+
openApiSpecStr?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface AiFunctionParam {
|
|
40
|
+
name: string;
|
|
41
|
+
description: string;
|
|
42
|
+
type: AiFunctionParamType;
|
|
43
|
+
required: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface AiFunctionMetadata {
|
|
46
|
+
description: string;
|
|
47
|
+
params: Array<AiFunctionParam>;
|
|
48
|
+
serviceFunction: ServiceFunctionName;
|
|
49
|
+
}
|
|
50
|
+
export interface DatabaseMetadata {
|
|
51
|
+
collections: Record<CollectionName, CollectionMetadata>;
|
|
52
|
+
security?: Record<DatabaseActionType, Array<ServiceFunctionName>>;
|
|
53
|
+
transform?: Record<DatabaseActionType, DatabaseTransformMetadata>;
|
|
54
|
+
}
|
|
55
|
+
export interface QueueMetadata {
|
|
56
|
+
topics: Record<TopicName, TopicMetadata>;
|
|
57
|
+
security?: Record<DatabaseActionType, Array<ServiceFunctionName>>;
|
|
58
|
+
transform?: Record<DatabaseActionType, DatabaseTransformMetadata>;
|
|
59
|
+
}
|
|
60
|
+
export interface TopicMetadata {
|
|
61
|
+
security?: Record<TopicActionType, Array<ServiceFunctionName>>;
|
|
62
|
+
}
|
|
63
|
+
export interface CollectionMetadata {
|
|
64
|
+
security?: Record<DatabaseActionType, Array<ServiceFunctionName>>;
|
|
65
|
+
transform?: Record<DatabaseActionType, DatabaseTransformMetadata>;
|
|
66
|
+
}
|
|
67
|
+
export interface DatabaseTransformMetadata {
|
|
68
|
+
serviceFunction: ServiceFunctionName;
|
|
69
|
+
}
|
|
70
|
+
export interface ExecutableMetadata {
|
|
71
|
+
serviceFunction: ServiceFunctionName;
|
|
72
|
+
}
|
|
73
|
+
export interface ApiMetadata {
|
|
74
|
+
security: Array<ServiceFunctionName>;
|
|
75
|
+
}
|
|
76
|
+
interface GraphQLMetadata {
|
|
77
|
+
security: Array<ServiceFunctionName>;
|
|
78
|
+
}
|
|
79
|
+
export interface AiChatbotMetadata {
|
|
80
|
+
security: Record<AiChatbotActionType, Array<ServiceFunctionName>>;
|
|
81
|
+
}
|
|
82
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle-data.types.js","sourceRoot":"","sources":["../../../../../internal-common/src/types/bundle-data.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AppId, EnvironmentId, SquidDeveloperId } from '../public-types/communication.public-types';
|
|
2
|
+
export type ChatId = string;
|
|
3
|
+
export interface ParsedAppId {
|
|
4
|
+
appId: AppId;
|
|
5
|
+
environmentId: EnvironmentId;
|
|
6
|
+
squidDeveloperId?: SquidDeveloperId;
|
|
7
|
+
}
|
|
8
|
+
export declare function parseAppId(appId: AppId): ParsedAppId;
|
|
9
|
+
export declare function appIdWithEnvironmentId(appId: AppId, environmentId: EnvironmentId | undefined): AppId;
|
|
10
|
+
export declare function appIdWithEnvironmentIdAndDevId(appId: AppId, environmentId: EnvironmentId | undefined, developerId: SquidDeveloperId | undefined): AppId;
|
|
11
|
+
export declare function validateEnvironment(appId: AppId): ParsedAppId;
|
|
12
|
+
export declare function verifyWithSquidDevId(appId: AppId): void;
|
|
13
|
+
export declare function omitSquidDevId(appId: AppId): AppId;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.omitSquidDevId = exports.verifyWithSquidDevId = exports.validateEnvironment = exports.appIdWithEnvironmentIdAndDevId = exports.appIdWithEnvironmentId = exports.parseAppId = void 0;
|
|
4
|
+
const assertic_1 = require("assertic");
|
|
5
|
+
function parseAppId(appId) {
|
|
6
|
+
const [appIdWithoutEnv, environmentId, squidDeveloperId, other] = appId.split(/[_-]/);
|
|
7
|
+
(0, assertic_1.assertTruthy)(!other, 'Invalid appId: ' + appId);
|
|
8
|
+
return {
|
|
9
|
+
appId: appIdWithoutEnv,
|
|
10
|
+
environmentId: (environmentId !== null && environmentId !== void 0 ? environmentId : 'prod'),
|
|
11
|
+
squidDeveloperId,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
exports.parseAppId = parseAppId;
|
|
15
|
+
function appIdWithEnvironmentId(appId, environmentId) {
|
|
16
|
+
const parsedAppId = parseAppId(appId);
|
|
17
|
+
return `${parsedAppId.appId}${!environmentId || environmentId === 'prod' ? '' : `-${environmentId}`}`;
|
|
18
|
+
}
|
|
19
|
+
exports.appIdWithEnvironmentId = appIdWithEnvironmentId;
|
|
20
|
+
function appIdWithEnvironmentIdAndDevId(appId, environmentId, developerId) {
|
|
21
|
+
return `${appIdWithEnvironmentId(appId, environmentId)}${developerId ? `-${developerId}` : ''}`;
|
|
22
|
+
}
|
|
23
|
+
exports.appIdWithEnvironmentIdAndDevId = appIdWithEnvironmentIdAndDevId;
|
|
24
|
+
function validateEnvironment(appId) {
|
|
25
|
+
const parsedAppId = parseAppId(appId);
|
|
26
|
+
(0, assertic_1.assertTruthy)(parsedAppId.environmentId !== 'prod' || !parsedAppId.squidDeveloperId, 'Cannot use developer ID in production');
|
|
27
|
+
return parsedAppId;
|
|
28
|
+
}
|
|
29
|
+
exports.validateEnvironment = validateEnvironment;
|
|
30
|
+
function verifyWithSquidDevId(appId) {
|
|
31
|
+
const parsedAppId = parseAppId(appId);
|
|
32
|
+
(0, assertic_1.assertTruthy)(parsedAppId.squidDeveloperId, 'Must provide squid developer ID');
|
|
33
|
+
}
|
|
34
|
+
exports.verifyWithSquidDevId = verifyWithSquidDevId;
|
|
35
|
+
function omitSquidDevId(appId) {
|
|
36
|
+
const parsedAppId = parseAppId(appId);
|
|
37
|
+
return appIdWithEnvironmentId(parsedAppId.appId, parsedAppId.environmentId);
|
|
38
|
+
}
|
|
39
|
+
exports.omitSquidDevId = omitSquidDevId;
|
|
40
|
+
//# sourceMappingURL=communication.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"communication.types.js","sourceRoot":"","sources":["../../../../../internal-common/src/types/communication.types.ts"],"names":[],"mappings":";;;AAKA,uCAAwC;AAaxC,SAAgB,UAAU,CAAC,KAAY;IAErC,MAAM,CAAC,eAAe,EAAE,aAAa,EAAE,gBAAgB,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACtF,IAAA,uBAAY,EAAC,CAAC,KAAK,EAAE,iBAAiB,GAAG,KAAK,CAAC,CAAC;IAChD,OAAO;QACL,KAAK,EAAE,eAAe;QACtB,aAAa,EAAE,CAAC,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,MAAM,CAAkB;QACzD,gBAAgB;KACjB,CAAC;AACJ,CAAC;AATD,gCASC;AAGD,SAAgB,sBAAsB,CAAC,KAAY,EAAE,aAAwC;IAC3F,MAAM,WAAW,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IACtC,OAAO,GAAG,WAAW,CAAC,KAAK,GAAG,CAAC,aAAa,IAAI,aAAa,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,aAAa,EAAE,EAAE,CAAC;AACxG,CAAC;AAHD,wDAGC;AAGD,SAAgB,8BAA8B,CAC5C,KAAY,EACZ,aAAwC,EACxC,WAAyC;IAEzC,OAAO,GAAG,sBAAsB,CAAC,KAAK,EAAE,aAAa,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AAClG,CAAC;AAND,wEAMC;AAGD,SAAgB,mBAAmB,CAAC,KAAY;IAC9C,MAAM,WAAW,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IACtC,IAAA,uBAAY,EACV,WAAW,CAAC,aAAa,KAAK,MAAM,IAAI,CAAC,WAAW,CAAC,gBAAgB,EACrE,uCAAuC,CACxC,CAAC;IACF,OAAO,WAAW,CAAC;AACrB,CAAC;AAPD,kDAOC;AAGD,SAAgB,oBAAoB,CAAC,KAAY;IAC/C,MAAM,WAAW,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IACtC,IAAA,uBAAY,EAAC,WAAW,CAAC,gBAAgB,EAAE,iCAAiC,CAAC,CAAC;AAChF,CAAC;AAHD,oDAGC;AAGD,SAAgB,cAAc,CAAC,KAAY;IACzC,MAAM,WAAW,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IACtC,OAAO,sBAAsB,CAAC,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;AAC9E,CAAC;AAHD,wCAGC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DistributedLockContext = void 0;
|
|
4
|
+
class DistributedLockContext {
|
|
5
|
+
constructor(mutex) {
|
|
6
|
+
this.mutex = mutex;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
exports.DistributedLockContext = DistributedLockContext;
|
|
10
|
+
//# sourceMappingURL=distributed-lock.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"distributed-lock.context.js","sourceRoot":"","sources":["../../../../../internal-common/src/types/distributed-lock.context.ts"],"names":[],"mappings":";;;AACA,MAAa,sBAAsB;IAEjC,YAAqB,KAAa;QAAb,UAAK,GAAL,KAAK,CAAQ;IAAG,CAAC;CACvC;AAHD,wDAGC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface GraphQlRequest {
|
|
2
|
+
isGraphiQL: boolean;
|
|
3
|
+
query?: string;
|
|
4
|
+
operationName?: string;
|
|
5
|
+
variables?: string | Record<string, any>;
|
|
6
|
+
}
|
|
7
|
+
export declare class GraphqlContext {
|
|
8
|
+
readonly isGraphiQL: boolean;
|
|
9
|
+
readonly query: string | undefined;
|
|
10
|
+
readonly variables: string | Record<string, any> | undefined;
|
|
11
|
+
readonly operationName: string | undefined;
|
|
12
|
+
constructor(graphQlRequest: GraphQlRequest);
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GraphqlContext = void 0;
|
|
4
|
+
class GraphqlContext {
|
|
5
|
+
constructor(graphQlRequest) {
|
|
6
|
+
this.isGraphiQL = graphQlRequest.isGraphiQL;
|
|
7
|
+
this.query = graphQlRequest.query;
|
|
8
|
+
this.operationName = graphQlRequest.operationName;
|
|
9
|
+
this.variables = graphQlRequest.variables;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.GraphqlContext = GraphqlContext;
|
|
13
|
+
//# sourceMappingURL=graphql.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql.context.js","sourceRoot":"","sources":["../../../../../internal-common/src/types/graphql.context.ts"],"names":[],"mappings":";;;AASA,MAAa,cAAc;IASzB,YAAY,cAA8B;QACxC,IAAI,CAAC,UAAU,GAAG,cAAc,CAAC,UAAU,CAAC;QAC5C,IAAI,CAAC,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC;QAClC,IAAI,CAAC,aAAa,GAAG,cAAc,CAAC,aAAa,CAAC;QAClD,IAAI,CAAC,SAAS,GAAG,cAAc,CAAC,SAAS,CAAC;IAC5C,CAAC;CACF;AAfD,wCAeC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type LoggerContext = Record<string, any>;
|
|
2
|
+
export interface Logger {
|
|
3
|
+
trace(message: string, context?: LoggerContext): void;
|
|
4
|
+
debug(message: string, context?: LoggerContext): void;
|
|
5
|
+
info(message: string, context?: LoggerContext): void;
|
|
6
|
+
warn(message: string, context?: LoggerContext): void;
|
|
7
|
+
error(message: string, context?: LoggerContext): void;
|
|
8
|
+
log(record: LogRecord): void;
|
|
9
|
+
}
|
|
10
|
+
export declare enum LogLevel {
|
|
11
|
+
TRACE = "trace",
|
|
12
|
+
DEBUG = "debug",
|
|
13
|
+
INFO = "info",
|
|
14
|
+
WARN = "warn",
|
|
15
|
+
ERROR = "error"
|
|
16
|
+
}
|
|
17
|
+
export interface LogRecord {
|
|
18
|
+
level?: LogLevel;
|
|
19
|
+
message?: string;
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LogLevel = void 0;
|
|
4
|
+
var LogLevel;
|
|
5
|
+
(function (LogLevel) {
|
|
6
|
+
LogLevel["TRACE"] = "trace";
|
|
7
|
+
LogLevel["DEBUG"] = "debug";
|
|
8
|
+
LogLevel["INFO"] = "info";
|
|
9
|
+
LogLevel["WARN"] = "warn";
|
|
10
|
+
LogLevel["ERROR"] = "error";
|
|
11
|
+
})(LogLevel || (exports.LogLevel = LogLevel = {}));
|
|
12
|
+
//# sourceMappingURL=logger.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.types.js","sourceRoot":"","sources":["../../../../../internal-common/src/types/logger.types.ts"],"names":[],"mappings":";;;AAgBA,IAAY,QAMX;AAND,WAAY,QAAQ;IAClB,2BAAe,CAAA;IACf,2BAAe,CAAA;IACf,yBAAa,CAAA;IACb,yBAAa,CAAA;IACb,2BAAe,CAAA;AACjB,CAAC,EANW,QAAQ,wBAAR,QAAQ,QAMnB"}
|