@squidcloud/local-backend 1.0.338 → 1.0.340
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 +1 -1
- package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +24 -96
- package/dist/internal-common/src/public-types/ai-agent.public-types.js +1 -61
- package/dist/internal-common/src/public-types/ai-agent.public-types.js.map +1 -1
- package/dist/internal-common/src/public-types/backend.public-types.d.ts +8 -0
- package/dist/internal-common/src/{public-types-backend/ai-chatbot.public-context.js → public-types/backend.public-types.js} +1 -1
- package/dist/internal-common/src/public-types/backend.public-types.js.map +1 -0
- package/dist/internal-common/src/public-types/communication.public-types.js.map +1 -1
- package/dist/internal-common/src/public-types/document.public-types.d.ts +0 -4
- package/dist/internal-common/src/public-types/integration.public-types.js.map +1 -1
- package/dist/internal-common/src/public-types/integrations/api.public-types.d.ts +0 -11
- package/dist/internal-common/src/public-types/integrations/api.public-types.js.map +1 -1
- package/dist/internal-common/src/public-types/query.public-types.d.ts +0 -1
- package/dist/internal-common/src/public-types/query.public-types.js +0 -4
- package/dist/internal-common/src/public-types/query.public-types.js.map +1 -1
- package/dist/internal-common/src/public-types/scheduler.public-types.d.ts +1 -4
- package/dist/internal-common/src/public-types/secret.public-types.d.ts +0 -4
- package/dist/internal-common/src/public-types/typescript.public-types.d.ts +0 -3
- package/dist/internal-common/src/public-types-backend/{ai-chatbot.public-context.d.ts → ai-agent.public-context.d.ts} +5 -0
- package/dist/internal-common/src/public-types-backend/ai-agent.public-context.js +11 -0
- package/dist/internal-common/src/public-types-backend/ai-agent.public-context.js.map +1 -0
- package/dist/internal-common/src/public-types-backend/application.public-types.js.map +1 -0
- package/dist/internal-common/src/public-types-backend/bundle-api.public-types.d.ts +5 -7
- package/dist/internal-common/src/{public-types → public-types-backend}/bundle-data.public-types.d.ts +1 -9
- package/dist/internal-common/src/public-types-backend/bundle-data.public-types.js.map +1 -0
- package/dist/internal-common/src/public-types-backend/mutation.public-context.d.ts +49 -2
- package/dist/internal-common/src/public-types-backend/mutation.public-context.js +2 -1
- package/dist/internal-common/src/public-types-backend/mutation.public-context.js.map +1 -1
- package/dist/internal-common/src/public-types-backend/query.public-context.js +2 -3
- package/dist/internal-common/src/public-types-backend/query.public-context.js.map +1 -1
- package/dist/internal-common/src/{public-types → public-types-backend}/storage.types.d.ts +1 -1
- package/dist/internal-common/src/public-types-backend/storage.types.js.map +1 -0
- package/dist/internal-common/src/types/ai-agent.types.d.ts +78 -1
- package/dist/internal-common/src/types/ai-agent.types.js +52 -0
- package/dist/internal-common/src/types/ai-agent.types.js.map +1 -1
- package/dist/internal-common/src/types/api.types.d.ts +11 -1
- package/dist/internal-common/src/types/application.types.d.ts +2 -2
- package/dist/internal-common/src/types/backend-run.types.d.ts +1 -1
- package/dist/internal-common/src/types/bundle-data.types.d.ts +3 -2
- package/dist/internal-common/src/types/query.types.d.ts +2 -1
- package/dist/internal-common/src/types/query.types.js +4 -0
- package/dist/internal-common/src/types/query.types.js.map +1 -1
- package/dist/internal-common/src/utils/backend-transforms.js +2 -2
- package/dist/internal-common/src/utils/backend-transforms.js.map +1 -1
- package/dist/internal-common/src/utils/squid-code-bundle.utils.d.ts +10 -0
- package/dist/internal-common/src/utils/squid-code-bundle.utils.js +106 -0
- package/dist/internal-common/src/utils/squid-code-bundle.utils.js.map +1 -0
- package/dist/internal-common/src/utils/squid-service.utils.d.ts +34 -0
- package/dist/internal-common/src/utils/{squid-service-utils.js → squid-service.utils.js} +50 -1
- package/dist/internal-common/src/utils/squid-service.utils.js.map +1 -0
- package/dist/internal-common/src/utils.d.ts +0 -1
- package/dist/internal-common/src/utils.js +0 -14
- package/dist/internal-common/src/utils.js.map +1 -1
- package/dist/local-backend/src/index.d.ts +1 -0
- package/dist/local-backend/src/index.js +1 -0
- package/dist/local-backend/src/index.js.map +1 -1
- package/dist/local-backend/src/local-backend-connectors.service.d.ts +3 -9
- package/dist/local-backend/src/local-backend-connectors.service.js +20 -44
- package/dist/local-backend/src/local-backend-connectors.service.js.map +1 -1
- package/dist/local-backend/src/local-backend.module.d.ts +2 -1
- package/dist/local-backend/src/local-backend.module.js +4 -3
- package/dist/local-backend/src/local-backend.module.js.map +1 -1
- package/dist/local-backend/src/local-backend.service.d.ts +4 -2
- package/dist/local-backend/src/local-backend.service.js +40 -49
- package/dist/local-backend/src/local-backend.service.js.map +1 -1
- package/dist/local-backend/src/local-backend.types.d.ts +1 -0
- package/dist/local-backend/src/local-backend.types.js +5 -0
- package/dist/local-backend/src/local-backend.types.js.map +1 -0
- package/dist/local-backend/src/main.js +9 -2
- package/dist/local-backend/src/main.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/internal-common/src/public-types/application.public-types.js.map +0 -1
- package/dist/internal-common/src/public-types/bundle-data.public-types.js.map +0 -1
- package/dist/internal-common/src/public-types/mutation.public-types.d.ts +0 -45
- package/dist/internal-common/src/public-types/mutation.public-types.js +0 -5
- package/dist/internal-common/src/public-types/mutation.public-types.js.map +0 -1
- package/dist/internal-common/src/public-types/storage.types.js.map +0 -1
- package/dist/internal-common/src/public-types-backend/ai-chatbot.public-context.js.map +0 -1
- package/dist/internal-common/src/utils/squid-service-utils.d.ts +0 -15
- package/dist/internal-common/src/utils/squid-service-utils.js.map +0 -1
- /package/dist/internal-common/src/{public-types → public-types-backend}/application.public-types.d.ts +0 -0
- /package/dist/internal-common/src/{public-types → public-types-backend}/application.public-types.js +0 -0
- /package/dist/internal-common/src/{public-types → public-types-backend}/bundle-data.public-types.js +0 -0
- /package/dist/internal-common/src/{public-types → public-types-backend}/storage.types.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExecuteFunctionAnnotationType, RunConfiguration, RunSecrets } from './types/backend-run.types';
|
|
2
2
|
import { Auth, RunContext } from './public-types/context.public-types';
|
|
3
|
-
import { ServiceFunctionName } from './public-types/
|
|
3
|
+
import { ServiceFunctionName } from './public-types/backend.public-types';
|
|
4
4
|
export type SingleExecuteFunctionRequest = {
|
|
5
5
|
functionName: ServiceFunctionName;
|
|
6
6
|
params: Array<any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AiAgentId, AiContextId, IntegrationId } from './communication.public-types';
|
|
2
2
|
import { IntegrationType } from './integration.public-types';
|
|
3
|
-
import { FunctionName, FunctionNameWithContext } from './
|
|
3
|
+
import { FunctionName, FunctionNameWithContext } from './backend.public-types';
|
|
4
4
|
export declare const OPENAI_O1_CHAT_MODEL_NAMES: readonly ["o1", "o1-mini"];
|
|
5
5
|
export declare const OPENAI_REASONING_CHAT_MODEL_NAMES: readonly ["o1", "o1-mini", "o3-mini"];
|
|
6
6
|
export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["gpt-4o", "gpt-4o-mini", "o1", "o1-mini", "o3-mini"];
|
|
@@ -38,17 +38,6 @@ export type FluxModelName = (typeof FLUX_MODEL_NAMES)[number];
|
|
|
38
38
|
export type AiGenerateImageOptions = DallEOptions | StableDiffusionCoreOptions | FluxOptions;
|
|
39
39
|
export type AiAudioTranscribeOptions = WhisperOptions;
|
|
40
40
|
export type AiAudioCreateSpeechOptions = OpenAiCreateSpeechOptions;
|
|
41
|
-
export declare const VECTOR_DB_TYPES: readonly ["postgres"];
|
|
42
|
-
export type VectorDbType = (typeof VECTOR_DB_TYPES)[number];
|
|
43
|
-
export interface AiAudioCreateSpeechResponse {
|
|
44
|
-
mimeType: string;
|
|
45
|
-
extension: string;
|
|
46
|
-
base64File: string;
|
|
47
|
-
}
|
|
48
|
-
export interface AiAudioCreateSpeechRequest {
|
|
49
|
-
input: string;
|
|
50
|
-
options: AiAudioCreateSpeechOptions;
|
|
51
|
-
}
|
|
52
41
|
export interface BaseAiGenerateImageOptions {
|
|
53
42
|
modelName: AiImageModelName;
|
|
54
43
|
}
|
|
@@ -103,6 +92,7 @@ export interface AiConnectedIntegrationMetadata {
|
|
|
103
92
|
integrationId: IntegrationId;
|
|
104
93
|
integrationType: IntegrationType;
|
|
105
94
|
description?: string;
|
|
95
|
+
instructions?: string;
|
|
106
96
|
}
|
|
107
97
|
export interface AiConnectedAgentMetadata {
|
|
108
98
|
agentId: AiAgentId;
|
|
@@ -111,7 +101,7 @@ export interface AiConnectedAgentMetadata {
|
|
|
111
101
|
export interface AiChatPromptQuotas {
|
|
112
102
|
maxAiCallStackSize: number;
|
|
113
103
|
}
|
|
114
|
-
interface BaseAiAgentChatOptions {
|
|
104
|
+
export interface BaseAiAgentChatOptions {
|
|
115
105
|
maxTokens?: number;
|
|
116
106
|
chatId?: string;
|
|
117
107
|
disableHistory?: boolean;
|
|
@@ -129,6 +119,7 @@ interface BaseAiAgentChatOptions {
|
|
|
129
119
|
quotas?: AiChatPromptQuotas;
|
|
130
120
|
includeMetadata?: boolean;
|
|
131
121
|
temperature?: number;
|
|
122
|
+
guardrails?: GuardrailsOptions;
|
|
132
123
|
model?: AiChatModelName;
|
|
133
124
|
}
|
|
134
125
|
export interface GeminiChatOptions extends BaseAiAgentChatOptions {
|
|
@@ -156,9 +147,6 @@ export type AiAgentChatOptions<T extends AiChatModelName | undefined = undefined
|
|
|
156
147
|
export type AllAiAgentChatOptions = {
|
|
157
148
|
[K in keyof BaseAiAgentChatOptions | keyof GeminiChatOptions | keyof OpenAiReasoningChatOptions | keyof OpenAiChatOptions | keyof AnthropicChatOptions]?: (K extends keyof BaseAiAgentChatOptions ? BaseAiAgentChatOptions[K] : never) | (K extends keyof GeminiChatOptions ? GeminiChatOptions[K] : never) | (K extends keyof OpenAiReasoningChatOptions ? OpenAiReasoningChatOptions[K] : never) | (K extends keyof OpenAiChatOptions ? OpenAiChatOptions[K] : never) | (K extends keyof AnthropicChatOptions ? AnthropicChatOptions[K] : never);
|
|
158
149
|
};
|
|
159
|
-
export type AllOpenAiAgentChatOptions = {
|
|
160
|
-
[K in keyof OpenAiChatOptions | keyof OpenAiReasoningChatOptions]?: (K extends keyof OpenAiChatOptions ? OpenAiChatOptions[K] : never) | (K extends keyof OpenAiReasoningChatOptions ? OpenAiReasoningChatOptions[K] : never);
|
|
161
|
-
};
|
|
162
150
|
export interface AiAgent<T extends AiChatModelName | undefined = undefined> {
|
|
163
151
|
id: AiAgentId;
|
|
164
152
|
createdAt: Date;
|
|
@@ -168,43 +156,6 @@ export interface AiAgent<T extends AiChatModelName | undefined = undefined> {
|
|
|
168
156
|
auditLog?: boolean;
|
|
169
157
|
options: AiAgentChatOptions<T>;
|
|
170
158
|
}
|
|
171
|
-
export interface GetAgentRequest {
|
|
172
|
-
agentId: AiAgentId;
|
|
173
|
-
}
|
|
174
|
-
export interface GetAgentResponse {
|
|
175
|
-
agent: AiAgent | undefined;
|
|
176
|
-
}
|
|
177
|
-
export interface GetAgentContextRequest {
|
|
178
|
-
agentId: AiAgentId;
|
|
179
|
-
contextId: string;
|
|
180
|
-
}
|
|
181
|
-
export interface DeleteAgentRequest {
|
|
182
|
-
agentId: AiAgentId;
|
|
183
|
-
}
|
|
184
|
-
export interface ListAgentContextsRequest {
|
|
185
|
-
agentId: AiAgentId;
|
|
186
|
-
}
|
|
187
|
-
export interface ListAgentContextsResponse {
|
|
188
|
-
contexts: Array<AiAgentContext>;
|
|
189
|
-
}
|
|
190
|
-
export interface DeleteAgentContextsRequest {
|
|
191
|
-
agentId: AiAgentId;
|
|
192
|
-
contextIds: Array<string>;
|
|
193
|
-
}
|
|
194
|
-
export interface UpsertAgentContextsRequest {
|
|
195
|
-
agentId: AiAgentId;
|
|
196
|
-
contextRequests: Array<AgentContextRequest>;
|
|
197
|
-
}
|
|
198
|
-
export interface ProvideAgentFeedbackRequest {
|
|
199
|
-
agentId: AiAgentId;
|
|
200
|
-
feedback: string;
|
|
201
|
-
}
|
|
202
|
-
export interface ResetAgentFeedbackRequest {
|
|
203
|
-
agentId: AiAgentId;
|
|
204
|
-
}
|
|
205
|
-
export interface ListAgentsResponse {
|
|
206
|
-
agents: Array<AiAgent>;
|
|
207
|
-
}
|
|
208
159
|
export type UpsertAgentRequest = Omit<AiAgent, 'createdAt' | 'updatedAt' | 'options'> & {
|
|
209
160
|
options?: AiAgentChatOptions;
|
|
210
161
|
};
|
|
@@ -217,47 +168,16 @@ export interface AiStatusMessage {
|
|
|
217
168
|
title: string;
|
|
218
169
|
tags?: Record<string, any>;
|
|
219
170
|
}
|
|
220
|
-
export interface AiAskResponse {
|
|
221
|
-
responseString: string;
|
|
222
|
-
}
|
|
223
|
-
export interface AiTranscribeAndAskResponse {
|
|
224
|
-
responseString: string;
|
|
225
|
-
transcribedPrompt: string;
|
|
226
|
-
}
|
|
227
|
-
export interface AiAskWithVoiceResponse {
|
|
228
|
-
responseString: string;
|
|
229
|
-
voiceResponse: AiAudioCreateSpeechResponse;
|
|
230
|
-
}
|
|
231
|
-
export interface AiTranscribeAndAskWithVoiceResponse {
|
|
232
|
-
transcribedPrompt: string;
|
|
233
|
-
responseString: string;
|
|
234
|
-
voiceResponse: AiAudioCreateSpeechResponse;
|
|
235
|
-
}
|
|
236
|
-
export interface AiTranscribeAndChatResponse {
|
|
237
|
-
transcribedPrompt: string;
|
|
238
|
-
}
|
|
239
171
|
export interface AiSearchOptions {
|
|
240
172
|
prompt: string;
|
|
241
173
|
contextMetadataFilter?: AiContextMetadataFilter;
|
|
242
174
|
limit?: number;
|
|
243
175
|
}
|
|
244
|
-
export interface AiSearchRequest {
|
|
245
|
-
options: AiSearchOptions;
|
|
246
|
-
agentId: AiAgentId;
|
|
247
|
-
}
|
|
248
|
-
export interface AiSearchResponse {
|
|
249
|
-
chunks: Array<AiSearchResultChunk>;
|
|
250
|
-
}
|
|
251
176
|
export interface AiSearchResultChunk {
|
|
252
177
|
data: string;
|
|
253
178
|
metadata?: AiContextMetadata;
|
|
254
179
|
score: number;
|
|
255
180
|
}
|
|
256
|
-
export declare class SecureAiAgentContext {
|
|
257
|
-
readonly prompt?: string;
|
|
258
|
-
readonly agentId: AiAgentId;
|
|
259
|
-
constructor(prototype: SecureAiAgentContext);
|
|
260
|
-
}
|
|
261
181
|
export interface AiAgentContext {
|
|
262
182
|
id: AiContextId;
|
|
263
183
|
createdAt: Date;
|
|
@@ -271,7 +191,7 @@ export interface AiAgentContext {
|
|
|
271
191
|
metadata: AiContextMetadata;
|
|
272
192
|
}
|
|
273
193
|
export type AgentContextRequest = TextContextRequest | FileContextRequest;
|
|
274
|
-
|
|
194
|
+
interface BaseContextRequest {
|
|
275
195
|
contextId: string;
|
|
276
196
|
type: AiContextType;
|
|
277
197
|
metadata?: AiContextMetadata;
|
|
@@ -293,31 +213,31 @@ export interface FileContextRequest extends BaseContextRequest {
|
|
|
293
213
|
}
|
|
294
214
|
export type AiContextMetadataValue = number | string | boolean | undefined;
|
|
295
215
|
export type AiContextMetadataValueArray = AiContextMetadataValue[];
|
|
296
|
-
|
|
216
|
+
interface AiContextMetadataEqFilter {
|
|
297
217
|
$eq: AiContextMetadataValue;
|
|
298
218
|
}
|
|
299
|
-
|
|
219
|
+
interface AiContextMetadataNeFilter {
|
|
300
220
|
$ne: AiContextMetadataValue;
|
|
301
221
|
}
|
|
302
|
-
|
|
222
|
+
interface AiContextMetadataGtFilter {
|
|
303
223
|
$gt: number;
|
|
304
224
|
}
|
|
305
|
-
|
|
225
|
+
interface AiContextMetadataGteFilter {
|
|
306
226
|
$gte: number;
|
|
307
227
|
}
|
|
308
|
-
|
|
228
|
+
interface AiContextMetadataLtFilter {
|
|
309
229
|
$lt: number;
|
|
310
230
|
}
|
|
311
|
-
|
|
231
|
+
interface AiContextMetadataLteFilter {
|
|
312
232
|
$lte: number;
|
|
313
233
|
}
|
|
314
|
-
|
|
234
|
+
interface AiContextMetadataInFilter {
|
|
315
235
|
$in: AiContextMetadataValueArray;
|
|
316
236
|
}
|
|
317
|
-
|
|
237
|
+
interface AiContextMetadataNinFilter {
|
|
318
238
|
$nin: AiContextMetadataValueArray;
|
|
319
239
|
}
|
|
320
|
-
|
|
240
|
+
interface AiContextMetadataExistsFilter {
|
|
321
241
|
$exists: boolean;
|
|
322
242
|
}
|
|
323
243
|
export type AiContextMetadataSimpleFilter = AiContextMetadataEqFilter | AiContextMetadataNeFilter | AiContextMetadataGtFilter | AiContextMetadataGteFilter | AiContextMetadataLtFilter | AiContextMetadataLteFilter | AiContextMetadataInFilter | AiContextMetadataNinFilter | AiContextMetadataExistsFilter;
|
|
@@ -332,6 +252,14 @@ export interface AiContextMetadataOrFilter {
|
|
|
332
252
|
}
|
|
333
253
|
export type AiContextMetadataFilter = AiContextMetadataFieldFilter | AiContextMetadataAndFilter | AiContextMetadataOrFilter;
|
|
334
254
|
export type AiContextMetadata = Record<string, AiContextMetadataValue>;
|
|
335
|
-
export
|
|
336
|
-
export
|
|
255
|
+
export type GuardrailKeysType = 'disableProfanity' | 'offTopicAnswers' | 'professionalTone' | 'disablePii';
|
|
256
|
+
export type GuardrailsOptions = {
|
|
257
|
+
[k in GuardrailKeysType]?: boolean;
|
|
258
|
+
} & {
|
|
259
|
+
custom?: string;
|
|
260
|
+
};
|
|
261
|
+
export interface AiTranscribeAndAskResponse {
|
|
262
|
+
responseString: string;
|
|
263
|
+
transcribedPrompt: string;
|
|
264
|
+
}
|
|
337
265
|
export {};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.validateAiContextMetadata = validateAiContextMetadata;
|
|
5
|
-
exports.validateAiContextMetadataFilter = validateAiContextMetadataFilter;
|
|
3
|
+
exports.OPEN_AI_CREATE_SPEECH_FORMATS = exports.AI_AUDIO_CREATE_SPEECH_MODEL_NAMES = exports.AI_AUDIO_TRANSCRIPTION_MODEL_NAMES = exports.AI_IMAGE_MODEL_NAMES = exports.FLUX_MODEL_NAMES = exports.STABLE_DIFFUSION_MODEL_NAMES = exports.OPENAI_AUDIO_MODEL_NAMES = exports.OPENAI_AUDIO_CREATE_SPEECH_MODEL_NAMES = exports.OPENAI_AUDIO_TRANSCRIPTION_MODEL_NAMES = exports.OPENAI_IMAGE_MODEL_NAMES = exports.AI_EMBEDDINGS_MODEL_NAMES = exports.OPENAI_EMBEDDINGS_MODEL_NAMES = exports.AI_CHAT_MODEL_NAMES = exports.ANTHROPIC_CHAT_MODEL_NAMES = exports.GEMINI_CHAT_MODEL_NAMES = exports.OPENAI_CHAT_MODEL_NAMES = exports.OPENAI_REASONING_CHAT_MODEL_NAMES = exports.OPENAI_O1_CHAT_MODEL_NAMES = void 0;
|
|
6
4
|
exports.OPENAI_O1_CHAT_MODEL_NAMES = ['o1', 'o1-mini'];
|
|
7
5
|
exports.OPENAI_REASONING_CHAT_MODEL_NAMES = [...exports.OPENAI_O1_CHAT_MODEL_NAMES, 'o3-mini'];
|
|
8
6
|
exports.OPENAI_CHAT_MODEL_NAMES = ['gpt-4o', 'gpt-4o-mini', ...exports.OPENAI_REASONING_CHAT_MODEL_NAMES];
|
|
@@ -36,62 +34,4 @@ exports.AI_IMAGE_MODEL_NAMES = [
|
|
|
36
34
|
exports.AI_AUDIO_TRANSCRIPTION_MODEL_NAMES = [...exports.OPENAI_AUDIO_TRANSCRIPTION_MODEL_NAMES];
|
|
37
35
|
exports.AI_AUDIO_CREATE_SPEECH_MODEL_NAMES = [...exports.OPENAI_AUDIO_CREATE_SPEECH_MODEL_NAMES];
|
|
38
36
|
exports.OPEN_AI_CREATE_SPEECH_FORMATS = ['mp3', 'opus', 'aac', 'flac', 'wav', 'pcm'];
|
|
39
|
-
exports.VECTOR_DB_TYPES = ['postgres'];
|
|
40
|
-
class SecureAiAgentContext {
|
|
41
|
-
constructor(prototype) {
|
|
42
|
-
this.agentId = prototype.agentId;
|
|
43
|
-
this.prompt = prototype.prompt;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
exports.SecureAiAgentContext = SecureAiAgentContext;
|
|
47
|
-
const INTERNAL_METADATA_KEYS = ['groupId', 'appId', 'integrationId', 'profileId', 'index', 'text', 'filePathInBucket'];
|
|
48
|
-
function validateAiContextMetadata(metadata) {
|
|
49
|
-
for (const key in metadata) {
|
|
50
|
-
const value = metadata[key];
|
|
51
|
-
if (typeof value !== 'string' && typeof value !== 'number' && typeof value !== 'boolean' && value !== undefined) {
|
|
52
|
-
throw new Error(`Invalid metadata value for key ${key} - cannot be of type ${typeof value}`);
|
|
53
|
-
}
|
|
54
|
-
if (INTERNAL_METADATA_KEYS.includes(key)) {
|
|
55
|
-
throw new Error(`Invalid metadata key ${key} - cannot be an internal key. Internal keys: ${INTERNAL_METADATA_KEYS.join(', ')}`);
|
|
56
|
-
}
|
|
57
|
-
if (!/^[a-zA-Z0-9_]+$/.test(key)) {
|
|
58
|
-
throw new Error(`Invalid metadata key ${key} - can only contain letters, numbers, and underscores`);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
function validateAiContextMetadataFilter(filter) {
|
|
63
|
-
if (isAndFilter(filter)) {
|
|
64
|
-
for (const subFilter of filter.$and) {
|
|
65
|
-
validateAiContextMetadataFilter(subFilter);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
else if (isOrFilter(filter)) {
|
|
69
|
-
for (const subFilter of filter.$or) {
|
|
70
|
-
validateAiContextMetadataFilter(subFilter);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
for (const key in filter) {
|
|
75
|
-
if (!/^[a-zA-Z0-9_]+$/.test(key)) {
|
|
76
|
-
throw new Error(`Invalid metadata filter key ${key} - can only contain letters, numbers, and underscores`);
|
|
77
|
-
}
|
|
78
|
-
if (INTERNAL_METADATA_KEYS.includes(key)) {
|
|
79
|
-
throw new Error(`Invalid metadata filter key ${key} - cannot be an internal key. Internal keys: ${INTERNAL_METADATA_KEYS.join(', ')}`);
|
|
80
|
-
}
|
|
81
|
-
const value = filter[key];
|
|
82
|
-
if (typeof value !== 'object' &&
|
|
83
|
-
typeof value !== 'string' &&
|
|
84
|
-
typeof value !== 'number' &&
|
|
85
|
-
typeof value !== 'boolean') {
|
|
86
|
-
throw new Error(`Invalid metadata filter value for key ${key} - cannot be of type ${typeof value}`);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
function isAndFilter(filter) {
|
|
92
|
-
return '$and' in filter;
|
|
93
|
-
}
|
|
94
|
-
function isOrFilter(filter) {
|
|
95
|
-
return '$or' in filter;
|
|
96
|
-
}
|
|
97
37
|
//# sourceMappingURL=ai-agent.public-types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-agent.public-types.js","sourceRoot":"","sources":["../../../../../internal-common/src/public-types/ai-agent.public-types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ai-agent.public-types.js","sourceRoot":"","sources":["../../../../../internal-common/src/public-types/ai-agent.public-types.ts"],"names":[],"mappings":";;;AAQa,QAAA,0BAA0B,GAAG,CAAC,IAAI,EAAE,SAAS,CAAU,CAAC;AAKxD,QAAA,iCAAiC,GAAG,CAAC,GAAG,kCAA0B,EAAE,SAAS,CAAU,CAAC;AAKxF,QAAA,uBAAuB,GAAG,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,yCAAiC,CAAU,CAAC;AAKnG,QAAA,uBAAuB,GAAG,CAAC,gBAAgB,EAAE,kBAAkB,CAAU,CAAC;AAK1E,QAAA,0BAA0B,GAAG,CAAC,yBAAyB,EAAE,0BAA0B,CAAU,CAAC;AAM9F,QAAA,mBAAmB,GAAG;IACjC,GAAG,+BAAuB;IAC1B,GAAG,kCAA0B;IAC7B,GAAG,+BAAuB;CAClB,CAAC;AAKE,QAAA,6BAA6B,GAAG;IAC3C,wBAAwB;IACxB,wBAAwB;IACxB,wBAAwB;CAChB,CAAC;AAKE,QAAA,yBAAyB,GAAG,CAAC,GAAG,qCAA6B,CAAU,CAAC;AAMxE,QAAA,wBAAwB,GAAG,CAAC,UAAU,CAAU,CAAC;AAKjD,QAAA,sCAAsC,GAAG,CAAC,WAAW,CAAU,CAAC;AAKhE,QAAA,sCAAsC,GAAG,CAAC,OAAO,EAAE,UAAU,CAAU,CAAC;AAKxE,QAAA,wBAAwB,GAAG;IACtC,GAAG,8CAAsC;IACzC,GAAG,8CAAsC;CACjC,CAAC;AAKE,QAAA,4BAA4B,GAAG,CAAC,uBAAuB,CAAU,CAAC;AAKlE,QAAA,gBAAgB,GAAG,CAAC,cAAc,CAAU,CAAC;AAK7C,QAAA,oBAAoB,GAAG;IAClC,GAAG,gCAAwB;IAC3B,GAAG,oCAA4B;IAC/B,GAAG,wBAAgB;CACX,CAAC;AAKE,QAAA,kCAAkC,GAAG,CAAC,GAAG,8CAAsC,CAAU,CAAC;AAK1F,QAAA,kCAAkC,GAAG,CAAC,GAAG,8CAAsC,CAAU,CAAC;AAK1F,QAAA,6BAA6B,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type TopicName = string;
|
|
2
|
+
export type ServiceName = string;
|
|
3
|
+
export type FunctionName = string;
|
|
4
|
+
export interface FunctionNameWithContext {
|
|
5
|
+
name: FunctionName;
|
|
6
|
+
context: Record<string, unknown>;
|
|
7
|
+
}
|
|
8
|
+
export type ServiceFunctionName = `${ServiceName}:${FunctionName}`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend.public-types.js","sourceRoot":"","sources":["../../../../../internal-common/src/public-types/backend.public-types.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"communication.public-types.js","sourceRoot":"","sources":["../../../../../internal-common/src/public-types/communication.public-types.ts"],"names":[],"mappings":";;;AAEa,QAAA,eAAe,GAAG,CAAC,KAAK,EAAE,MAAM,CAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"communication.public-types.js","sourceRoot":"","sources":["../../../../../internal-common/src/public-types/communication.public-types.ts"],"names":[],"mappings":";;;AAEa,QAAA,eAAe,GAAG,CAAC,KAAK,EAAE,MAAM,CAAU,CAAC;AAoB3C,QAAA,iBAAiB,GAAG,gBAAgB,CAAC"}
|
|
@@ -15,10 +15,6 @@ export interface SquidDocument {
|
|
|
15
15
|
__ts__: DocTimestamp;
|
|
16
16
|
[fieldName: string]: FieldType | undefined;
|
|
17
17
|
}
|
|
18
|
-
export interface BeforeAndAfterDocs<T = SquidDocument> {
|
|
19
|
-
before: T | undefined;
|
|
20
|
-
after: T | undefined;
|
|
21
|
-
}
|
|
22
18
|
export interface SquidDocIdObj {
|
|
23
19
|
collectionName: CollectionName;
|
|
24
20
|
docId: DocId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration.public-types.js","sourceRoot":"","sources":["../../../../../internal-common/src/public-types/integration.public-types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"integration.public-types.js","sourceRoot":"","sources":["../../../../../internal-common/src/public-types/integration.public-types.ts"],"names":[],"mappings":";;;AAGa,QAAA,wBAAwB,GAAG,WAAW,CAAC;AAGvC,QAAA,iBAAiB,GAAG;IAC/B,kBAAkB;IAClB,WAAW;IACX,YAAY;IACZ,SAAS;IACT,SAAS;IACT,KAAK;IACL,OAAO;IACP,gBAAgB;IAChB,kBAAkB;IAClB,WAAW;IACX,UAAU;IACV,aAAa;IACb,cAAc;IACd,gBAAgB;IAChB,aAAa;IACb,WAAW;IACX,YAAY;IACZ,UAAU;IACV,WAAW;IACX,SAAS;IACT,YAAY;IACZ,WAAW;IACX,SAAS;IACT,KAAK;IACL,SAAS;IACT,YAAY;IACZ,UAAU;IACV,2BAA2B;IAC3B,uBAAuB;IACvB,gBAAgB;IAChB,eAAe;IACf,WAAW;IACX,KAAK;IACL,aAAa;IACb,cAAc;IACd,SAAS;IACT,SAAS;IACT,MAAM;IACN,UAAU;IACV,SAAS;IACT,OAAO;IACP,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,OAAO;IACP,OAAO;IACP,OAAO;IACP,UAAU;IACV,MAAM;IACN,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,OAAO;IACP,IAAI;IACJ,gBAAgB;IAChB,UAAU;IACV,QAAQ;IACR,YAAY;IACZ,WAAW;IACX,SAAS;IACT,MAAM;IACN,SAAS;IACT,MAAM;IACN,OAAO;CACC,CAAC;AAKE,QAAA,sBAAsB,GAAG;IACpC,UAAU;IACV,aAAa;IACb,YAAY;IACZ,WAAW;IACX,OAAO;IACP,OAAO;IACP,OAAO;IACP,UAAU;IACV,UAAU;IACV,UAAU;IACV,WAAW;CACH,CAAC;AAKE,QAAA,sBAAsB,GAAG;IACpC,OAAO;IACP,SAAS;IACT,UAAU;IACV,SAAS;IACT,MAAM;IACN,SAAS;IACT,eAAe;CACP,CAAC;AAEE,QAAA,yBAAyB,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAU,CAAC;AAC3D,QAAA,sBAAsB,GAAG,CAAC,KAAK,EAAE,YAAY,CAAU,CAAC;AAIxD,QAAA,wBAAwB,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,CAAU,CAAC;AAO/D,QAAA,0BAA0B,GAAkB,aAAa,CAAC;AAK1D,QAAA,6BAA6B,GAAkB,gBAAgB,CAAC;AAKhE,QAAA,+BAA+B,GAAkB,kBAAkB,CAAC"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { IntegrationType } from '../integration.public-types';
|
|
2
1
|
import { FieldName } from '../document.public-types';
|
|
3
|
-
import { IntegrationId } from '../communication.public-types';
|
|
4
2
|
export type HttpMethod = 'post' | 'get' | 'delete' | 'patch' | 'put';
|
|
5
3
|
export type ApiEndpointId = string;
|
|
6
4
|
export type ApiParameterLocation = 'query' | 'body' | 'header' | 'path';
|
|
@@ -53,12 +51,3 @@ export interface ApiEndpoint {
|
|
|
53
51
|
bodyMimeType?: string;
|
|
54
52
|
isRequestBodyRequired?: boolean;
|
|
55
53
|
}
|
|
56
|
-
export interface DiscoverOpenApiSchemaRequest {
|
|
57
|
-
integrationId: IntegrationId;
|
|
58
|
-
integrationType: Extract<IntegrationType, 'api'>;
|
|
59
|
-
discoveryOptions: OpenApiDiscoveryOptions;
|
|
60
|
-
}
|
|
61
|
-
export interface DiscoverOpenApiSchemaFromFileRequest {
|
|
62
|
-
integrationId: IntegrationId;
|
|
63
|
-
integrationType: Extract<IntegrationType, 'api'>;
|
|
64
|
-
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.public-types.js","sourceRoot":"","sources":["../../../../../../internal-common/src/public-types/integrations/api.public-types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"api.public-types.js","sourceRoot":"","sources":["../../../../../../internal-common/src/public-types/integrations/api.public-types.ts"],"names":[],"mappings":";;;AA0Ca,QAAA,yBAAyB,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAU,CAAC"}
|
|
@@ -17,7 +17,6 @@ export interface SimpleCondition<Doc extends DocumentData = any, F extends Paths
|
|
|
17
17
|
export interface CompositeCondition<Doc extends DocumentData = any> {
|
|
18
18
|
fields: Array<SimpleCondition<Doc, Paths<Doc>, CompositeConditionOperator>>;
|
|
19
19
|
}
|
|
20
|
-
export declare function isSimpleCondition(condition: Condition): condition is SimpleCondition;
|
|
21
20
|
type CompositeConditionOperator = '>=' | '<=' | '>' | '<';
|
|
22
21
|
export declare const ARRAY_OPERATORS: readonly ["in", "not in", "array_includes_some", "array_includes_all", "array_not_includes"];
|
|
23
22
|
export declare const ALL_OPERATORS: readonly ["in", "not in", "array_includes_some", "array_includes_all", "array_not_includes", "==", "!=", ">=", "<=", ">", "<", "like", "not like", "like_cs", "not like_cs"];
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ALL_OPERATORS = exports.ARRAY_OPERATORS = void 0;
|
|
4
|
-
exports.isSimpleCondition = isSimpleCondition;
|
|
5
|
-
function isSimpleCondition(condition) {
|
|
6
|
-
return 'fieldName' in condition;
|
|
7
|
-
}
|
|
8
4
|
exports.ARRAY_OPERATORS = [
|
|
9
5
|
'in',
|
|
10
6
|
'not in',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.public-types.js","sourceRoot":"","sources":["../../../../../internal-common/src/public-types/query.public-types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"query.public-types.js","sourceRoot":"","sources":["../../../../../internal-common/src/public-types/query.public-types.ts"],"names":[],"mappings":";;;AAiEa,QAAA,eAAe,GAAG;IAC7B,IAAI;IACJ,QAAQ;IACR,qBAAqB;IACrB,oBAAoB;IACpB,oBAAoB;CACZ,CAAC;AAME,QAAA,aAAa,GAAG;IAC3B,GAAG,uBAAe;IAClB,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,GAAG;IACH,GAAG;IACH,MAAM;IACN,UAAU;IACV,SAAS;IACT,aAAa;CACL,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ServiceFunctionName } from './
|
|
1
|
+
import { ServiceFunctionName } from './backend.public-types';
|
|
2
2
|
export interface SchedulerConfig {
|
|
3
3
|
functionName: ServiceFunctionName;
|
|
4
4
|
cronExpression: string;
|
|
@@ -9,9 +9,6 @@ export interface SchedulerInfo {
|
|
|
9
9
|
config: SchedulerConfig;
|
|
10
10
|
enabled: boolean;
|
|
11
11
|
}
|
|
12
|
-
export interface ListSchedulersResponse {
|
|
13
|
-
schedulers: SchedulerInfo[];
|
|
14
|
-
}
|
|
15
12
|
export interface UpdateSchedulerOptions {
|
|
16
13
|
schedulerId: string;
|
|
17
14
|
enabled?: boolean;
|
|
@@ -11,10 +11,6 @@ export interface SecretEntry<T extends SecretValue = SecretValue> extends Secret
|
|
|
11
11
|
export interface ApiKeyEntry extends SecretMetadata {
|
|
12
12
|
value: string;
|
|
13
13
|
}
|
|
14
|
-
export type SetSecretEntry = {
|
|
15
|
-
key: SecretKey;
|
|
16
|
-
value?: SecretValue;
|
|
17
|
-
};
|
|
18
14
|
export interface SetSecretRequestEntry {
|
|
19
15
|
key: SecretKey;
|
|
20
16
|
value: SecretValue;
|
|
@@ -4,3 +4,8 @@ export interface AiFunctionContext<AgentContextType = unknown, FunctionContextTy
|
|
|
4
4
|
agentContext: AgentContextType;
|
|
5
5
|
functionContext: FunctionContextType;
|
|
6
6
|
}
|
|
7
|
+
export declare class SecureAiAgentContext {
|
|
8
|
+
readonly prompt?: string;
|
|
9
|
+
readonly agentId: AiAgentId;
|
|
10
|
+
constructor(prototype: SecureAiAgentContext);
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SecureAiAgentContext = void 0;
|
|
4
|
+
class SecureAiAgentContext {
|
|
5
|
+
constructor(prototype) {
|
|
6
|
+
this.agentId = prototype.agentId;
|
|
7
|
+
this.prompt = prototype.prompt;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.SecureAiAgentContext = SecureAiAgentContext;
|
|
11
|
+
//# sourceMappingURL=ai-agent.public-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-agent.public-context.js","sourceRoot":"","sources":["../../../../../internal-common/src/public-types-backend/ai-agent.public-context.ts"],"names":[],"mappings":";;;AA6BA,MAAa,oBAAoB;IAO/B,YAAY,SAA+B;QACzC,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC;QACjC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;IACjC,CAAC;CACF;AAXD,oDAWC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application.public-types.js","sourceRoot":"","sources":["../../../../../internal-common/src/public-types-backend/application.public-types.ts"],"names":[],"mappings":";;;AAgBA,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"}
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import { MutationContext } from './mutation.public-context';
|
|
1
|
+
import { MutationContext, MutationType } from './mutation.public-context';
|
|
2
2
|
import { ApiCallContext } from './api-call.public-context';
|
|
3
3
|
import { QueryContext } from './query.public-context';
|
|
4
|
-
import { DatabaseActionType, MetricActionType, StorageActionType, TopicActionType } from '../public-types/bundle-data.public-types';
|
|
5
4
|
import { ClientConnectionState } from '../public-types/socket.public-types';
|
|
6
5
|
import { CollectionName, DocIdOrDocIdObj, DocumentData } from '../public-types/document.public-types';
|
|
7
|
-
import { MutationType } from '../public-types/mutation.public-types';
|
|
8
6
|
import { ClientId, IntegrationId, SquidDocId } from '../public-types/communication.public-types';
|
|
9
7
|
import { TopicReadContext, TopicWriteContext } from './topic.public-context';
|
|
10
8
|
import { DistributedLockContext } from './distributed-lock.public-context';
|
|
11
9
|
import { GraphqlContext } from './graphql.public-context';
|
|
12
|
-
import { AiFunctionContext } from './ai-chatbot.public-context';
|
|
13
|
-
import { StorageContext } from '../public-types/storage.types';
|
|
14
10
|
import { NativeQueryContext } from './native-query.public-context';
|
|
15
11
|
import { SecureMetricContext } from './metric.public-context';
|
|
16
|
-
import {
|
|
12
|
+
import { DatabaseActionType, MetricActionType, StorageActionType, TopicActionType } from './bundle-data.public-types';
|
|
13
|
+
import { StorageContext } from './storage.types';
|
|
14
|
+
import { AiFunctionContext, SecureAiAgentContext } from './ai-agent.public-context';
|
|
17
15
|
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>);
|
|
18
16
|
export type SecureStorageAction<T extends StorageActionType> = T extends 'all' ? () => boolean | Promise<boolean> : (context: StorageContext) => boolean | Promise<boolean>;
|
|
19
17
|
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>);
|
|
@@ -37,7 +35,7 @@ export interface TriggerRequest<T extends DocumentData = any> {
|
|
|
37
35
|
docAfter?: T;
|
|
38
36
|
}
|
|
39
37
|
export type SchedulerAction = () => void | Promise<void>;
|
|
40
|
-
export type
|
|
38
|
+
export type LimitsAction = (...args: any[]) => any | Promise<any>;
|
|
41
39
|
export type LimiterScope = 'ip' | 'user' | 'global';
|
|
42
40
|
export type QuotaRenewPeriod = 'hourly' | 'daily' | 'weekly' | 'monthly' | 'quarterly' | 'annually';
|
|
43
41
|
export interface RateLimitOptions {
|
package/dist/internal-common/src/{public-types → public-types-backend}/bundle-data.public-types.d.ts
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IntegrationType } from '
|
|
1
|
+
import { IntegrationType } from '../public-types/integration.public-types';
|
|
2
2
|
export type DatabaseActionType = 'read' | 'write' | 'update' | 'insert' | 'delete' | 'all';
|
|
3
3
|
export type StorageActionType = 'read' | 'write' | 'update' | 'insert' | 'delete' | 'all';
|
|
4
4
|
export type TopicActionType = 'read' | 'write' | 'all';
|
|
@@ -13,11 +13,3 @@ export interface AiFunctionParam {
|
|
|
13
13
|
export interface AiFunctionAttributes {
|
|
14
14
|
integrationType?: Array<IntegrationType>;
|
|
15
15
|
}
|
|
16
|
-
export type TopicName = string;
|
|
17
|
-
export type FunctionName = string;
|
|
18
|
-
export interface FunctionNameWithContext {
|
|
19
|
-
name: FunctionName;
|
|
20
|
-
context: Record<string, unknown>;
|
|
21
|
-
}
|
|
22
|
-
export type ServiceName = string;
|
|
23
|
-
export type ServiceFunctionName = `${ServiceName}:${FunctionName}`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle-data.public-types.js","sourceRoot":"","sources":["../../../../../internal-common/src/public-types-backend/bundle-data.public-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +1,52 @@
|
|
|
1
1
|
import { Paths } from '../public-types/typescript.public-types';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { SquidDocIdObj, SquidDocument } from '../public-types/document.public-types';
|
|
3
|
+
export declare const MUTATION_TYPES: readonly ["insert", "update", "delete"];
|
|
4
|
+
export type MutationType = (typeof MUTATION_TYPES)[number];
|
|
5
|
+
interface BaseMutation {
|
|
6
|
+
type: MutationType;
|
|
7
|
+
squidDocIdObj: SquidDocIdObj;
|
|
8
|
+
}
|
|
9
|
+
export type Mutation<T = any> = UpdateMutation<T> | InsertMutation<T> | DeleteMutation;
|
|
10
|
+
export interface DeleteMutation extends BaseMutation {
|
|
11
|
+
type: 'delete';
|
|
12
|
+
}
|
|
13
|
+
export interface UpdateMutation<T = any> extends BaseMutation {
|
|
14
|
+
type: 'update';
|
|
15
|
+
properties: {
|
|
16
|
+
[key in keyof T & string]?: Array<PropertyMutation<T[key]>>;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export interface InsertMutation<T = any> extends BaseMutation {
|
|
20
|
+
type: 'insert';
|
|
21
|
+
properties: T;
|
|
22
|
+
}
|
|
23
|
+
export type PropertyMutation<Value = any> = ApplyNumericFnPropertyMutation | ApplyStringFnPropertyMutation | ValueUpdatePropertyMutation<Value> | RemovePropertyMutation;
|
|
24
|
+
export interface ValueUpdatePropertyMutation<Value = any> {
|
|
25
|
+
type: 'update';
|
|
26
|
+
value: Value;
|
|
27
|
+
}
|
|
28
|
+
export interface ApplyNumericFnPropertyMutation {
|
|
29
|
+
type: 'applyNumericFn';
|
|
30
|
+
fn: 'increment';
|
|
31
|
+
value: number;
|
|
32
|
+
}
|
|
33
|
+
export interface RemovePropertyMutation {
|
|
34
|
+
type: 'removeProperty';
|
|
35
|
+
}
|
|
36
|
+
interface ApplyExtendString {
|
|
37
|
+
type: 'applyStringFn';
|
|
38
|
+
fn: 'extendString';
|
|
39
|
+
value: string;
|
|
40
|
+
}
|
|
41
|
+
interface ApplyTrimString {
|
|
42
|
+
type: 'applyStringFn';
|
|
43
|
+
fn: 'trim';
|
|
44
|
+
}
|
|
45
|
+
export type ApplyStringFnPropertyMutation = ApplyExtendString | ApplyTrimString;
|
|
46
|
+
export interface BeforeAndAfterDocs<T = SquidDocument> {
|
|
47
|
+
before: T | undefined;
|
|
48
|
+
after: T | undefined;
|
|
49
|
+
}
|
|
4
50
|
export declare class MutationContext<T = any> {
|
|
5
51
|
readonly mutation: Mutation<T>;
|
|
6
52
|
readonly beforeAndAfterDocs: BeforeAndAfterDocs<T>;
|
|
@@ -13,3 +59,4 @@ export declare class MutationContext<T = any> {
|
|
|
13
59
|
affectedPaths(startingRoot?: Paths<T> | string): Array<Paths<T>>;
|
|
14
60
|
private checkPath;
|
|
15
61
|
}
|
|
62
|
+
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MutationContext = void 0;
|
|
3
|
+
exports.MutationContext = exports.MUTATION_TYPES = void 0;
|
|
4
4
|
const object_1 = require("../utils/object");
|
|
5
5
|
const assertic_1 = require("assertic");
|
|
6
|
+
exports.MUTATION_TYPES = ['insert', 'update', 'delete'];
|
|
6
7
|
class MutationContext {
|
|
7
8
|
constructor(mutation, beforeAndAfterDocs, serverTimeStamp) {
|
|
8
9
|
this.mutation = mutation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutation.public-context.js","sourceRoot":"","sources":["../../../../../internal-common/src/public-types-backend/mutation.public-context.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"mutation.public-context.js","sourceRoot":"","sources":["../../../../../internal-common/src/public-types-backend/mutation.public-context.ts"],"names":[],"mappings":";;;AACA,4CAAqD;AACrD,uCAAwC;AAO3B,QAAA,cAAc,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAC;AA8GtE,MAAa,eAAe;IAI1B,YACW,QAAqB,EACrB,kBAAyC,EACzC,eAAqB;QAFrB,aAAQ,GAAR,QAAQ,CAAa;QACrB,uBAAkB,GAAlB,kBAAkB,CAAuB;QACzC,oBAAe,GAAf,eAAe,CAAM;IAC7B,CAAC;IAEJ,eAAe;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC5B,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC;IACxC,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC;IACvC,CAAC;IAGD,WAAW,CAAC,IAAc;QACxB,MAAM,MAAM,GAAG,IAAA,kBAAS,EAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC5C,MAAM,KAAK,GAAG,IAAA,kBAAS,EAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAC1C,OAAO,CAAC,IAAA,gBAAO,EAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACjC,CAAC;IAUD,aAAa,CAAC,eAAkC,EAAE;QAChD,IAAA,uBAAY,EAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,QAAQ,EAAE,sDAAsD,CAAC,CAAC;QACtG,MAAM,aAAa,GAAoB,EAAE,CAAC;QAC1C,IAAI,CAAC,SAAS,CAAC,YAAwB,EAAE,aAAa,CAAC,CAAC;QACxD,OAAO,aAAa,CAAC;IACvB,CAAC;IAGO,SAAS,CAAC,WAAqB,EAAE,aAA8B;QACrE,MAAM,WAAW,GAAG,IAAA,kBAAS,EAAC,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QACxD,MAAM,UAAU,GAAG,IAAA,kBAAS,EAAC,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QAGtD,IAAI,CAAC,IAAA,gBAAO,EAAC,WAAW,EAAE,UAAU,CAAC,EAAE,CAAC;YACtC,IAAI,WAAW,KAAK,EAAE,EAAE,CAAC;gBAEvB,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAClC,CAAC;YAGD,IACE,OAAO,WAAW,KAAK,QAAQ;gBAC/B,WAAW,KAAK,IAAI;gBACpB,OAAO,UAAU,KAAK,QAAQ;gBAC9B,UAAU,KAAK,IAAI,EACnB,CAAC;gBACD,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBAC5C,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBAC1C,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,UAAU,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC;gBAGvD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;oBACpB,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,WAAW,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;oBAC7D,IAAI,CAAC,SAAS,CAAC,QAAoB,EAAE,aAAa,CAAC,CAAC;gBACtD,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;CACF;AA3ED,0CA2EC"}
|