@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,15 @@
|
|
|
1
|
+
import { ServiceFunctionName } from './public-types/bundle-data.types';
|
|
2
|
+
import { ExecuteFunctionAnnotationType, RunConfiguration, RunSecrets } from './public-types/backend-run.types';
|
|
3
|
+
import { Auth, RunContext } from './public-types/context.types';
|
|
4
|
+
export type SingleExecuteFunctionRequest = {
|
|
5
|
+
functionName: ServiceFunctionName;
|
|
6
|
+
params: Array<any>;
|
|
7
|
+
};
|
|
8
|
+
export interface BatchRunConfigurationRequest {
|
|
9
|
+
configuration: RunConfiguration;
|
|
10
|
+
context: RunContext;
|
|
11
|
+
auth: Auth | undefined;
|
|
12
|
+
requests: Array<SingleExecuteFunctionRequest>;
|
|
13
|
+
secrets?: RunSecrets;
|
|
14
|
+
executeFunctionAnnotationType: ExecuteFunctionAnnotationType;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-executor.types.js","sourceRoot":"","sources":["../../../../internal-common/src/code-executor.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { BatchRunConfigurationRequest } from './code-executor.types';
|
|
2
|
+
import { LocalBackendData } from './public-types/bundle-data.types';
|
|
3
|
+
import { RunSecrets } from './public-types/backend-run.types';
|
|
4
|
+
import { LogLevel } from './public-types/logger.types';
|
|
5
|
+
export type MessageFromDeveloperType = 'bundleData' | 'response';
|
|
6
|
+
interface BaseMessageFromDeveloper {
|
|
7
|
+
type: MessageFromDeveloperType;
|
|
8
|
+
payload?: unknown;
|
|
9
|
+
requestId: string;
|
|
10
|
+
}
|
|
11
|
+
export type MessageFromDeveloper = ResponseMessageFromDeveloper | BundleDataMessageFromDeveloper;
|
|
12
|
+
export interface ResponseMessageFromDeveloper extends BaseMessageFromDeveloper {
|
|
13
|
+
type: 'response';
|
|
14
|
+
payload: any;
|
|
15
|
+
}
|
|
16
|
+
export interface BundleDataMessageFromDeveloper extends BaseMessageFromDeveloper {
|
|
17
|
+
type: 'bundleData';
|
|
18
|
+
payload: LocalBackendData;
|
|
19
|
+
}
|
|
20
|
+
export type MessageToDeveloperType = 'executeFunction' | 'localBackendData' | 'logMessage';
|
|
21
|
+
interface BaseMessageToDeveloper {
|
|
22
|
+
type: MessageToDeveloperType;
|
|
23
|
+
payload: unknown;
|
|
24
|
+
requestId: string;
|
|
25
|
+
}
|
|
26
|
+
export type MessageToDeveloper = ExecuteFunctionMessageToDeveloper | LocalBackendDataMessageToDeveloper | LogMessageToDeveloper;
|
|
27
|
+
export interface ExecuteFunctionMessageToDeveloper extends BaseMessageToDeveloper {
|
|
28
|
+
type: 'executeFunction';
|
|
29
|
+
payload: BatchRunConfigurationRequest;
|
|
30
|
+
}
|
|
31
|
+
export interface LocalBackendDataMessageToDeveloper extends BaseMessageToDeveloper {
|
|
32
|
+
type: 'localBackendData';
|
|
33
|
+
payload: {
|
|
34
|
+
secrets: RunSecrets;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export interface LogMessageToDeveloper extends BaseMessageToDeveloper {
|
|
38
|
+
type: 'logMessage';
|
|
39
|
+
payload: LogRequest;
|
|
40
|
+
}
|
|
41
|
+
export declare enum LogType {
|
|
42
|
+
ALL = "ALL",
|
|
43
|
+
QUERY = "QUERY",
|
|
44
|
+
MUTATIONS = "MUTATIONS",
|
|
45
|
+
AI = "AI"
|
|
46
|
+
}
|
|
47
|
+
export interface LogRequest {
|
|
48
|
+
tag: string;
|
|
49
|
+
type: LogType;
|
|
50
|
+
timestamp: number;
|
|
51
|
+
level: LogLevel;
|
|
52
|
+
message: string;
|
|
53
|
+
}
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LogType = void 0;
|
|
4
|
+
var LogType;
|
|
5
|
+
(function (LogType) {
|
|
6
|
+
LogType["ALL"] = "ALL";
|
|
7
|
+
LogType["QUERY"] = "QUERY";
|
|
8
|
+
LogType["MUTATIONS"] = "MUTATIONS";
|
|
9
|
+
LogType["AI"] = "AI";
|
|
10
|
+
})(LogType || (exports.LogType = LogType = {}));
|
|
11
|
+
//# sourceMappingURL=local-dev.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-dev.types.js","sourceRoot":"","sources":["../../../../internal-common/src/local-dev.types.ts"],"names":[],"mappings":";;;AA8DA,IAAY,OAKX;AALD,WAAY,OAAO;IACjB,sBAAW,CAAA;IACX,0BAAe,CAAA;IACf,kCAAuB,CAAA;IACvB,oBAAS,CAAA;AACX,CAAC,EALW,OAAO,uBAAP,OAAO,QAKlB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const AI_MODEL_NAMES: readonly ["gpt-3.5-turbo", "gpt-3.5-turbo-1106", "gpt-4", "claude-2", "gpt-4-1106-preview"];
|
|
2
|
+
export type AiModelName = (typeof AI_MODEL_NAMES)[number];
|
|
3
|
+
export type ApiKeySource = 'user' | 'system';
|
|
4
|
+
export type AiChatbotContextType = 'text' | 'url' | 'file';
|
|
5
|
+
interface AiChatbotContextBase {
|
|
6
|
+
type: AiChatbotContextType;
|
|
7
|
+
data: string;
|
|
8
|
+
}
|
|
9
|
+
export interface AiChatbotTextContext extends AiChatbotContextBase {
|
|
10
|
+
type: 'text';
|
|
11
|
+
}
|
|
12
|
+
export interface AiChatbotUrlContext extends AiChatbotContextBase {
|
|
13
|
+
type: 'url';
|
|
14
|
+
}
|
|
15
|
+
export interface AiChatbotFileContext extends AiChatbotContextBase {
|
|
16
|
+
type: 'file';
|
|
17
|
+
}
|
|
18
|
+
export type AiChatbotContext = AiChatbotTextContext | AiChatbotUrlContext | AiChatbotFileContext;
|
|
19
|
+
export type OpenAiResponseFormat = 'text' | 'json_object';
|
|
20
|
+
export interface AiChatbotChatOptions {
|
|
21
|
+
maxTokens?: number;
|
|
22
|
+
chatId?: string;
|
|
23
|
+
disableHistory?: boolean;
|
|
24
|
+
includeReference?: boolean;
|
|
25
|
+
responseFormat?: OpenAiResponseFormat;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AI_MODEL_NAMES = void 0;
|
|
4
|
+
exports.AI_MODEL_NAMES = [
|
|
5
|
+
'gpt-3.5-turbo',
|
|
6
|
+
'gpt-3.5-turbo-1106',
|
|
7
|
+
'gpt-4',
|
|
8
|
+
'claude-2',
|
|
9
|
+
'gpt-4-1106-preview',
|
|
10
|
+
];
|
|
11
|
+
//# sourceMappingURL=ai-chatbot.public-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-chatbot.public-types.js","sourceRoot":"","sources":["../../../../../internal-common/src/public-types/ai-chatbot.public-types.ts"],"names":[],"mappings":";;;AACa,QAAA,cAAc,GAAG;IAC5B,eAAe;IACf,oBAAoB;IACpB,OAAO;IACP,UAAU;IACV,oBAAoB;CACZ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ApiHeaders, SecureApiRequest } from './api.types';
|
|
2
|
+
import { ApiEndpointId, HttpMethod } from './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/public-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 { IntegrationId } from './communication.types';
|
|
2
|
+
import { ApiEndpointId, HttpMethod } from './integrations/api.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/public-types/api.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { RunPermissions } from './backend-run.types';
|
|
2
|
+
import { ApplicationBundleData, ServiceFunctionName } from './bundle-data.types';
|
|
3
|
+
import { AppId, EnvironmentId, IntegrationId } from './communication.types';
|
|
4
|
+
import { CollectionName } from './document.types';
|
|
5
|
+
import { AuthIntegrationType, DatabaseIntegrationType, IntegrationConfig, IntegrationConfigTypes, IntegrationSchema, IntegrationSchemaKeys, IntegrationSchemaTypes, IntegrationTypeWithConfig } from './integrations/schemas';
|
|
6
|
+
import { IntegrationType } from './integration-types';
|
|
7
|
+
export type WebhookId = string;
|
|
8
|
+
export type TriggerId = string;
|
|
9
|
+
export type SchedulerId = string;
|
|
10
|
+
export type CronExpressionString = `${string} ${string} ${string} ${string} ${string}` | `${string} ${string} ${string} ${string}`;
|
|
11
|
+
export declare enum CronExpression {
|
|
12
|
+
EVERY_SECOND = "* * * * * *",
|
|
13
|
+
EVERY_5_SECONDS = "*/5 * * * * *",
|
|
14
|
+
EVERY_10_SECONDS = "*/10 * * * * *",
|
|
15
|
+
EVERY_30_SECONDS = "*/30 * * * * *",
|
|
16
|
+
EVERY_MINUTE = "*/1 * * * *",
|
|
17
|
+
EVERY_5_MINUTES = "0 */5 * * * *",
|
|
18
|
+
EVERY_10_MINUTES = "0 */10 * * * *",
|
|
19
|
+
EVERY_30_MINUTES = "0 */30 * * * *",
|
|
20
|
+
EVERY_HOUR = "0 0-23/1 * * *",
|
|
21
|
+
EVERY_2_HOURS = "0 0-23/2 * * *",
|
|
22
|
+
EVERY_3_HOURS = "0 0-23/3 * * *",
|
|
23
|
+
EVERY_4_HOURS = "0 0-23/4 * * *",
|
|
24
|
+
EVERY_5_HOURS = "0 0-23/5 * * *",
|
|
25
|
+
EVERY_6_HOURS = "0 0-23/6 * * *",
|
|
26
|
+
EVERY_7_HOURS = "0 0-23/7 * * *",
|
|
27
|
+
EVERY_8_HOURS = "0 0-23/8 * * *",
|
|
28
|
+
EVERY_9_HOURS = "0 0-23/9 * * *",
|
|
29
|
+
EVERY_10_HOURS = "0 0-23/10 * * *",
|
|
30
|
+
EVERY_11_HOURS = "0 0-23/11 * * *",
|
|
31
|
+
EVERY_12_HOURS = "0 0-23/12 * * *",
|
|
32
|
+
EVERY_DAY_AT_1AM = "0 01 * * *",
|
|
33
|
+
EVERY_DAY_AT_2AM = "0 02 * * *",
|
|
34
|
+
EVERY_DAY_AT_3AM = "0 03 * * *",
|
|
35
|
+
EVERY_DAY_AT_4AM = "0 04 * * *",
|
|
36
|
+
EVERY_DAY_AT_5AM = "0 05 * * *",
|
|
37
|
+
EVERY_DAY_AT_6AM = "0 06 * * *",
|
|
38
|
+
EVERY_DAY_AT_7AM = "0 07 * * *",
|
|
39
|
+
EVERY_DAY_AT_8AM = "0 08 * * *",
|
|
40
|
+
EVERY_DAY_AT_9AM = "0 09 * * *",
|
|
41
|
+
EVERY_DAY_AT_10AM = "0 10 * * *",
|
|
42
|
+
EVERY_DAY_AT_11AM = "0 11 * * *",
|
|
43
|
+
EVERY_DAY_AT_NOON = "0 12 * * *",
|
|
44
|
+
EVERY_DAY_AT_1PM = "0 13 * * *",
|
|
45
|
+
EVERY_DAY_AT_2PM = "0 14 * * *",
|
|
46
|
+
EVERY_DAY_AT_3PM = "0 15 * * *",
|
|
47
|
+
EVERY_DAY_AT_4PM = "0 16 * * *",
|
|
48
|
+
EVERY_DAY_AT_5PM = "0 17 * * *",
|
|
49
|
+
EVERY_DAY_AT_6PM = "0 18 * * *",
|
|
50
|
+
EVERY_DAY_AT_7PM = "0 19 * * *",
|
|
51
|
+
EVERY_DAY_AT_8PM = "0 20 * * *",
|
|
52
|
+
EVERY_DAY_AT_9PM = "0 21 * * *",
|
|
53
|
+
EVERY_DAY_AT_10PM = "0 22 * * *",
|
|
54
|
+
EVERY_DAY_AT_11PM = "0 23 * * *",
|
|
55
|
+
EVERY_DAY_AT_MIDNIGHT = "0 0 * * *",
|
|
56
|
+
EVERY_WEEK = "0 0 * * 7",
|
|
57
|
+
EVERY_WEEKDAY = "0 0 * * 1-5",
|
|
58
|
+
EVERY_WEEKEND = "0 0 * * 6,7",
|
|
59
|
+
EVERY_1ST_DAY_OF_MONTH_AT_MIDNIGHT = "0 0 1 * *",
|
|
60
|
+
EVERY_1ST_DAY_OF_MONTH_AT_NOON = "0 12 1 * *",
|
|
61
|
+
EVERY_2ND_HOUR = "0 */2 * * *",
|
|
62
|
+
EVERY_2ND_HOUR_FROM_1AM_THROUGH_11PM = "0 1-23/2 * * *",
|
|
63
|
+
EVERY_2ND_MONTH = "0 0 1 */2 *",
|
|
64
|
+
EVERY_QUARTER = "0 0 1 */3 *",
|
|
65
|
+
EVERY_6_MONTHS = "0 0 1 */6 *",
|
|
66
|
+
EVERY_YEAR = "0 0 1 1 *",
|
|
67
|
+
EVERY_30_MINUTES_BETWEEN_9AM_AND_5PM = "0 */30 9-17 * * *",
|
|
68
|
+
EVERY_30_MINUTES_BETWEEN_9AM_AND_6PM = "0 */30 9-18 * * *",
|
|
69
|
+
EVERY_30_MINUTES_BETWEEN_10AM_AND_7PM = "0 */30 10-19 * * *",
|
|
70
|
+
MONDAY_TO_FRIDAY_AT_1AM = "0 0 01 * * 1-5",
|
|
71
|
+
MONDAY_TO_FRIDAY_AT_2AM = "0 0 02 * * 1-5",
|
|
72
|
+
MONDAY_TO_FRIDAY_AT_3AM = "0 0 03 * * 1-5",
|
|
73
|
+
MONDAY_TO_FRIDAY_AT_4AM = "0 0 04 * * 1-5",
|
|
74
|
+
MONDAY_TO_FRIDAY_AT_5AM = "0 0 05 * * 1-5",
|
|
75
|
+
MONDAY_TO_FRIDAY_AT_6AM = "0 0 06 * * 1-5",
|
|
76
|
+
MONDAY_TO_FRIDAY_AT_7AM = "0 0 07 * * 1-5",
|
|
77
|
+
MONDAY_TO_FRIDAY_AT_8AM = "0 0 08 * * 1-5",
|
|
78
|
+
MONDAY_TO_FRIDAY_AT_9AM = "0 0 09 * * 1-5",
|
|
79
|
+
MONDAY_TO_FRIDAY_AT_09_30AM = "0 30 09 * * 1-5",
|
|
80
|
+
MONDAY_TO_FRIDAY_AT_10AM = "0 0 10 * * 1-5",
|
|
81
|
+
MONDAY_TO_FRIDAY_AT_11AM = "0 0 11 * * 1-5",
|
|
82
|
+
MONDAY_TO_FRIDAY_AT_11_30AM = "0 30 11 * * 1-5",
|
|
83
|
+
MONDAY_TO_FRIDAY_AT_12PM = "0 0 12 * * 1-5",
|
|
84
|
+
MONDAY_TO_FRIDAY_AT_1PM = "0 0 13 * * 1-5",
|
|
85
|
+
MONDAY_TO_FRIDAY_AT_2PM = "0 0 14 * * 1-5",
|
|
86
|
+
MONDAY_TO_FRIDAY_AT_3PM = "0 0 15 * * 1-5",
|
|
87
|
+
MONDAY_TO_FRIDAY_AT_4PM = "0 0 16 * * 1-5",
|
|
88
|
+
MONDAY_TO_FRIDAY_AT_5PM = "0 0 17 * * 1-5",
|
|
89
|
+
MONDAY_TO_FRIDAY_AT_6PM = "0 0 18 * * 1-5",
|
|
90
|
+
MONDAY_TO_FRIDAY_AT_7PM = "0 0 19 * * 1-5",
|
|
91
|
+
MONDAY_TO_FRIDAY_AT_8PM = "0 0 20 * * 1-5",
|
|
92
|
+
MONDAY_TO_FRIDAY_AT_9PM = "0 0 21 * * 1-5",
|
|
93
|
+
MONDAY_TO_FRIDAY_AT_10PM = "0 0 22 * * 1-5",
|
|
94
|
+
MONDAY_TO_FRIDAY_AT_11PM = "0 0 23 * * 1-5"
|
|
95
|
+
}
|
|
96
|
+
export type OpenIdProviderType = 'auth0';
|
|
97
|
+
export type CodeUrl = string;
|
|
98
|
+
export interface TriggerConfig {
|
|
99
|
+
integrationId: IntegrationId;
|
|
100
|
+
collectionName: CollectionName;
|
|
101
|
+
functionName: ServiceFunctionName;
|
|
102
|
+
}
|
|
103
|
+
export interface SchedulerConfig {
|
|
104
|
+
functionName: ServiceFunctionName;
|
|
105
|
+
cronExpression: string;
|
|
106
|
+
exclusive: boolean;
|
|
107
|
+
}
|
|
108
|
+
export interface WebhookConfig {
|
|
109
|
+
functionName: ServiceFunctionName;
|
|
110
|
+
}
|
|
111
|
+
export interface OpenIdProvider {
|
|
112
|
+
providerType: OpenIdProviderType;
|
|
113
|
+
clientId: string;
|
|
114
|
+
domain: string;
|
|
115
|
+
}
|
|
116
|
+
export interface Application {
|
|
117
|
+
appId: AppId;
|
|
118
|
+
organizationId: string;
|
|
119
|
+
creationDate: Date;
|
|
120
|
+
updateDate: Date;
|
|
121
|
+
allowedHosts: string[];
|
|
122
|
+
openIdProvider?: OpenIdProvider;
|
|
123
|
+
integrations: Record<IntegrationId, IntegrationConfig>;
|
|
124
|
+
codeUrl?: string;
|
|
125
|
+
bundleMetadata?: ApplicationBundleData;
|
|
126
|
+
archiveDate?: Date;
|
|
127
|
+
}
|
|
128
|
+
export interface Schema<T extends IntegrationSchema = any> {
|
|
129
|
+
appId: AppId;
|
|
130
|
+
integrationId: IntegrationId;
|
|
131
|
+
schema: T;
|
|
132
|
+
createdAt: Date;
|
|
133
|
+
updatedAt: Date;
|
|
134
|
+
}
|
|
135
|
+
export interface ApplicationInitDetails {
|
|
136
|
+
codeUrl: string;
|
|
137
|
+
codeUrlId: string;
|
|
138
|
+
permissions: RunPermissions;
|
|
139
|
+
}
|
|
140
|
+
export interface UpdateOpenIdProviderRequest {
|
|
141
|
+
openIdProvider: OpenIdProvider;
|
|
142
|
+
}
|
|
143
|
+
export interface CreateApplicationRequest {
|
|
144
|
+
organizationId: string;
|
|
145
|
+
}
|
|
146
|
+
export interface CreateApplicationResponse {
|
|
147
|
+
appId: AppId;
|
|
148
|
+
}
|
|
149
|
+
export interface DeleteIntegrationRequest {
|
|
150
|
+
integrationId: IntegrationId;
|
|
151
|
+
}
|
|
152
|
+
export interface UpdateAllowedHostsRequest {
|
|
153
|
+
allowedHosts: string[];
|
|
154
|
+
}
|
|
155
|
+
export interface CreateEnvironmentRequest {
|
|
156
|
+
sourceAppId: AppId;
|
|
157
|
+
environmentId: EnvironmentId;
|
|
158
|
+
}
|
|
159
|
+
export interface UpdateApplicationCodeRequest {
|
|
160
|
+
appId: AppId;
|
|
161
|
+
openApiSpecStr?: string;
|
|
162
|
+
openApiControllersStr?: string;
|
|
163
|
+
}
|
|
164
|
+
interface BaseUpsertIntegrationRequest<T extends IntegrationTypeWithConfig, C extends IntegrationConfig> {
|
|
165
|
+
id: IntegrationId;
|
|
166
|
+
type: T;
|
|
167
|
+
config: Partial<C>;
|
|
168
|
+
}
|
|
169
|
+
type ConfigurationTypes = {
|
|
170
|
+
[K in IntegrationTypeWithConfig]: IntegrationConfigTypes[K];
|
|
171
|
+
};
|
|
172
|
+
type UpsertIntegrationRequests = {
|
|
173
|
+
[K in IntegrationTypeWithConfig]: BaseUpsertIntegrationRequest<K, ConfigurationTypes[K]>;
|
|
174
|
+
};
|
|
175
|
+
export type UpsertIntegrationRequest = UpsertDataIntegrationRequest | UpsertGraphQLIntegrationRequest | UpsertApiIntegrationRequest | UpsertAiChatbotIntegrationRequest | UpsertConfluentIntegrationRequest | UpsertKafkaIntegrationRequest | UpsertAuthIntegrationRequest;
|
|
176
|
+
export type UpsertDataIntegrationRequest = UpsertIntegrationRequests[DatabaseIntegrationType];
|
|
177
|
+
export type UpsertGraphQLIntegrationRequest = UpsertIntegrationRequests[IntegrationType.graphql];
|
|
178
|
+
export type UpsertApiIntegrationRequest = UpsertIntegrationRequests[IntegrationType.api];
|
|
179
|
+
export type UpsertAiChatbotIntegrationRequest = UpsertIntegrationRequests[IntegrationType.ai_chatbot];
|
|
180
|
+
export type UpsertKafkaIntegrationRequest = UpsertIntegrationRequests[IntegrationType.kafka];
|
|
181
|
+
export type UpsertConfluentIntegrationRequest = UpsertIntegrationRequests[IntegrationType.confluent];
|
|
182
|
+
export type UpsertAuthIntegrationRequest = UpsertIntegrationRequests[AuthIntegrationType];
|
|
183
|
+
interface BaseUpsertIntegrationSchemaRequest<T extends IntegrationType, S extends IntegrationSchema> {
|
|
184
|
+
id: IntegrationId;
|
|
185
|
+
type: T;
|
|
186
|
+
schema: S;
|
|
187
|
+
}
|
|
188
|
+
type SchemaTypes = {
|
|
189
|
+
[K in IntegrationSchemaKeys]: IntegrationSchemaTypes[K];
|
|
190
|
+
};
|
|
191
|
+
type UpsertIntegrationSchemaRequests = {
|
|
192
|
+
[K in IntegrationSchemaKeys]: BaseUpsertIntegrationSchemaRequest<K, SchemaTypes[K]>;
|
|
193
|
+
};
|
|
194
|
+
export type UpsertIntegrationSchemaRequest = UpsertDataIntegrationSchemaRequest | UpsertGraphQLIntegrationSchemaRequest | UpsertApiIntegrationSchemaRequest;
|
|
195
|
+
export type UpsertDataIntegrationSchemaRequest = UpsertIntegrationSchemaRequests[DatabaseIntegrationType];
|
|
196
|
+
export type UpsertGraphQLIntegrationSchemaRequest = UpsertIntegrationSchemaRequests[IntegrationType.graphql];
|
|
197
|
+
export type UpsertApiIntegrationSchemaRequest = UpsertIntegrationSchemaRequests[IntegrationType.api];
|
|
198
|
+
export interface GetSchemaRequest {
|
|
199
|
+
integrationId: IntegrationId;
|
|
200
|
+
}
|
|
201
|
+
export {};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CronExpression = void 0;
|
|
4
|
+
var CronExpression;
|
|
5
|
+
(function (CronExpression) {
|
|
6
|
+
CronExpression["EVERY_SECOND"] = "* * * * * *";
|
|
7
|
+
CronExpression["EVERY_5_SECONDS"] = "*/5 * * * * *";
|
|
8
|
+
CronExpression["EVERY_10_SECONDS"] = "*/10 * * * * *";
|
|
9
|
+
CronExpression["EVERY_30_SECONDS"] = "*/30 * * * * *";
|
|
10
|
+
CronExpression["EVERY_MINUTE"] = "*/1 * * * *";
|
|
11
|
+
CronExpression["EVERY_5_MINUTES"] = "0 */5 * * * *";
|
|
12
|
+
CronExpression["EVERY_10_MINUTES"] = "0 */10 * * * *";
|
|
13
|
+
CronExpression["EVERY_30_MINUTES"] = "0 */30 * * * *";
|
|
14
|
+
CronExpression["EVERY_HOUR"] = "0 0-23/1 * * *";
|
|
15
|
+
CronExpression["EVERY_2_HOURS"] = "0 0-23/2 * * *";
|
|
16
|
+
CronExpression["EVERY_3_HOURS"] = "0 0-23/3 * * *";
|
|
17
|
+
CronExpression["EVERY_4_HOURS"] = "0 0-23/4 * * *";
|
|
18
|
+
CronExpression["EVERY_5_HOURS"] = "0 0-23/5 * * *";
|
|
19
|
+
CronExpression["EVERY_6_HOURS"] = "0 0-23/6 * * *";
|
|
20
|
+
CronExpression["EVERY_7_HOURS"] = "0 0-23/7 * * *";
|
|
21
|
+
CronExpression["EVERY_8_HOURS"] = "0 0-23/8 * * *";
|
|
22
|
+
CronExpression["EVERY_9_HOURS"] = "0 0-23/9 * * *";
|
|
23
|
+
CronExpression["EVERY_10_HOURS"] = "0 0-23/10 * * *";
|
|
24
|
+
CronExpression["EVERY_11_HOURS"] = "0 0-23/11 * * *";
|
|
25
|
+
CronExpression["EVERY_12_HOURS"] = "0 0-23/12 * * *";
|
|
26
|
+
CronExpression["EVERY_DAY_AT_1AM"] = "0 01 * * *";
|
|
27
|
+
CronExpression["EVERY_DAY_AT_2AM"] = "0 02 * * *";
|
|
28
|
+
CronExpression["EVERY_DAY_AT_3AM"] = "0 03 * * *";
|
|
29
|
+
CronExpression["EVERY_DAY_AT_4AM"] = "0 04 * * *";
|
|
30
|
+
CronExpression["EVERY_DAY_AT_5AM"] = "0 05 * * *";
|
|
31
|
+
CronExpression["EVERY_DAY_AT_6AM"] = "0 06 * * *";
|
|
32
|
+
CronExpression["EVERY_DAY_AT_7AM"] = "0 07 * * *";
|
|
33
|
+
CronExpression["EVERY_DAY_AT_8AM"] = "0 08 * * *";
|
|
34
|
+
CronExpression["EVERY_DAY_AT_9AM"] = "0 09 * * *";
|
|
35
|
+
CronExpression["EVERY_DAY_AT_10AM"] = "0 10 * * *";
|
|
36
|
+
CronExpression["EVERY_DAY_AT_11AM"] = "0 11 * * *";
|
|
37
|
+
CronExpression["EVERY_DAY_AT_NOON"] = "0 12 * * *";
|
|
38
|
+
CronExpression["EVERY_DAY_AT_1PM"] = "0 13 * * *";
|
|
39
|
+
CronExpression["EVERY_DAY_AT_2PM"] = "0 14 * * *";
|
|
40
|
+
CronExpression["EVERY_DAY_AT_3PM"] = "0 15 * * *";
|
|
41
|
+
CronExpression["EVERY_DAY_AT_4PM"] = "0 16 * * *";
|
|
42
|
+
CronExpression["EVERY_DAY_AT_5PM"] = "0 17 * * *";
|
|
43
|
+
CronExpression["EVERY_DAY_AT_6PM"] = "0 18 * * *";
|
|
44
|
+
CronExpression["EVERY_DAY_AT_7PM"] = "0 19 * * *";
|
|
45
|
+
CronExpression["EVERY_DAY_AT_8PM"] = "0 20 * * *";
|
|
46
|
+
CronExpression["EVERY_DAY_AT_9PM"] = "0 21 * * *";
|
|
47
|
+
CronExpression["EVERY_DAY_AT_10PM"] = "0 22 * * *";
|
|
48
|
+
CronExpression["EVERY_DAY_AT_11PM"] = "0 23 * * *";
|
|
49
|
+
CronExpression["EVERY_DAY_AT_MIDNIGHT"] = "0 0 * * *";
|
|
50
|
+
CronExpression["EVERY_WEEK"] = "0 0 * * 7";
|
|
51
|
+
CronExpression["EVERY_WEEKDAY"] = "0 0 * * 1-5";
|
|
52
|
+
CronExpression["EVERY_WEEKEND"] = "0 0 * * 6,7";
|
|
53
|
+
CronExpression["EVERY_1ST_DAY_OF_MONTH_AT_MIDNIGHT"] = "0 0 1 * *";
|
|
54
|
+
CronExpression["EVERY_1ST_DAY_OF_MONTH_AT_NOON"] = "0 12 1 * *";
|
|
55
|
+
CronExpression["EVERY_2ND_HOUR"] = "0 */2 * * *";
|
|
56
|
+
CronExpression["EVERY_2ND_HOUR_FROM_1AM_THROUGH_11PM"] = "0 1-23/2 * * *";
|
|
57
|
+
CronExpression["EVERY_2ND_MONTH"] = "0 0 1 */2 *";
|
|
58
|
+
CronExpression["EVERY_QUARTER"] = "0 0 1 */3 *";
|
|
59
|
+
CronExpression["EVERY_6_MONTHS"] = "0 0 1 */6 *";
|
|
60
|
+
CronExpression["EVERY_YEAR"] = "0 0 1 1 *";
|
|
61
|
+
CronExpression["EVERY_30_MINUTES_BETWEEN_9AM_AND_5PM"] = "0 */30 9-17 * * *";
|
|
62
|
+
CronExpression["EVERY_30_MINUTES_BETWEEN_9AM_AND_6PM"] = "0 */30 9-18 * * *";
|
|
63
|
+
CronExpression["EVERY_30_MINUTES_BETWEEN_10AM_AND_7PM"] = "0 */30 10-19 * * *";
|
|
64
|
+
CronExpression["MONDAY_TO_FRIDAY_AT_1AM"] = "0 0 01 * * 1-5";
|
|
65
|
+
CronExpression["MONDAY_TO_FRIDAY_AT_2AM"] = "0 0 02 * * 1-5";
|
|
66
|
+
CronExpression["MONDAY_TO_FRIDAY_AT_3AM"] = "0 0 03 * * 1-5";
|
|
67
|
+
CronExpression["MONDAY_TO_FRIDAY_AT_4AM"] = "0 0 04 * * 1-5";
|
|
68
|
+
CronExpression["MONDAY_TO_FRIDAY_AT_5AM"] = "0 0 05 * * 1-5";
|
|
69
|
+
CronExpression["MONDAY_TO_FRIDAY_AT_6AM"] = "0 0 06 * * 1-5";
|
|
70
|
+
CronExpression["MONDAY_TO_FRIDAY_AT_7AM"] = "0 0 07 * * 1-5";
|
|
71
|
+
CronExpression["MONDAY_TO_FRIDAY_AT_8AM"] = "0 0 08 * * 1-5";
|
|
72
|
+
CronExpression["MONDAY_TO_FRIDAY_AT_9AM"] = "0 0 09 * * 1-5";
|
|
73
|
+
CronExpression["MONDAY_TO_FRIDAY_AT_09_30AM"] = "0 30 09 * * 1-5";
|
|
74
|
+
CronExpression["MONDAY_TO_FRIDAY_AT_10AM"] = "0 0 10 * * 1-5";
|
|
75
|
+
CronExpression["MONDAY_TO_FRIDAY_AT_11AM"] = "0 0 11 * * 1-5";
|
|
76
|
+
CronExpression["MONDAY_TO_FRIDAY_AT_11_30AM"] = "0 30 11 * * 1-5";
|
|
77
|
+
CronExpression["MONDAY_TO_FRIDAY_AT_12PM"] = "0 0 12 * * 1-5";
|
|
78
|
+
CronExpression["MONDAY_TO_FRIDAY_AT_1PM"] = "0 0 13 * * 1-5";
|
|
79
|
+
CronExpression["MONDAY_TO_FRIDAY_AT_2PM"] = "0 0 14 * * 1-5";
|
|
80
|
+
CronExpression["MONDAY_TO_FRIDAY_AT_3PM"] = "0 0 15 * * 1-5";
|
|
81
|
+
CronExpression["MONDAY_TO_FRIDAY_AT_4PM"] = "0 0 16 * * 1-5";
|
|
82
|
+
CronExpression["MONDAY_TO_FRIDAY_AT_5PM"] = "0 0 17 * * 1-5";
|
|
83
|
+
CronExpression["MONDAY_TO_FRIDAY_AT_6PM"] = "0 0 18 * * 1-5";
|
|
84
|
+
CronExpression["MONDAY_TO_FRIDAY_AT_7PM"] = "0 0 19 * * 1-5";
|
|
85
|
+
CronExpression["MONDAY_TO_FRIDAY_AT_8PM"] = "0 0 20 * * 1-5";
|
|
86
|
+
CronExpression["MONDAY_TO_FRIDAY_AT_9PM"] = "0 0 21 * * 1-5";
|
|
87
|
+
CronExpression["MONDAY_TO_FRIDAY_AT_10PM"] = "0 0 22 * * 1-5";
|
|
88
|
+
CronExpression["MONDAY_TO_FRIDAY_AT_11PM"] = "0 0 23 * * 1-5";
|
|
89
|
+
})(CronExpression || (exports.CronExpression = CronExpression = {}));
|
|
90
|
+
//# sourceMappingURL=application.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application.types.js","sourceRoot":"","sources":["../../../../../internal-common/src/public-types/application.types.ts"],"names":[],"mappings":";;;AA+BA,IAAY,cAoFX;AApFD,WAAY,cAAc;IACxB,8CAA4B,CAAA;IAC5B,mDAAiC,CAAA;IACjC,qDAAmC,CAAA;IACnC,qDAAmC,CAAA;IACnC,8CAA4B,CAAA;IAC5B,mDAAiC,CAAA;IACjC,qDAAmC,CAAA;IACnC,qDAAmC,CAAA;IACnC,+CAA6B,CAAA;IAC7B,kDAAgC,CAAA;IAChC,kDAAgC,CAAA;IAChC,kDAAgC,CAAA;IAChC,kDAAgC,CAAA;IAChC,kDAAgC,CAAA;IAChC,kDAAgC,CAAA;IAChC,kDAAgC,CAAA;IAChC,kDAAgC,CAAA;IAChC,oDAAkC,CAAA;IAClC,oDAAkC,CAAA;IAClC,oDAAkC,CAAA;IAClC,iDAA+B,CAAA;IAC/B,iDAA+B,CAAA;IAC/B,iDAA+B,CAAA;IAC/B,iDAA+B,CAAA;IAC/B,iDAA+B,CAAA;IAC/B,iDAA+B,CAAA;IAC/B,iDAA+B,CAAA;IAC/B,iDAA+B,CAAA;IAC/B,iDAA+B,CAAA;IAC/B,kDAAgC,CAAA;IAChC,kDAAgC,CAAA;IAChC,kDAAgC,CAAA;IAChC,iDAA+B,CAAA;IAC/B,iDAA+B,CAAA;IAC/B,iDAA+B,CAAA;IAC/B,iDAA+B,CAAA;IAC/B,iDAA+B,CAAA;IAC/B,iDAA+B,CAAA;IAC/B,iDAA+B,CAAA;IAC/B,iDAA+B,CAAA;IAC/B,iDAA+B,CAAA;IAC/B,kDAAgC,CAAA;IAChC,kDAAgC,CAAA;IAChC,qDAAmC,CAAA;IACnC,0CAAwB,CAAA;IACxB,+CAA6B,CAAA;IAC7B,+CAA6B,CAAA;IAC7B,kEAAgD,CAAA;IAChD,+DAA6C,CAAA;IAC7C,gDAA8B,CAAA;IAC9B,yEAAuD,CAAA;IACvD,iDAA+B,CAAA;IAC/B,+CAA6B,CAAA;IAC7B,gDAA8B,CAAA;IAC9B,0CAAwB,CAAA;IACxB,4EAA0D,CAAA;IAC1D,4EAA0D,CAAA;IAC1D,8EAA4D,CAAA;IAC5D,4DAA0C,CAAA;IAC1C,4DAA0C,CAAA;IAC1C,4DAA0C,CAAA;IAC1C,4DAA0C,CAAA;IAC1C,4DAA0C,CAAA;IAC1C,4DAA0C,CAAA;IAC1C,4DAA0C,CAAA;IAC1C,4DAA0C,CAAA;IAC1C,4DAA0C,CAAA;IAC1C,iEAA+C,CAAA;IAC/C,6DAA2C,CAAA;IAC3C,6DAA2C,CAAA;IAC3C,iEAA+C,CAAA;IAC/C,6DAA2C,CAAA;IAC3C,4DAA0C,CAAA;IAC1C,4DAA0C,CAAA;IAC1C,4DAA0C,CAAA;IAC1C,4DAA0C,CAAA;IAC1C,4DAA0C,CAAA;IAC1C,4DAA0C,CAAA;IAC1C,4DAA0C,CAAA;IAC1C,4DAA0C,CAAA;IAC1C,4DAA0C,CAAA;IAC1C,6DAA2C,CAAA;IAC3C,6DAA2C,CAAA;AAC7C,CAAC,EApFW,cAAc,8BAAd,cAAc,QAoFzB"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Auth, RunContext } from './context.types';
|
|
2
|
+
import { ApplicationSecrets, SecretKey, SecretValue } from './secret.types';
|
|
3
|
+
export interface RunPermissions {
|
|
4
|
+
hosts: Array<string>;
|
|
5
|
+
}
|
|
6
|
+
export interface ErrorResponse extends GeneralResponse {
|
|
7
|
+
ok: false;
|
|
8
|
+
error: string;
|
|
9
|
+
details?: string;
|
|
10
|
+
functionName: string;
|
|
11
|
+
}
|
|
12
|
+
export interface GeneralResponse {
|
|
13
|
+
ok: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface RunConfiguration {
|
|
16
|
+
codeUrl: string;
|
|
17
|
+
codeUrlId: string;
|
|
18
|
+
isSecurityRules: boolean;
|
|
19
|
+
permissions: RunPermissions;
|
|
20
|
+
}
|
|
21
|
+
export interface LoadJsPayload {
|
|
22
|
+
codeUrl: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const ExecuteFunctionSecureAnnotations: readonly ["secureDistributedLock", "secureQuery", "secureMutation", "secureNamedQuery", "secureNativeQuery", "secureGraphQL", "secureApi", "secureAiChatbotChat", "secureAiChatbotMutation", "secureQueueWrite", "secureQueueRead"];
|
|
25
|
+
export type ExecuteFunctionSecureAnnotationType = (typeof ExecuteFunctionSecureAnnotations)[number];
|
|
26
|
+
export type ExecuteFunctionAnnotationType = 'executable' | 'webhook' | 'scheduler' | 'trigger' | 'transformRead' | 'transformWrite' | 'metadata' | 'aiFunction' | 'openapi' | ExecuteFunctionSecureAnnotationType;
|
|
27
|
+
export interface ExecuteFunctionPayload {
|
|
28
|
+
functionName: string;
|
|
29
|
+
params: Array<unknown>;
|
|
30
|
+
context: RunContext;
|
|
31
|
+
auth: Auth | undefined;
|
|
32
|
+
secrets?: Record<SecretKey, SecretValue>;
|
|
33
|
+
backendApiKey: string;
|
|
34
|
+
codeDir: string;
|
|
35
|
+
executeFunctionAnnotationType: ExecuteFunctionAnnotationType;
|
|
36
|
+
}
|
|
37
|
+
export type WorkerActionType = 'loadJs' | 'executeFunction' | 'ping' | 'terminate' | 'heartbeat';
|
|
38
|
+
export interface ActionRequest {
|
|
39
|
+
action: WorkerActionType;
|
|
40
|
+
payload?: LoadJsPayload | ExecuteFunctionPayload;
|
|
41
|
+
}
|
|
42
|
+
export type LoadJsResponse = GeneralResponse;
|
|
43
|
+
export type TerminateResponse = GeneralResponse;
|
|
44
|
+
export interface ExecuteFunctionResponse extends GeneralResponse {
|
|
45
|
+
ok: true;
|
|
46
|
+
functionResponse: unknown;
|
|
47
|
+
}
|
|
48
|
+
export interface RunSecrets {
|
|
49
|
+
custom: Record<SecretKey, SecretValue>;
|
|
50
|
+
backendApiKey: string;
|
|
51
|
+
}
|
|
52
|
+
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/public-types/backend-run.types.ts"],"names":[],"mappings":";;;AACA,iDAA6F;AAC7F,uCAAkC;AAkCrB,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,55 @@
|
|
|
1
|
+
import { MutationContext } from './mutation.context';
|
|
2
|
+
import { ApiCallContext } from './api-call.context';
|
|
3
|
+
import { GraphqlContext } from './graphql.context';
|
|
4
|
+
import { DistributedLockContext } from './distributed-lock.context';
|
|
5
|
+
import { NativeQueryContext } from './native-query.context';
|
|
6
|
+
import { QueryContext } from './query-context';
|
|
7
|
+
import { AiChatbotActionType, DatabaseActionType, TopicActionType } from './bundle-data.types';
|
|
8
|
+
import { ClientId } from './communication.types';
|
|
9
|
+
import { DocumentData, SquidDocId } from './document.types';
|
|
10
|
+
import { MutationType } from './mutation.types';
|
|
11
|
+
import { ClientConnectionState } from './socket.types';
|
|
12
|
+
import { TopicReadContext, TopicWriteContext } from './topic.context';
|
|
13
|
+
import { AiChatbotChatContext, AiChatbotMutationContext } from '../types/ai-chatbot.context';
|
|
14
|
+
export type SecureDatabaseAction<T extends DatabaseActionType> = T extends 'all' ? () => boolean | Promise<boolean> : T extends 'read' ? ((context: QueryContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>) : ((context: MutationContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
|
|
15
|
+
export type SecureTopicAction<T extends TopicActionType> = T extends 'all' ? () => boolean | Promise<boolean> : T extends 'read' ? ((context: TopicReadContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>) : ((context: TopicWriteContext<T>) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
|
|
16
|
+
export type SecureApiAction = ((context: ApiCallContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
|
|
17
|
+
export type SecureNativeQueryAction = ((context: NativeQueryContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
|
|
18
|
+
export type SecureDistributedLockAction = ((context: DistributedLockContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
|
|
19
|
+
export type SecureGraphQLAction = ((context: GraphqlContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
|
|
20
|
+
export type SecureAiChatbotAction<T extends AiChatbotActionType> = T extends 'all' ? () => boolean | Promise<boolean> : T extends 'chat' ? ((context: AiChatbotChatContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>) : ((context: AiChatbotMutationContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
|
|
21
|
+
export type ClientConnectionStateChangeAction = (clientId: ClientId, clientConnectionState: ClientConnectionState) => Promise<void> | void;
|
|
22
|
+
export type ExecutableAction = (...args: any[]) => any;
|
|
23
|
+
export type AiFunctionAction<T extends Record<string, any> = any> = (params: T) => any;
|
|
24
|
+
export type TriggerAction = ((request: TriggerRequest) => void | Promise<void>) | (() => void | Promise<void>);
|
|
25
|
+
export interface TriggerRequest<T extends DocumentData = any> {
|
|
26
|
+
squidDocId: SquidDocId;
|
|
27
|
+
mutationType: MutationType;
|
|
28
|
+
docBefore?: T;
|
|
29
|
+
docAfter?: T;
|
|
30
|
+
}
|
|
31
|
+
export type SchedulerAction = () => void | Promise<void>;
|
|
32
|
+
export type WebhookAction = ((request: WebhookRequest) => any) | (() => any);
|
|
33
|
+
export interface WebhookRequest<T = any> {
|
|
34
|
+
body: T;
|
|
35
|
+
rawBody?: string;
|
|
36
|
+
queryParams: Record<string, string>;
|
|
37
|
+
headers: Record<string, string>;
|
|
38
|
+
httpMethod: 'post' | 'get' | 'put' | 'delete';
|
|
39
|
+
files?: Array<SquidFile>;
|
|
40
|
+
}
|
|
41
|
+
export interface WebhookResponse {
|
|
42
|
+
headers: Record<string, any>;
|
|
43
|
+
body: any;
|
|
44
|
+
statusCode: number;
|
|
45
|
+
__isWebhookResponse__: true;
|
|
46
|
+
}
|
|
47
|
+
export interface SquidFile {
|
|
48
|
+
data: Uint8Array;
|
|
49
|
+
fieldName: string;
|
|
50
|
+
mimetype: string;
|
|
51
|
+
originalName: string;
|
|
52
|
+
size: number;
|
|
53
|
+
encoding?: string;
|
|
54
|
+
}
|
|
55
|
+
export type ActionMethodDecorator<U> = <T extends U>(target: Object, propertyName: string, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T>;
|