@squidcloud/client 1.0.327 → 1.0.329

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.
Files changed (25) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +4 -5
  3. package/dist/internal-common/src/public-types/ai-assistant.public-types.d.ts +5 -2
  4. package/dist/typescript-client/src/admin-client.d.ts +4 -0
  5. package/dist/typescript-client/src/agent/ai-agent-client-reference.d.ts +5 -0
  6. package/dist/typescript-client/src/agent/ai-agent-client.d.ts +5 -0
  7. package/dist/typescript-client/src/ai-audio-client.d.ts +4 -0
  8. package/dist/typescript-client/src/ai-image-client.d.ts +3 -0
  9. package/dist/typescript-client/src/api-client.d.ts +4 -0
  10. package/dist/typescript-client/src/console-utils.d.ts +1 -1
  11. package/dist/typescript-client/src/destruct.manager.d.ts +4 -0
  12. package/dist/typescript-client/src/document-store.d.ts +4 -0
  13. package/dist/typescript-client/src/extraction-client.d.ts +4 -0
  14. package/dist/typescript-client/src/file-utils.d.ts +1 -1
  15. package/dist/typescript-client/src/integration-client.d.ts +4 -0
  16. package/dist/typescript-client/src/query/deserializer.d.ts +1 -4
  17. package/dist/typescript-client/src/query/pagination.d.ts +4 -0
  18. package/dist/typescript-client/src/query/query.types.d.ts +5 -0
  19. package/dist/typescript-client/src/query/snapshot-emitter.d.ts +1 -0
  20. package/dist/typescript-client/src/scheduler-client.d.ts +4 -0
  21. package/dist/typescript-client/src/secret.client.d.ts +8 -0
  22. package/dist/typescript-client/src/squid-http-client.d.ts +0 -36
  23. package/dist/typescript-client/src/storage-client.d.ts +3 -0
  24. package/dist/typescript-client/src/version.d.ts +1 -1
  25. package/package.json +1 -1
@@ -102,7 +102,7 @@ export interface StableDiffusionCoreOptions extends BaseAiGenerateImageOptions {
102
102
  }
103
103
  /** The possible sources for the LLM provider API key. */
104
104
  export type ApiKeySource = 'user' | 'system';
105
- export type OpenAiResponseFormat = 'text' | 'json_object';
105
+ export type AiAgentResponseFormat = 'text' | 'json_object';
106
106
  export type AiFileUrlType = 'image';
107
107
  export interface AiFileUrl {
108
108
  type: AiFileUrlType;
@@ -154,7 +154,7 @@ interface BaseAiAgentChatOptions {
154
154
  /** Whether to include references from the source context in the response. Default to false. */
155
155
  includeReference?: boolean;
156
156
  /** The format of the response from the AI model. Note that not all models support JSON format. Default to 'text'. */
157
- responseFormat?: OpenAiResponseFormat;
157
+ responseFormat?: AiAgentResponseFormat;
158
158
  /** Whether to response in a "smooth typing" way, beneficial when the chat result is displayed in a UI. Default to true. */
159
159
  smoothTyping?: boolean;
160
160
  /** Global context passed to the agent and all AI functions of the agent. */
@@ -192,9 +192,10 @@ export interface OpenAiChatOptions extends BaseAiAgentChatOptions {
192
192
  model?: OpenAiChatModelName;
193
193
  fileUrls?: Array<AiFileUrl>;
194
194
  }
195
+ export type OpenAiReasoningEffort = 'low' | 'medium' | 'high';
195
196
  export interface OpenAiReasoningChatOptions extends OpenAiChatOptions {
196
197
  model?: OpenAiReasoningChatModelName;
197
- reasoningEffort?: 'low' | 'medium' | 'high';
198
+ reasoningEffort?: OpenAiReasoningEffort;
198
199
  }
199
200
  export interface AnthropicChatOptions extends BaseAiAgentChatOptions {
200
201
  model?: AnthropicChatModelName;
@@ -261,8 +262,6 @@ export interface AiSearchRequest {
261
262
  options: AiSearchOptions;
262
263
  agentId: AiAgentId;
263
264
  }
264
- export type AiMutationType = 'insert' | 'update' | 'delete' | 'append' | 'feedback';
265
- export type AiResourceType = 'instruction' | 'profile' | 'context' | 'contexts';
266
265
  export interface AiSearchResponse {
267
266
  chunks: Array<AiSearchResultChunk>;
268
267
  }
@@ -1,4 +1,4 @@
1
- import { OpenAiResponseFormat } from './ai-agent.public-types';
1
+ import { OpenAiChatModelName, OpenAiReasoningEffort, AiAgentResponseFormat } from './ai-agent.public-types';
2
2
  import { FunctionName } from './bundle-data.public-types';
3
3
  export type AssistantToolType = 'code_interpreter' | 'file_search';
4
4
  /** The options for the AI assistant. */
@@ -8,5 +8,8 @@ export interface QueryAssistantOptions {
8
8
  /** Extra context per AI function.*/
9
9
  functionContexts?: Record<FunctionName, Record<string, unknown>>;
10
10
  /** The format of the response from the AI model. Defaults to 'text' */
11
- responseFormat?: OpenAiResponseFormat;
11
+ responseFormat?: AiAgentResponseFormat;
12
+ model?: OpenAiChatModelName;
13
+ reasoningEffort?: OpenAiReasoningEffort;
14
+ instructions?: string;
12
15
  }
@@ -1,5 +1,9 @@
1
1
  import { IntegrationClient } from './integration-client';
2
2
  import { SecretClient } from './secret.client';
3
+ /**
4
+ * AdminClient provides access to application administrative operations,
5
+ * including integrations and secrets management.
6
+ */
3
7
  export declare class AdminClient {
4
8
  private readonly rpcManager;
5
9
  private readonly region;
@@ -3,6 +3,11 @@ import { BlobAndFilename } from '../types';
3
3
  import { Observable } from 'rxjs';
4
4
  import { AskOptionsWithoutVoice, AskWithVoiceResponse, ChatOptionsWithoutVoice, TranscribeAndAskWithVoiceResponse, TranscribeAndChatResponse } from './ai-agent-client.types';
5
5
  export type UpsertAgentRequestParams = Omit<UpsertAgentRequest, 'id'>;
6
+ /**
7
+ * AiAgentReference provides methods for managing AI agents, including
8
+ * retrieving, updating, and deleting agents, handling agent contexts,
9
+ * and interacting with chat or voice-based AI functionalities.
10
+ */
6
11
  export declare class AiAgentReference {
7
12
  private readonly agentId;
8
13
  private readonly ongoingChatSequences;
@@ -1,5 +1,10 @@
1
1
  import { AiAgent, AiAgentId } from '../public-types';
2
2
  import { AiAgentReference } from './ai-agent-client-reference';
3
+ /**
4
+ * AiAgentClient manages AI agent interactions, including listing agents,
5
+ * handling real-time chat responses, and processing AI status updates
6
+ * through WebSocket notifications.
7
+ */
3
8
  export declare class AiAgentClient {
4
9
  private readonly rpcManager;
5
10
  private readonly socketManager;
@@ -1,5 +1,9 @@
1
1
  import { AiAudioCreateSpeechOptions, AiAudioTranscribeOptions } from './public-types';
2
2
  import { BlobAndFilename } from './types';
3
+ /**
4
+ * AiAudioClient provides methods for AI-driven audio processing,
5
+ * including speech transcription and text-to-speech synthesis.
6
+ */
3
7
  export declare class AiAudioClient {
4
8
  private readonly rpcManager;
5
9
  transcribe(file: File | BlobAndFilename, options?: AiAudioTranscribeOptions): Promise<string>;
@@ -1,4 +1,7 @@
1
1
  import { AiGenerateImageOptions } from './public-types';
2
+ /**
3
+ * AiImageClient provides methods for AI-powered image processing.
4
+ */
2
5
  export declare class AiImageClient {
3
6
  private readonly rpcManager;
4
7
  generate(prompt: string, options: AiGenerateImageOptions): Promise<string>;
@@ -2,6 +2,10 @@ import { IntegrationId } from '../../internal-common/src/public-types/communicat
2
2
  import { ApiEndpointId, HttpMethod } from '../../internal-common/src/public-types/integrations/api.public-types';
3
3
  import { HttpResponse } from './squid-http-client';
4
4
  import { ApiOptions } from '../../internal-common/src/public-types/api-client.public-types';
5
+ /**
6
+ * ApiClient facilitates making HTTP API requests to external integrations,
7
+ * supporting various HTTP methods such as GET, POST, PUT, PATCH, and DELETE.
8
+ */
5
9
  export declare class ApiClient {
6
10
  private readonly rpcManager;
7
11
  get<ResponseBodyType = unknown>(integrationId: IntegrationId, endpointId: ApiEndpointId, options?: ApiOptions): Promise<HttpResponse<ResponseBodyType>>;
@@ -1 +1 @@
1
- export declare function getConsoleBaseUrl(appRegion: string, path?: string): string;
1
+ export {};
@@ -1,5 +1,9 @@
1
1
  import { Observable } from 'rxjs';
2
2
  export type DestructorFn = () => Promise<void> | void;
3
+ /**
4
+ * DestructManager handles the execution of pre-destruction and destruction
5
+ * tasks, ensuring proper cleanup of resources in an orderly manner.
6
+ */
3
7
  export declare class DestructManager {
4
8
  private readonly preDestructors;
5
9
  private readonly destructors;
@@ -1,4 +1,8 @@
1
1
  import { Query, SquidDocId, SquidDocument } from './public-types';
2
+ /**
3
+ * DocumentStore manages the storage, retrieval, sorting, and migration
4
+ * of documents, ensuring efficient access and manipulation of stored data.
5
+ */
2
6
  export declare class DocumentStore {
3
7
  private readonly squidDocIdToDoc;
4
8
  saveDocument(squidDocId: SquidDocId, properties: SquidDocument | undefined): SquidDocument | undefined;
@@ -1,5 +1,9 @@
1
1
  import { BlobAndFilename } from './types';
2
2
  import { DocumentTextDataResponse, ExtractDataFromDocumentFileOptions } from '../../internal-common/src/public-types/extraction.public-types';
3
+ /**
4
+ * ExtractionClient provides methods for extracting structured data
5
+ * from document files using AI-driven processing.
6
+ */
3
7
  export declare class ExtractionClient {
4
8
  private readonly rpcManager;
5
9
  extractDataFromDocumentFile(file: File | BlobAndFilename, options?: ExtractDataFromDocumentFileOptions): Promise<DocumentTextDataResponse>;
@@ -1 +1 @@
1
- export declare function base64ToFile(base64: string, filename: string, mimeType?: string): File;
1
+ export {};
@@ -1,4 +1,8 @@
1
1
  import { IntegrationId, IntegrationInfo, IntegrationType } from './public-types';
2
+ /**
3
+ * IntegrationClient manages integrations within an application,
4
+ * providing methods for listing, retrieving, updating, and deleting integrations.
5
+ */
2
6
  export declare class IntegrationClient {
3
7
  private readonly rpcManager;
4
8
  private readonly iacBaseUrl;
@@ -1,4 +1 @@
1
- import { Squid } from '../squid';
2
- import { SerializedQuery } from '../public-types';
3
- import { SnapshotEmitter } from './snapshot-emitter';
4
- export declare function deserializeQuery<ReturnType = any>(squid: Squid, serializedQuery: SerializedQuery): SnapshotEmitter<ReturnType>;
1
+ export {};
@@ -21,6 +21,10 @@ interface InternalState<ReturnType> {
21
21
  numBefore: number;
22
22
  numAfter: number;
23
23
  }
24
+ /**
25
+ * Pagination provides a paginated view over a dataset, supporting navigation
26
+ * through pages, real-time updates, and sorting based on predefined criteria.
27
+ */
24
28
  export declare class Pagination<ReturnType> {
25
29
  private readonly paginateOptions;
26
30
  private internalStateObserver;
@@ -1,5 +1,10 @@
1
1
  import { BehaviorSubject, Observable, ReplaySubject } from 'rxjs';
2
2
  import { Alias, ClientRequestId, JoinCondition, Query, SquidDocument } from '../public-types';
3
+ /**
4
+ * Defines the state and behavior of an ongoing query, including
5
+ * query dependencies, data streaming, join conditions, and limit
6
+ * underflow handling for dynamic data fetching.
7
+ */
3
8
  export interface OngoingQuery {
4
9
  clientRequestId: ClientRequestId;
5
10
  query: Query;
@@ -31,5 +31,6 @@ export interface SnapshotEmitter<ReturnType> {
31
31
  * @param options The pagination options. Defaults to `{ subscribe: true, pageSize: 100 }`.
32
32
  */
33
33
  paginate(options?: Partial<PaginationOptions>): Pagination<ReturnType>;
34
+ /** Serializes the active query used by the emitter. */
34
35
  serialize(): SerializedQuery;
35
36
  }
@@ -1,4 +1,8 @@
1
1
  import { SchedulerInfo } from './public-types';
2
+ /**
3
+ * SchedulerClient provides methods to manage schedulers,
4
+ * including listing, enabling, and disabling scheduled tasks.
5
+ */
2
6
  export declare class SchedulerClient {
3
7
  private readonly rpcManager;
4
8
  list(): Promise<SchedulerInfo[]>;
@@ -1,4 +1,8 @@
1
1
  import { SecretEntry, SecretKey, SecretValue, SetSecretRequestEntry } from './public-types';
2
+ /**
3
+ * SecretClient provides methods for managing secrets, including retrieval,
4
+ * update, and deletion of stored secrets and API keys.
5
+ */
2
6
  export declare class SecretClient {
3
7
  private readonly rpcManager;
4
8
  get(key: SecretKey): Promise<SecretEntry | undefined>;
@@ -27,6 +31,10 @@ export declare class SecretClient {
27
31
  deleteMany(keys: Array<SecretKey>, force?: boolean): Promise<void>;
28
32
  get apiKeys(): ApiKeysSecretClient;
29
33
  }
34
+ /**
35
+ * ApiKeysSecretClient manages API key secrets, providing methods
36
+ * for retrieval, creation, and deletion of API keys.
37
+ */
30
38
  export declare class ApiKeysSecretClient {
31
39
  private readonly rpcManager;
32
40
  get(key: SecretKey): Promise<SecretEntry | undefined>;
@@ -1,28 +1,3 @@
1
- import { BlobAndFilename } from './types';
2
- export declare class RpcError<BodyType = unknown> extends Error {
3
- readonly statusCode: number;
4
- readonly statusText: string;
5
- readonly url: string;
6
- readonly headers: Record<string, string>;
7
- readonly body: BodyType;
8
- }
9
- /**
10
- * A more general request interface for other HTTP methods
11
- * (GET, PUT, PATCH, DELETE).
12
- */
13
- interface HttpRequestInput<RequestBodyType = unknown> {
14
- url: string;
15
- headers: Record<string, string>;
16
- message?: RequestBodyType;
17
- files?: Array<File | BlobAndFilename>;
18
- filesFieldName?: string;
19
- extractErrorMessage: boolean;
20
- /**
21
- * Which method to use. E.g. 'GET', 'PUT', 'PATCH', 'DELETE'...
22
- * For POST, we still use `HttpPostInput` for backward-compat.
23
- */
24
- method: string;
25
- }
26
1
  /** A response object with type T for the body. */
27
2
  export interface HttpResponse<BodyType = unknown> {
28
3
  status: number;
@@ -30,14 +5,3 @@ export interface HttpResponse<BodyType = unknown> {
30
5
  headers: Record<string, string>;
31
6
  body: BodyType;
32
7
  }
33
- export declare function rawSquidHttpGet<ResponseType = unknown, RequestType = unknown>(input: Omit<HttpRequestInput<RequestType>, 'method' | 'files' | 'filesFieldName'>): Promise<HttpResponse<ResponseType>>;
34
- export declare function rawSquidHttpPut<ResponseType = unknown, RequestType = unknown>(input: Omit<HttpRequestInput<RequestType>, 'method'> & {
35
- files?: Array<File | BlobAndFilename>;
36
- filesFieldName?: string;
37
- }): Promise<HttpResponse<ResponseType>>;
38
- export declare function rawSquidHttpPatch<ResponseType = unknown, RequestType = unknown>(input: Omit<HttpRequestInput<RequestType>, 'method'> & {
39
- files?: Array<File | BlobAndFilename>;
40
- filesFieldName?: string;
41
- }): Promise<HttpResponse<ResponseType>>;
42
- export declare function rawSquidHttpDelete<ResponseType = unknown, RequestType = unknown>(input: Omit<HttpRequestInput<RequestType>, 'method' | 'files' | 'filesFieldName'>): Promise<HttpResponse<ResponseType>>;
43
- export {};
@@ -41,6 +41,9 @@ export interface ListDirectoryContentsResponse {
41
41
  directories: Array<string>;
42
42
  files: Array<FileInDirectory>;
43
43
  }
44
+ /**
45
+ * StorageClient provides methods for managing files in a storage system (like S3).
46
+ */
44
47
  export declare class StorageClient {
45
48
  private readonly integrationId;
46
49
  private readonly rpcManager;
@@ -1 +1 @@
1
- export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.327";
1
+ export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.329";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/client",
3
- "version": "1.0.327",
3
+ "version": "1.0.329",
4
4
  "description": "A typescript implementation of the Squid client",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/typescript-client/src/index.d.ts",