@squidcloud/client 1.0.442 → 1.0.444
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/cjs/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +4 -4
- package/dist/internal-common/src/public-types/ai-common.public-types.d.ts +8 -1
- package/dist/internal-common/src/public-types/ai-knowledge-base.public-types.d.ts +7 -7
- package/dist/typescript-client/src/agent/ai-agent-client-reference.d.ts +7 -8
- package/dist/typescript-client/src/agent/ai-agent-client.types.d.ts +4 -5
- package/dist/typescript-client/src/ai-client.d.ts +6 -1
- package/dist/typescript-client/src/management-client.d.ts +36 -0
- package/dist/typescript-client/src/squid.d.ts +2 -2
- package/dist/typescript-client/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/dist/internal-common/src/metric-name.d.ts +0 -9
- package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +0 -30
- package/dist/internal-common/src/public-types-backend/mutation.public-context.d.ts +0 -148
- package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +0 -72
- package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +0 -177
- package/dist/internal-common/src/types/ai-agent.types.d.ts +0 -200
- package/dist/internal-common/src/types/ai-knowledge-base.types.d.ts +0 -202
- package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +0 -59
- package/dist/internal-common/src/types/backend-function.types.d.ts +0 -1
- package/dist/internal-common/src/types/communication.types.d.ts +0 -1
- package/dist/internal-common/src/types/document.types.d.ts +0 -1
- package/dist/internal-common/src/types/file.types.d.ts +0 -6
- package/dist/internal-common/src/types/headers.types.d.ts +0 -17
- package/dist/internal-common/src/types/management-api-key.types.d.ts +0 -92
- package/dist/internal-common/src/types/mutation.types.d.ts +0 -1
- package/dist/internal-common/src/types/notification.types.d.ts +0 -5
- package/dist/internal-common/src/types/observability.types.d.ts +0 -107
- package/dist/internal-common/src/types/query.types.d.ts +0 -13
- package/dist/internal-common/src/types/secret.types.d.ts +0 -7
- package/dist/internal-common/src/types/socket.types.d.ts +0 -1
- package/dist/internal-common/src/types/stage.d.ts +0 -9
- package/dist/internal-common/src/types/time-units.d.ts +0 -1
- package/dist/internal-common/src/types/url-shortener.types.d.ts +0 -45
- package/dist/internal-common/src/utils/array.d.ts +0 -7
- package/dist/internal-common/src/utils/e2e-test-utils.d.ts +0 -2
- package/dist/internal-common/src/utils/file-utils.d.ts +0 -2
- package/dist/internal-common/src/utils/global.utils.d.ts +0 -1
- package/dist/internal-common/src/utils/http.d.ts +0 -5
- package/dist/internal-common/src/utils/lock.manager.d.ts +0 -14
- package/dist/internal-common/src/utils/metric-utils.d.ts +0 -4
- package/dist/internal-common/src/utils/metrics.types.d.ts +0 -7
- package/dist/internal-common/src/utils/object.d.ts +0 -86
- package/dist/internal-common/src/utils/serialization.d.ts +0 -18
- package/dist/internal-common/src/utils/squid.constants.d.ts +0 -1
- package/dist/internal-common/src/utils/trace-id-generator.d.ts +0 -1
- package/dist/internal-common/src/utils/validation.d.ts +0 -19
- package/dist/internal-common/src/websocket.impl.d.ts +0 -26
|
@@ -324,7 +324,7 @@ export interface AiAgentExecutionPlanOptions {
|
|
|
324
324
|
/** Whether to enable an execution plan for the agent. */
|
|
325
325
|
enabled: boolean;
|
|
326
326
|
/** The model to use for the execution plan - defaults to the model used by the agent. */
|
|
327
|
-
model?:
|
|
327
|
+
model?: AiChatModelSelection;
|
|
328
328
|
/** In case the model supports reasoning, this will control the level of effort - defaults to `high`. */
|
|
329
329
|
reasoningEffort?: AiReasoningEffort;
|
|
330
330
|
/**
|
|
@@ -557,7 +557,7 @@ export interface AnthropicChatOptions extends BaseAiChatOptions {
|
|
|
557
557
|
* the type is inferred from the provided overrideModel (or falls back to BaseAiAgentChatOptions).
|
|
558
558
|
* @category AI
|
|
559
559
|
*/
|
|
560
|
-
export type AiChatOptions<T extends
|
|
560
|
+
export type AiChatOptions<T extends AiChatModelSelection | undefined = undefined> = T extends undefined ? BaseAiChatOptions | GeminiChatOptions | OpenAiChatOptions | AnthropicChatOptions : T extends GeminiChatModelName ? GeminiChatOptions : T extends OpenAiChatModelName ? OpenAiChatOptions : T extends AnthropicChatModelName ? AnthropicChatOptions : T extends GrokChatModelName ? GrokChatOptions : BaseAiChatOptions;
|
|
561
561
|
/**
|
|
562
562
|
* @category AI
|
|
563
563
|
*/
|
|
@@ -568,7 +568,7 @@ export type AllAiAgentChatOptions = {
|
|
|
568
568
|
* A definition of an AI agent with its properties and default chat options.
|
|
569
569
|
* @category AI
|
|
570
570
|
*/
|
|
571
|
-
export interface AiAgent<T extends
|
|
571
|
+
export interface AiAgent<T extends AiChatModelSelection | undefined = undefined> {
|
|
572
572
|
/** The unique identifier of the AI agent. */
|
|
573
573
|
id: AiAgentId;
|
|
574
574
|
/** The date and time the agent was created. */
|
|
@@ -773,7 +773,7 @@ export interface FileContextRequest extends BaseContextRequest {
|
|
|
773
773
|
/** The minimum size for extracted images, if applicable. */
|
|
774
774
|
imageMinSizePixels?: number;
|
|
775
775
|
/** The AI model to use for extraction, if specified. */
|
|
776
|
-
extractionModel?:
|
|
776
|
+
extractionModel?: AiChatModelSelection;
|
|
777
777
|
/** General options for how to process the file. */
|
|
778
778
|
options?: AiContextFileOptions;
|
|
779
779
|
/** The preferred method for extracting data from the document. */
|
|
@@ -8,7 +8,7 @@ export declare const RERANK_PROVIDERS: readonly ["cohere", "none"];
|
|
|
8
8
|
*/
|
|
9
9
|
export type AiRerankProvider = (typeof RERANK_PROVIDERS)[number];
|
|
10
10
|
/** List of available AI provider types. See AiProviderType. */
|
|
11
|
-
export declare const AI_PROVIDER_TYPES: readonly ["anthropic", "bedrock", "claude-code", "flux", "gemini", "openai", "grok", "stability", "voyage", "mistral", "textract", "external"];
|
|
11
|
+
export declare const AI_PROVIDER_TYPES: readonly ["anthropic", "bedrock", "claude-code", "cohere", "flux", "gemini", "openai", "grok", "stability", "voyage", "mistral", "textract", "external"];
|
|
12
12
|
/**
|
|
13
13
|
* Type of the AI provider.
|
|
14
14
|
* References a single AI service, regardless of the model or other AI function it provides (like
|
|
@@ -181,6 +181,13 @@ export type StableDiffusionModelName = (typeof STABLE_DIFFUSION_MODEL_NAMES)[num
|
|
|
181
181
|
* @category AI
|
|
182
182
|
*/
|
|
183
183
|
export type FluxModelName = (typeof FLUX_MODEL_NAMES)[number];
|
|
184
|
+
/** Represents an AI model. */
|
|
185
|
+
export interface ModelIdSpec {
|
|
186
|
+
/** The model ID used for API calls. */
|
|
187
|
+
modelId: AiChatModelName;
|
|
188
|
+
/** The integration ID if this model comes from an integration (OpenAI-compatible, Bedrock). Is undefined for Squid-provided models. */
|
|
189
|
+
integrationId?: string;
|
|
190
|
+
}
|
|
184
191
|
/**
|
|
185
192
|
* Type guard to check if a model selection is integration-based.
|
|
186
193
|
* @category AI
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AgentContextRequest, UpsertContextStatusError } from './ai-agent.public-types';
|
|
2
|
-
import {
|
|
1
|
+
import { AgentContextRequest, AiChatModelSelection, UpsertContextStatusError } from './ai-agent.public-types';
|
|
2
|
+
import { AiEmbeddingsModelName, AiRerankProvider } from './ai-common.public-types';
|
|
3
3
|
import { AiContextId, AiKnowledgeBaseId, AppId } from './communication.public-types';
|
|
4
4
|
import { DocumentExtractionMethod } from './extraction.public-types';
|
|
5
5
|
/**
|
|
@@ -18,7 +18,7 @@ export interface AiKnowledgeBase {
|
|
|
18
18
|
/** The embedding model name that should be used for this knowledge base.*/
|
|
19
19
|
embeddingModel: AiEmbeddingsModelName;
|
|
20
20
|
/** The model name that should be used when asking questions of this knowledge base. */
|
|
21
|
-
chatModel:
|
|
21
|
+
chatModel: AiChatModelSelection;
|
|
22
22
|
/** The timestamp the knowledge base was last updated */
|
|
23
23
|
updatedAt: Date;
|
|
24
24
|
}
|
|
@@ -125,7 +125,7 @@ export interface AiKnowledgeBaseChatOptions {
|
|
|
125
125
|
/** How many chunks to look over. Defaults to 100 */
|
|
126
126
|
chunkLimit?: number;
|
|
127
127
|
/** Which chat model to use when asking the question */
|
|
128
|
-
chatModel?:
|
|
128
|
+
chatModel?: AiChatModelSelection;
|
|
129
129
|
}
|
|
130
130
|
/**
|
|
131
131
|
* @category AI
|
|
@@ -216,7 +216,7 @@ export interface AiKnowledgeBaseFileContextRequest extends BaseAiKnowledgeBaseCo
|
|
|
216
216
|
/** The minimum size for extracted images, if applicable. */
|
|
217
217
|
imageMinSizePixels?: number;
|
|
218
218
|
/** The AI model to use for extraction, if specified. */
|
|
219
|
-
imageExtractionModel?:
|
|
219
|
+
imageExtractionModel?: AiChatModelSelection;
|
|
220
220
|
/** General options for how to process the file. */
|
|
221
221
|
options?: AiKnowledgeBaseContextFileOptions;
|
|
222
222
|
/** The preferred method for extracting data from the document. */
|
|
@@ -262,7 +262,7 @@ export interface AiKnowledgeBaseSearchOptions {
|
|
|
262
262
|
/** How many chunks to look over. Defaults to 100 */
|
|
263
263
|
chunkLimit?: number;
|
|
264
264
|
/** Which chat model to use when asking the question */
|
|
265
|
-
chatModel?:
|
|
265
|
+
chatModel?: AiChatModelSelection;
|
|
266
266
|
}
|
|
267
267
|
/**
|
|
268
268
|
* A single chunk of data returned from an AI search operation.
|
|
@@ -320,7 +320,7 @@ export interface BaseAiKnowledgeBaseSearchContextsRequest {
|
|
|
320
320
|
/** Whether to rerank the results with AI and provide reasoning - defaults to true */
|
|
321
321
|
rerank?: boolean;
|
|
322
322
|
/** Which chat model to use when doing reranking */
|
|
323
|
-
chatModel?:
|
|
323
|
+
chatModel?: AiChatModelSelection;
|
|
324
324
|
}
|
|
325
325
|
/**
|
|
326
326
|
* Request structure for searching AI contexts in the AiKnowledgeBase with prompt.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { AiAgent, AiChatMessage, AiChatModelSelection, AiConnectedAgentMetadata, AiStatusMessage, AiTranscribeAndAskResponse, AllAiAgentChatOptions, GuardrailsOptions, ListAgentRevisionsResponse, UpsertAgentRequest } from '../../../internal-common/src/public-types/ai-agent.public-types';
|
|
3
|
-
import { AiChatModelName } from '../../../internal-common/src/public-types/ai-common.public-types';
|
|
4
3
|
import { JobId } from '../../../internal-common/src/public-types/job.public-types';
|
|
5
4
|
import { Paths } from '../../../internal-common/src/public-types/typescript.public-types';
|
|
6
5
|
import { AiAskOptions, AiAskOptionsWithVoice, AiChatOptionsWithoutVoice, AskResponse, AskWithVoiceResponse, TranscribeAndAskWithVoiceResponse, TranscribeAndChatResponse } from './ai-agent-client.types';
|
|
@@ -96,7 +95,7 @@ export declare class AiAgentReference {
|
|
|
96
95
|
* `squid.jobs().getJob(jobId)` to track progress. Make sure each job ID is both unique and kept private—anyone who
|
|
97
96
|
* knows it can look up the job’s status.
|
|
98
97
|
*/
|
|
99
|
-
chat<T extends
|
|
98
|
+
chat<T extends AiChatModelSelection | undefined>(prompt: string, options?: AiChatOptionsWithoutVoice<T>, jobId?: JobId): Observable<string>;
|
|
100
99
|
/**
|
|
101
100
|
* Transcribes the given file and performs a chat interaction.
|
|
102
101
|
* @param fileToTranscribe The audio file to transcribe and send to the agent.
|
|
@@ -114,7 +113,7 @@ export declare class AiAgentReference {
|
|
|
114
113
|
* `squid.jobs().getJob(jobId)` to track progress. Make sure each job ID is both unique and kept private—anyone who
|
|
115
114
|
* knows it can look up the job’s status.
|
|
116
115
|
*/
|
|
117
|
-
ask<T extends
|
|
116
|
+
ask<T extends AiChatModelSelection | undefined = undefined>(prompt: string, options?: AiAskOptions<T>, jobId?: JobId): Promise<string>;
|
|
118
117
|
/**
|
|
119
118
|
* Sends a prompt and returns the string response and file annotations.
|
|
120
119
|
* @param prompt The text prompt to send to the agent.
|
|
@@ -123,7 +122,7 @@ export declare class AiAgentReference {
|
|
|
123
122
|
* `squid.jobs().getJob(jobId)` to track progress. Make sure each job ID is both unique and kept private—anyone who
|
|
124
123
|
* knows it can look up the job’s status.
|
|
125
124
|
*/
|
|
126
|
-
askWithAnnotations<T extends
|
|
125
|
+
askWithAnnotations<T extends AiChatModelSelection | undefined = undefined>(prompt: string, options?: AiAskOptions<T>, jobId?: JobId): Promise<AskResponse>;
|
|
127
126
|
/**
|
|
128
127
|
* Sends a prompt and not wait for the result - the result can be tracked using the job ID
|
|
129
128
|
* (`squid.jobs().awaitJob(jobId)` or `squid.jobs().getJob(jobId)).
|
|
@@ -134,7 +133,7 @@ export declare class AiAgentReference {
|
|
|
134
133
|
to track progress. Make sure each job ID is both unique and kept private—anyone who knows it can look up the job’s status.
|
|
135
134
|
* @param options Optional parameters for the AI ask request.
|
|
136
135
|
*/
|
|
137
|
-
askAsync<T extends
|
|
136
|
+
askAsync<T extends AiChatModelSelection | undefined = undefined>(prompt: string, jobId: JobId, options?: AiAskOptions<T>): Promise<void>;
|
|
138
137
|
/**
|
|
139
138
|
* Observes live status messages from the agent.
|
|
140
139
|
* @param jobId The job ID to filter status updates for a specific job. If not provided, all status updates for the agent are observed.
|
|
@@ -153,7 +152,7 @@ export declare class AiAgentReference {
|
|
|
153
152
|
* `squid.jobs().getJob(jobId)` to track progress. Make sure each job ID is both unique and kept private—anyone who
|
|
154
153
|
* knows it can look up the job’s status.
|
|
155
154
|
*/
|
|
156
|
-
transcribeAndAsk<T extends
|
|
155
|
+
transcribeAndAsk<T extends AiChatModelSelection | undefined>(fileToTranscribe: File, options?: AiAskOptions<T>, jobId?: JobId): Promise<AiTranscribeAndAskResponse>;
|
|
157
156
|
/**
|
|
158
157
|
* Transcribes audio and gets both text and voice response from the agent.
|
|
159
158
|
* @param fileToTranscribe The audio file to transcribe and send to the agent.
|
|
@@ -162,7 +161,7 @@ export declare class AiAgentReference {
|
|
|
162
161
|
* `squid.jobs().getJob(jobId)` to track progress. Make sure each job ID is both unique and kept private—anyone who
|
|
163
162
|
* knows it can look up the job’s status.
|
|
164
163
|
*/
|
|
165
|
-
transcribeAndAskWithVoiceResponse<T extends
|
|
164
|
+
transcribeAndAskWithVoiceResponse<T extends AiChatModelSelection | undefined>(fileToTranscribe: File, options?: AiAskOptionsWithVoice<T>, jobId?: JobId): Promise<TranscribeAndAskWithVoiceResponse>;
|
|
166
165
|
/**
|
|
167
166
|
* Sends a prompt and gets both text and voice response from the agent.
|
|
168
167
|
* @param prompt The text prompt to send to the agent.
|
|
@@ -171,7 +170,7 @@ export declare class AiAgentReference {
|
|
|
171
170
|
* `squid.jobs().getJob(jobId)` to track progress. Make sure each job ID is both unique and kept private—anyone who
|
|
172
171
|
* knows it can look up the job’s status.
|
|
173
172
|
*/
|
|
174
|
-
askWithVoiceResponse<T extends
|
|
173
|
+
askWithVoiceResponse<T extends AiChatModelSelection | undefined>(prompt: string, options?: AiAskOptionsWithVoice<T>, jobId?: JobId): Promise<AskWithVoiceResponse>;
|
|
175
174
|
/**
|
|
176
175
|
* Sets a value at a specific path within the agent's options.
|
|
177
176
|
*/
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { AiAnnotation, AiChatOptions } from '../../../internal-common/src/public-types/ai-agent.public-types';
|
|
3
|
-
import { AiChatModelName } from '../../../internal-common/src/public-types/ai-common.public-types';
|
|
2
|
+
import { AiAnnotation, AiChatModelSelection, AiChatOptions } from '../../../internal-common/src/public-types/ai-agent.public-types';
|
|
4
3
|
/**
|
|
5
4
|
* Response format for transcribing audio and generating a chat response.
|
|
6
5
|
* Contains the transcribed text and a stream of AI-generated responses.
|
|
@@ -50,20 +49,20 @@ export interface AskWithVoiceResponse {
|
|
|
50
49
|
* Chat options that exclude voice-specific configurations.
|
|
51
50
|
* @category AI
|
|
52
51
|
*/
|
|
53
|
-
export type AiChatOptionsWithoutVoice<T extends
|
|
52
|
+
export type AiChatOptionsWithoutVoice<T extends AiChatModelSelection | undefined = undefined> = Omit<AiChatOptions<T>, 'voiceOptions'> & {
|
|
54
53
|
model?: T;
|
|
55
54
|
};
|
|
56
55
|
/**
|
|
57
56
|
* Options for AI-generated responses that exclude voice-specific settings and smooth typing behavior.
|
|
58
57
|
* @category AI
|
|
59
58
|
*/
|
|
60
|
-
export type AiAskOptions<T extends
|
|
59
|
+
export type AiAskOptions<T extends AiChatModelSelection | undefined = undefined> = Omit<AiChatOptions<T>, 'voiceOptions' | 'smoothTyping'> & {
|
|
61
60
|
model?: T;
|
|
62
61
|
};
|
|
63
62
|
/**
|
|
64
63
|
* Options for AI-generated responses that include voice-specific settings but excludes smooth typing.
|
|
65
64
|
* @category AI
|
|
66
65
|
*/
|
|
67
|
-
export type AiAskOptionsWithVoice<T extends
|
|
66
|
+
export type AiAskOptionsWithVoice<T extends AiChatModelSelection | undefined = undefined> = Omit<AiChatOptions<T>, 'smoothTyping'> & {
|
|
68
67
|
model?: T;
|
|
69
68
|
};
|
|
@@ -8,7 +8,7 @@ import { AiFilesClient } from './ai-files-client';
|
|
|
8
8
|
import { AiImageClient } from './ai-image-client';
|
|
9
9
|
import { AiKnowledgeBaseReference } from './ai-knowledge-base/ai-knowledge-base-client-reference';
|
|
10
10
|
import { AiMatchMakingClient } from './ai-matchmaking-client';
|
|
11
|
-
import { AiAgent, AiAgentApiIntegrationOptions, AiAgentId, AiFileProviderType, AiKnowledgeBase, AiKnowledgeBaseId, AiProviderType, AiSessionContext, AiStatusMessage, ApplicationAiSettings, IntegrationId, JobId, SecretKey } from './public-types';
|
|
11
|
+
import { AiAgent, AiAgentApiIntegrationOptions, AiAgentId, AiFileProviderType, AiKnowledgeBase, AiKnowledgeBaseId, AiProviderType, AiSessionContext, AiStatusMessage, ApplicationAiSettings, IntegrationId, JobId, ModelIdSpec, SecretKey } from './public-types';
|
|
12
12
|
/**
|
|
13
13
|
* AiClient class serves as a facade for interacting with different AI services.
|
|
14
14
|
* It provides simplified access to AI chatbot and assistant functionalities
|
|
@@ -44,6 +44,11 @@ export declare class AiClient {
|
|
|
44
44
|
* @returns A promise that resolves to an array of AI function metadata.
|
|
45
45
|
*/
|
|
46
46
|
listFunctions(): Promise<Array<AiFunctionMetadata>>;
|
|
47
|
+
/**
|
|
48
|
+
* Returns a list of all available AI chat models.
|
|
49
|
+
* Includes both Squid-provided vendor models and custom integration models.
|
|
50
|
+
*/
|
|
51
|
+
listChatModels(): Promise<ModelIdSpec[]>;
|
|
47
52
|
/**
|
|
48
53
|
* Retrieves an AI image client.
|
|
49
54
|
*/
|
|
@@ -49,6 +49,26 @@ export interface ManagementCreateApplicationResponse {
|
|
|
49
49
|
/** The API key for the prod environment */
|
|
50
50
|
prodApiKey: string;
|
|
51
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Request to rename an organization.
|
|
54
|
+
* @category ManagementClient
|
|
55
|
+
*/
|
|
56
|
+
export interface ManagementRenameOrganizationRequest {
|
|
57
|
+
/** The ID of the organization to rename */
|
|
58
|
+
organizationId: string;
|
|
59
|
+
/** New name for the organization (2-50 characters) */
|
|
60
|
+
name: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Request to rename an application.
|
|
64
|
+
* @category ManagementClient
|
|
65
|
+
*/
|
|
66
|
+
export interface ManagementRenameApplicationRequest {
|
|
67
|
+
/** The ID of the application to rename */
|
|
68
|
+
appId: string;
|
|
69
|
+
/** New name for the application */
|
|
70
|
+
name: string;
|
|
71
|
+
}
|
|
52
72
|
/**
|
|
53
73
|
* Client for programmatic management of Squid organizations and applications.
|
|
54
74
|
*
|
|
@@ -114,4 +134,20 @@ export declare class ManagementClient {
|
|
|
114
134
|
* @throws Error if user is not admin or application not found
|
|
115
135
|
*/
|
|
116
136
|
deleteApplication(appId: string): Promise<void>;
|
|
137
|
+
/**
|
|
138
|
+
* Renames an organization.
|
|
139
|
+
* Requires the user to be an admin in the organization.
|
|
140
|
+
*
|
|
141
|
+
* @param request - The rename request containing organizationId and new name
|
|
142
|
+
* @throws Error if user is not admin or organization not found
|
|
143
|
+
*/
|
|
144
|
+
renameOrganization(request: ManagementRenameOrganizationRequest): Promise<void>;
|
|
145
|
+
/**
|
|
146
|
+
* Renames an application.
|
|
147
|
+
* Requires the user to be an admin in the application's organization.
|
|
148
|
+
*
|
|
149
|
+
* @param request - The rename request containing appId and new name
|
|
150
|
+
* @throws Error if user is not admin or application not found
|
|
151
|
+
*/
|
|
152
|
+
renameApplication(request: ManagementRenameApplicationRequest): Promise<void>;
|
|
117
153
|
}
|
|
@@ -149,6 +149,8 @@ export declare class Squid {
|
|
|
149
149
|
* Returns the application ID of the current Squid instance.
|
|
150
150
|
*/
|
|
151
151
|
get appId(): AppId;
|
|
152
|
+
/** Set to true if the client was destructured. */
|
|
153
|
+
get isDestructed(): boolean;
|
|
152
154
|
/**
|
|
153
155
|
* Returns the global Squid instance with the given options, creating a new instance if one with the same options
|
|
154
156
|
* does not exist.
|
|
@@ -379,8 +381,6 @@ export declare class Squid {
|
|
|
379
381
|
* @returns A promise that resolves when the destruct process is complete.
|
|
380
382
|
*/
|
|
381
383
|
destruct(): Promise<void>;
|
|
382
|
-
/** Set to true if the client was destructured. */
|
|
383
|
-
get isDestructed(): boolean;
|
|
384
384
|
/** Provides information about the connection to the Squid Server. */
|
|
385
385
|
connectionDetails(): ConnectionDetails;
|
|
386
386
|
/** Returns the notification client for handling (publishing and receiving) custom messages. */
|
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Names of the Squid metrics.
|
|
3
|
-
* Should be in sync with MetricName.kt.
|
|
4
|
-
* See MetricName.kt for documentation on each value.
|
|
5
|
-
*/
|
|
6
|
-
export declare const ALL_SQUID_METRIC_NAMES: readonly ["squid_functionExecution_count", "squid_functionExecution_time", "squid_aiChatbotContext_size", "squid_aiChatbotChatInputTokens_count", "squid_aiChatbotChatOutputTokens_count", "squid_aiChatbotChatOutcome_count", "squid_aiImageGeneration_count", "squid_aiImageGeneration_time", "squid_aiRemoveBackground_count", "squid_aiRemoveBackground_time", "squid_aiAudioTranscribe_count", "squid_aiAudioTranscribe_time", "squid_aiAudioCreateSpeech_count", "squid_aiAudioCreateSpeech_time", "squid_aiIntegrationData_count", "squid_aiIntegrationData_time", "squid_aiIntegrationApi_count", "squid_aiIntegrationApi_time", "squid_apiControllerCall_count", "squid_apiControllerCall_time", "squid_aiContextUpsert_count", "squid_aiContextDelete_count", "squid_codeInitialization_count", "squid_codeInitialization_time", "squid_deleteApiKey_count", "squid_deleteApiKey_time", "squid_deleteSecret_count", "squid_deleteSecret_time", "squid_discoverGraphQLConnectionSchema_count", "squid_discoverGraphQLConnectionSchema_time", "squid_discoverOpenApiSchema_count", "squid_discoverOpenApiSchema_time", "squid_discoverOpenApiSchemaFromFile_count", "squid_discoverOpenApiSchemaFromFile_time", "squid_executeBackendFunction_count", "squid_executeBackendFunction_time", "squid_getAiChatbotProfiles_count", "squid_getAiChatbotProfiles_time", "squid_getAllApiKeys_count", "squid_getAllApiKeys_time", "squid_getAllSecrets_count", "squid_getAllSecrets_time", "squid_getAppApiKey_count", "squid_getAppApiKey_time", "squid_getSecret_count", "squid_getSecret_time", "squid_graphql_count", "squid_graphql_time", "squid_graphqlQuery_count", "squid_graphqlQuery_time", "squid_integrationCount_value", "squid_acquireLock_count", "squid_releaseLock_count", "squid_mutate_count", "squid_mutate_time", "squid_metricQuery_count", "squid_metricQuery_time", "squid_metricReport_count", "squid_metricReport_time", "squid_nativeQuery_count", "squid_nativeQuery_time", "squid_openapi_count", "squid_openapi_time", "squid_produceTopicMessage_count", "squid_produceTopicMessage_time", "squid_query_count", "squid_query_time", "squid_registerQuery_count", "squid_registerQuery_time", "squid_rerankChunks_count", "squid_rerankChunks_time", "squid_schedulerJob_count", "squid_schedulerJob_time", "squid_schema_size", "squid_secrets_entries", "squid_storageDeleteFiles_count", "squid_storageDeleteFiles_time", "squid_storageGetDownloadUrl_count", "squid_storageGetDownloadUrl_time", "squid_storageGetFileMetadata_count", "squid_storageGetFileMetadata_time", "squid_storageListDirectoryContents_count", "squid_storageListDirectoryContents_time", "squid_storageUploadFile_count", "squid_storageUploadFile_time", "squid_subscribeToTopic_count", "squid_subscribeToTopic_time", "squid_testGraphQLConnection_count", "squid_testGraphQLConnection_time", "squid_testAgentProtocolConnection_count", "squid_testAgentProtocolConnection_time", "squid_trigger_count", "squid_trigger_time", "squid_upsertApiKey_count", "squid_upsertApiKey_time", "squid_upsertSecret_count", "squid_upsertSecret_time", "squid_vectorChunks_count", "squid_vectorChunks_time", "squid_webhook_count", "squid_webhook_time"];
|
|
7
|
-
export type MetricName = (typeof ALL_SQUID_METRIC_NAMES)[number];
|
|
8
|
-
/** Common prefix for all Squid metrics. */
|
|
9
|
-
export declare const SQUID_METRIC_NAME_PREFIX = "squid_";
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ApiOptions } from '../public-types/api-client.public-types';
|
|
2
|
-
import { ApiEndpointId, HttpMethod } from '../public-types/api.public-types';
|
|
3
|
-
import { IntegrationId } from '../public-types/communication.public-types';
|
|
4
|
-
/** The headers of an API call. */
|
|
5
|
-
export type ApiHeaders = Record<string, string | number | boolean>;
|
|
6
|
-
/** The context of an API call. */
|
|
7
|
-
export declare class ApiCallContext {
|
|
8
|
-
readonly integrationId: IntegrationId;
|
|
9
|
-
readonly endpointId: ApiEndpointId;
|
|
10
|
-
readonly url: string;
|
|
11
|
-
readonly method: HttpMethod;
|
|
12
|
-
readonly body: unknown;
|
|
13
|
-
readonly options: ApiOptions;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Represents a request to call an API through a specified integration and endpoint.
|
|
17
|
-
* Includes optional method override and additional request options.
|
|
18
|
-
*/
|
|
19
|
-
export interface CallApiRequest<BodyType = any> {
|
|
20
|
-
/** The identifier of the integration through which the API is called. */
|
|
21
|
-
integrationId: IntegrationId;
|
|
22
|
-
/** Target API endpoint to invoke. */
|
|
23
|
-
endpointId: ApiEndpointId;
|
|
24
|
-
/** Optional request payload. */
|
|
25
|
-
body?: BodyType;
|
|
26
|
-
/** Optional HTTP method override. Default is POST. */
|
|
27
|
-
overrideMethod?: HttpMethod;
|
|
28
|
-
/** Additional request options. */
|
|
29
|
-
options: ApiOptions;
|
|
30
|
-
}
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { SquidDocIdObj, SquidDocument } from '../public-types/document.public-types';
|
|
2
|
-
import { Paths } from '../public-types/typescript.public-types';
|
|
3
|
-
/**
|
|
4
|
-
* The mutation type.
|
|
5
|
-
* @category Database
|
|
6
|
-
*/
|
|
7
|
-
export declare const MUTATION_TYPES: readonly ["insert", "update", "delete"];
|
|
8
|
-
/**
|
|
9
|
-
* @category Database
|
|
10
|
-
*/
|
|
11
|
-
export type MutationType = (typeof MUTATION_TYPES)[number];
|
|
12
|
-
interface BaseMutation {
|
|
13
|
-
type: MutationType;
|
|
14
|
-
squidDocIdObj: SquidDocIdObj;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* A mutation on a document.
|
|
18
|
-
* @category Database
|
|
19
|
-
*/
|
|
20
|
-
export type Mutation<T = any> = UpdateMutation<T> | InsertMutation<T> | DeleteMutation;
|
|
21
|
-
/**
|
|
22
|
-
* Represents a delete mutation on a document.
|
|
23
|
-
* @category Database
|
|
24
|
-
*/
|
|
25
|
-
export interface DeleteMutation extends BaseMutation {
|
|
26
|
-
/** Specifies that the mutation is a deletion. */
|
|
27
|
-
type: 'delete';
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Represents an update mutation on a document.
|
|
31
|
-
* @category Database
|
|
32
|
-
*/
|
|
33
|
-
export interface UpdateMutation<T = any> extends BaseMutation {
|
|
34
|
-
/** Specifies that the mutation is an update. */
|
|
35
|
-
type: 'update';
|
|
36
|
-
/** The updated properties */
|
|
37
|
-
properties: {
|
|
38
|
-
[key in keyof T & string]?: Array<PropertyMutation<T[key]>>;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Represents an insert mutation on a document.
|
|
43
|
-
* @category Database
|
|
44
|
-
*/
|
|
45
|
-
export interface InsertMutation<T = any> extends BaseMutation {
|
|
46
|
-
/** Specifies that the mutation is an insertion. */
|
|
47
|
-
type: 'insert';
|
|
48
|
-
/** The inserted document */
|
|
49
|
-
properties: T;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* A representation of a single property update.
|
|
53
|
-
* @category Database
|
|
54
|
-
*/
|
|
55
|
-
export type PropertyMutation<Value = any> = ApplyNumericFnPropertyMutation | ApplyStringFnPropertyMutation | ValueUpdatePropertyMutation<Value> | RemovePropertyMutation;
|
|
56
|
-
/**
|
|
57
|
-
* A value update property mutation.
|
|
58
|
-
* @category Database
|
|
59
|
-
*/
|
|
60
|
-
export interface ValueUpdatePropertyMutation<Value = any> {
|
|
61
|
-
/** Specifies that the mutation updates a value. */
|
|
62
|
-
type: 'update';
|
|
63
|
-
/** New value to be set. */
|
|
64
|
-
value: Value;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Applying a numeric function to a property.
|
|
68
|
-
* @category Database
|
|
69
|
-
*/
|
|
70
|
-
export interface ApplyNumericFnPropertyMutation {
|
|
71
|
-
/** Specifies that the mutation applies a numeric function. */
|
|
72
|
-
type: 'applyNumericFn';
|
|
73
|
-
/** Numeric function to apply. */
|
|
74
|
-
fn: 'increment';
|
|
75
|
-
/** Value to use in the numeric function. */
|
|
76
|
-
value: number;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* A property update that removes a property from a document.
|
|
80
|
-
* @category Database
|
|
81
|
-
*/
|
|
82
|
-
export interface RemovePropertyMutation {
|
|
83
|
-
/** Specifies that the mutation removes a property. */
|
|
84
|
-
type: 'removeProperty';
|
|
85
|
-
}
|
|
86
|
-
interface ApplyExtendString {
|
|
87
|
-
/** Specifies that the mutation applies a string function. */
|
|
88
|
-
type: 'applyStringFn';
|
|
89
|
-
/** String function to extend the existing string. */
|
|
90
|
-
fn: 'extendString';
|
|
91
|
-
/** String value to append. */
|
|
92
|
-
value: string;
|
|
93
|
-
}
|
|
94
|
-
interface ApplyTrimString {
|
|
95
|
-
/** Specifies that the mutation applies a string function. */
|
|
96
|
-
type: 'applyStringFn';
|
|
97
|
-
/** String function to trim the existing string. */
|
|
98
|
-
fn: 'trim';
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* A property mutation that modifies a string.
|
|
102
|
-
* @category Database
|
|
103
|
-
*/
|
|
104
|
-
export type ApplyStringFnPropertyMutation = ApplyExtendString | ApplyTrimString;
|
|
105
|
-
/**
|
|
106
|
-
* The before and after documents of a document change.
|
|
107
|
-
* @category Database
|
|
108
|
-
*/
|
|
109
|
-
export interface BeforeAndAfterDocs<T = SquidDocument> {
|
|
110
|
-
/** Document state before the mutation. */
|
|
111
|
-
before: T | undefined;
|
|
112
|
-
/** Document state after the mutation. */
|
|
113
|
-
after: T | undefined;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* The mutation context that will be provided to the security function.
|
|
117
|
-
* @category Database
|
|
118
|
-
*/
|
|
119
|
-
export declare class MutationContext<T = any> {
|
|
120
|
-
readonly mutation: Mutation<T>;
|
|
121
|
-
readonly beforeAndAfterDocs: BeforeAndAfterDocs<T>;
|
|
122
|
-
readonly serverTimeStamp: Date;
|
|
123
|
-
/**
|
|
124
|
-
* Returns the state of the document before the mutation was applied.
|
|
125
|
-
*/
|
|
126
|
-
get before(): T | undefined;
|
|
127
|
-
/**
|
|
128
|
-
* Returns the state of the document after the mutation was applied.
|
|
129
|
-
*/
|
|
130
|
-
get after(): T | undefined;
|
|
131
|
-
/**
|
|
132
|
-
* Returns the type of the mutation (insert, update, or delete).
|
|
133
|
-
*/
|
|
134
|
-
getMutationType(): MutationType;
|
|
135
|
-
/** Returns true if the mutation affects the provided path. */
|
|
136
|
-
affectsPath(path: Paths<T>): boolean;
|
|
137
|
-
/**
|
|
138
|
-
* Find all affected paths starting from a root path.
|
|
139
|
-
*
|
|
140
|
-
* @example
|
|
141
|
-
* doc before - { a: { b: 1, c: 2 }, d: 3 }
|
|
142
|
-
* doc after - { a: { b: 1, c: 3 }, d: 4 }
|
|
143
|
-
* doc.affectedPaths('a') // ['a.c']
|
|
144
|
-
*/
|
|
145
|
-
affectedPaths(startingRoot?: Paths<T> | string): Array<Paths<T>>;
|
|
146
|
-
private checkPath;
|
|
147
|
-
}
|
|
148
|
-
export {};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { IntegrationId } from '../public-types/communication.public-types';
|
|
2
|
-
/**
|
|
3
|
-
* Represents the type of native query request, either relational, elastic or MongoDB.
|
|
4
|
-
* @category Database
|
|
5
|
-
*/
|
|
6
|
-
export type NativeQueryRequestType = 'relational' | 'mongo' | 'elasticsearch' | 'pure';
|
|
7
|
-
interface BaseNativeQueryContext {
|
|
8
|
-
/** Type of the native query request. */
|
|
9
|
-
type: NativeQueryRequestType;
|
|
10
|
-
/** Identifier for the integration. */
|
|
11
|
-
integrationId: IntegrationId;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Context for executing a relational database query.
|
|
15
|
-
* @category Database
|
|
16
|
-
*/
|
|
17
|
-
export interface RelationalNativeQueryContext extends BaseNativeQueryContext {
|
|
18
|
-
/** Specifies that the query is for a relational database. */
|
|
19
|
-
type: 'relational';
|
|
20
|
-
/** SQL query string to be executed. */
|
|
21
|
-
query: string;
|
|
22
|
-
/** Parameters to be used in the query. */
|
|
23
|
-
params: Record<string, any>;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Context for executing a MongoDB query.
|
|
27
|
-
* @category Database
|
|
28
|
-
*/
|
|
29
|
-
export interface MongoNativeQueryContext extends BaseNativeQueryContext {
|
|
30
|
-
/** Specifies that the query is for a Mongo database. */
|
|
31
|
-
type: 'mongo';
|
|
32
|
-
/** Name of the MongoDB collection to query. */
|
|
33
|
-
collectionName: string;
|
|
34
|
-
/** Array of aggregation pipeline stages. */
|
|
35
|
-
aggregationPipeline: Array<any | undefined>;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Context for executing an Elasticsearch query.
|
|
39
|
-
* @category Database
|
|
40
|
-
*/
|
|
41
|
-
export interface ElasticsearchNativeQueryContext {
|
|
42
|
-
/** Specifies that the query is for an Elasticsearch database. */
|
|
43
|
-
type: 'elasticsearch';
|
|
44
|
-
/** Elasticsearch index to query. */
|
|
45
|
-
index: string;
|
|
46
|
-
/** Elasticsearch query string. */
|
|
47
|
-
endpoint?: string;
|
|
48
|
-
/** HTTP method to use for the request. */
|
|
49
|
-
method?: 'GET' | 'POST';
|
|
50
|
-
/** Body of the request. */
|
|
51
|
-
body: Record<string, any>;
|
|
52
|
-
/** Headers to include in the request. */
|
|
53
|
-
integrationId: IntegrationId;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Context for executing a pure database query.
|
|
57
|
-
* @category Database
|
|
58
|
-
*/
|
|
59
|
-
export interface PureNativeQueryContext extends BaseNativeQueryContext {
|
|
60
|
-
/** Specifies that the query is for a relational database. */
|
|
61
|
-
type: 'pure';
|
|
62
|
-
/** SQL query string to be executed. */
|
|
63
|
-
query: string;
|
|
64
|
-
/** Parameters to be used in the query. */
|
|
65
|
-
params: Record<string, any>;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Union type representing either a relational or MongoDB native query context.
|
|
69
|
-
* @category Database
|
|
70
|
-
*/
|
|
71
|
-
export type NativeQueryContext = RelationalNativeQueryContext | MongoNativeQueryContext | ElasticsearchNativeQueryContext | PureNativeQueryContext;
|
|
72
|
-
export {};
|