@squidcloud/client 1.0.388 → 1.0.389
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 +10 -5
- package/dist/internal-common/src/public-types/backend.public-types.d.ts +4 -4
- package/dist/internal-common/src/types/notification.types.d.ts +5 -0
- package/dist/typescript-client/src/index.d.ts +1 -0
- package/dist/typescript-client/src/notification-client.d.ts +20 -0
- package/dist/typescript-client/src/squid.d.ts +26 -20
- package/dist/typescript-client/src/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -15,20 +15,25 @@ export type AiProviderType = (typeof AI_PROVIDER_TYPES)[number];
|
|
|
15
15
|
* The supported OpenAI models.
|
|
16
16
|
* @category AI
|
|
17
17
|
*/
|
|
18
|
-
export declare const OPENAI_O1_CHAT_MODEL_NAMES: readonly ["o1"
|
|
18
|
+
export declare const OPENAI_O1_CHAT_MODEL_NAMES: readonly ["o1"];
|
|
19
19
|
/**
|
|
20
20
|
* @category AI
|
|
21
21
|
*/
|
|
22
|
-
export declare const OPENAI_REASONING_CHAT_MODEL_NAMES: readonly ["o1", "
|
|
22
|
+
export declare const OPENAI_REASONING_CHAT_MODEL_NAMES: readonly ["o1", "o3", "o3-mini", "o4-mini"];
|
|
23
23
|
/**
|
|
24
24
|
* @category AI
|
|
25
25
|
*/
|
|
26
|
-
export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["gpt-4o", "gpt-4o-mini", "gpt-4.1-nano", "gpt-4.1-mini", "gpt-4.1", "o1", "
|
|
26
|
+
export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["gpt-4o", "gpt-4o-mini", "gpt-4.1-nano", "gpt-4.1-mini", "gpt-4.1", "o1", "o3", "o3-mini", "o4-mini"];
|
|
27
27
|
/**
|
|
28
28
|
* @category AI
|
|
29
29
|
*/
|
|
30
|
-
export declare const GEMINI_CHAT_MODEL_NAMES: readonly ["gemini-2.5-pro", "gemini-2.5-flash"];
|
|
30
|
+
export declare const GEMINI_CHAT_MODEL_NAMES: readonly ["gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite"];
|
|
31
31
|
/**
|
|
32
|
+
* Notes:
|
|
33
|
+
* - 'grok-3-mini' model os ~10x less expensive than 'grok-3'.
|
|
34
|
+
* - '*-fast' models are ~2x more expensive than non-fast variants and only marginally faster.
|
|
35
|
+
* - 'grok-4' cost is comparable to 'grok-3-fast'.
|
|
36
|
+
*
|
|
32
37
|
* @category AI
|
|
33
38
|
*/
|
|
34
39
|
export declare const GROK_CHAT_MODEL_NAMES: readonly ["grok-3", "grok-3-fast", "grok-3-mini", "grok-3-mini-fast", "grok-4"];
|
|
@@ -40,7 +45,7 @@ export declare const ANTHROPIC_CHAT_MODEL_NAMES: readonly ["claude-3-7-sonnet-la
|
|
|
40
45
|
* The supported AI model names.
|
|
41
46
|
* @category AI
|
|
42
47
|
*/
|
|
43
|
-
export declare const VENDOR_AI_CHAT_MODEL_NAMES: readonly ["gpt-4o", "gpt-4o-mini", "gpt-4.1-nano", "gpt-4.1-mini", "gpt-4.1", "o1", "
|
|
48
|
+
export declare const VENDOR_AI_CHAT_MODEL_NAMES: readonly ["gpt-4o", "gpt-4o-mini", "gpt-4.1-nano", "gpt-4.1-mini", "gpt-4.1", "o1", "o3", "o3-mini", "o4-mini", "claude-3-7-sonnet-latest", "claude-opus-4-20250514", "claude-sonnet-4-20250514", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite", "grok-3", "grok-3-fast", "grok-3-mini", "grok-3-mini-fast", "grok-4"];
|
|
44
49
|
/**
|
|
45
50
|
* Check if the given model name is a global AI chat model name.
|
|
46
51
|
*/
|
|
@@ -43,8 +43,8 @@ export type LlmModelMetadata = {
|
|
|
43
43
|
* A friendly name for the model, to display in UIs.
|
|
44
44
|
*/
|
|
45
45
|
displayName: string;
|
|
46
|
-
/**
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
/** Maximum tokens the model can generate in a single response. */
|
|
47
|
+
maxOutputTokens: number;
|
|
48
|
+
/** Total context window size: input (aka prompt) + output (aka completion) tokens combined. */
|
|
49
|
+
contextWindowTokens: number;
|
|
50
50
|
};
|
|
@@ -30,6 +30,7 @@ export * from './integration-client';
|
|
|
30
30
|
export * from './job-client';
|
|
31
31
|
export * from './mutation/mutation-sender';
|
|
32
32
|
export * from './native-query-manager';
|
|
33
|
+
export * from './notification-client';
|
|
33
34
|
export * from './observability-client';
|
|
34
35
|
export * from './personal-storage-client';
|
|
35
36
|
export * from './public-types';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { ClientId } from '../../internal-common/src/public-types/communication.public-types';
|
|
3
|
+
/**
|
|
4
|
+
* NotificationClient is a client for handling user-defined notifications.
|
|
5
|
+
* Using this class you can receive messages that are sent from the server to this client or
|
|
6
|
+
* publish messages to other clients. In order to publish a message you have to initialize the squid sdk with a valid
|
|
7
|
+
* api key.
|
|
8
|
+
*/
|
|
9
|
+
export declare class NotificationClient {
|
|
10
|
+
private readonly socketManager;
|
|
11
|
+
private readonly rpcManager;
|
|
12
|
+
/**
|
|
13
|
+
* Observes user-defined notifications.
|
|
14
|
+
*/
|
|
15
|
+
observeNotifications(): Observable<unknown>;
|
|
16
|
+
/**
|
|
17
|
+
* Publishes a notification to clients.
|
|
18
|
+
*/
|
|
19
|
+
publishNotification(payload: unknown, clientIds: Array<ClientId>): Promise<void>;
|
|
20
|
+
}
|
|
@@ -7,6 +7,7 @@ import { DistributedLock } from './distributed-lock.manager';
|
|
|
7
7
|
import { ExecuteFunctionOptions } from './execute-function-options';
|
|
8
8
|
import { ExtractionClient } from './extraction-client';
|
|
9
9
|
import { JobClient } from './job-client';
|
|
10
|
+
import { NotificationClient } from './notification-client';
|
|
10
11
|
import { ObservabilityClient } from './observability-client';
|
|
11
12
|
import { PersonalStorageClient } from './personal-storage-client';
|
|
12
13
|
import { ApiKey, AppId, CollectionName, DocumentData, EnvironmentId, IntegrationId, SquidDeveloperId, SquidRegion } from './public-types';
|
|
@@ -65,16 +66,16 @@ export interface SquidOptions {
|
|
|
65
66
|
* @category Authentication
|
|
66
67
|
*/
|
|
67
68
|
export interface SquidAuthProvider {
|
|
68
|
-
/**
|
|
69
|
-
* Returns a valid AccessToken or undefined if there is no active authorized session.
|
|
70
|
-
* Called by Squid every time a Squid client makes requests to the Squid backend.
|
|
71
|
-
*/
|
|
72
|
-
getToken(): Promise<string | undefined> | string | undefined;
|
|
73
69
|
/**
|
|
74
70
|
* Optional Auth integration id.
|
|
75
71
|
* Sent as a part of all Squid requests to the backend.
|
|
76
72
|
*/
|
|
77
73
|
integrationId: string;
|
|
74
|
+
/**
|
|
75
|
+
* Returns a valid AccessToken or undefined if there is no active authorized session.
|
|
76
|
+
* Called by Squid every time a Squid client makes requests to the Squid backend.
|
|
77
|
+
*/
|
|
78
|
+
getToken(): Promise<string | undefined> | string | undefined;
|
|
78
79
|
}
|
|
79
80
|
/**
|
|
80
81
|
* The main entry point to the Squid Client SDK.
|
|
@@ -89,6 +90,7 @@ export interface SquidAuthProvider {
|
|
|
89
90
|
*/
|
|
90
91
|
export declare class Squid {
|
|
91
92
|
readonly options: SquidOptions;
|
|
93
|
+
private static readonly squidInstancesMap;
|
|
92
94
|
private readonly socketManager;
|
|
93
95
|
private readonly dataManager;
|
|
94
96
|
private readonly documentReferenceFactory;
|
|
@@ -107,7 +109,6 @@ export declare class Squid {
|
|
|
107
109
|
private readonly clientIdService;
|
|
108
110
|
private readonly _connectionDetails;
|
|
109
111
|
private readonly querySender;
|
|
110
|
-
private static readonly squidInstancesMap;
|
|
111
112
|
private readonly aiClient;
|
|
112
113
|
private readonly jobClient;
|
|
113
114
|
private readonly apiClient;
|
|
@@ -116,6 +117,7 @@ export declare class Squid {
|
|
|
116
117
|
private readonly observabilityClient;
|
|
117
118
|
private readonly queueManagerFactory;
|
|
118
119
|
private readonly schedulerClient;
|
|
120
|
+
private readonly notificationClient;
|
|
119
121
|
private readonly _appId;
|
|
120
122
|
/**
|
|
121
123
|
* Creates a new instance of Squid with the given options.
|
|
@@ -123,6 +125,18 @@ export declare class Squid {
|
|
|
123
125
|
* @param options The options for initializing the Squid instance.
|
|
124
126
|
*/
|
|
125
127
|
constructor(options: SquidOptions);
|
|
128
|
+
/**
|
|
129
|
+
* Returns the observability client for metrics.
|
|
130
|
+
*/
|
|
131
|
+
get observability(): ObservabilityClient;
|
|
132
|
+
/**
|
|
133
|
+
* Returns the scheduler client for managing scheduled jobs and tasks.
|
|
134
|
+
*/
|
|
135
|
+
get schedulers(): SchedulerClient;
|
|
136
|
+
/**
|
|
137
|
+
* Returns the application ID of the current Squid instance.
|
|
138
|
+
*/
|
|
139
|
+
get appId(): AppId;
|
|
126
140
|
/**
|
|
127
141
|
* Returns the global Squid instance with the given options, creating a new instance if one with the same options
|
|
128
142
|
* does not exist.
|
|
@@ -199,8 +213,10 @@ export declare class Squid {
|
|
|
199
213
|
* See https://docs.getsquid.ai/docs/sdk/client-sdk/database/native-queries.
|
|
200
214
|
*
|
|
201
215
|
* @param integrationId The id of the integration that the query is associated with.
|
|
202
|
-
* @param query The raw SQL or database-specific query string to execute. Use named bind variables enclosed in ${},
|
|
203
|
-
*
|
|
216
|
+
* @param query The raw SQL or database-specific query string to execute. Use named bind variables enclosed in ${},
|
|
217
|
+
* e.g., ${firstName}.
|
|
218
|
+
* @param params (Optional) An object containing key-value pairs to bind to the query variables. Defaults to an empty
|
|
219
|
+
* object.
|
|
204
220
|
* @returns A promise that resolves with the result of the query.
|
|
205
221
|
*/
|
|
206
222
|
executeNativeRelationalQuery<T = any>(integrationId: IntegrationId, query: string, params?: Record<string, any>): Promise<Array<T>>;
|
|
@@ -263,18 +279,6 @@ export declare class Squid {
|
|
|
263
279
|
* Returns a client for working with structured data extraction tools.
|
|
264
280
|
*/
|
|
265
281
|
extraction(): ExtractionClient;
|
|
266
|
-
/**
|
|
267
|
-
* Returns the observability client for metrics.
|
|
268
|
-
*/
|
|
269
|
-
get observability(): ObservabilityClient;
|
|
270
|
-
/**
|
|
271
|
-
* Returns the scheduler client for managing scheduled jobs and tasks.
|
|
272
|
-
*/
|
|
273
|
-
get schedulers(): SchedulerClient;
|
|
274
|
-
/**
|
|
275
|
-
* Returns the application ID of the current Squid instance.
|
|
276
|
-
*/
|
|
277
|
-
get appId(): AppId;
|
|
278
282
|
/**
|
|
279
283
|
* Returns a distributed lock for the given mutex. The lock can be used to synchronize access to a shared resource.
|
|
280
284
|
* The lock will be released when the release method on the returned object is invoked or whenever the connection
|
|
@@ -306,5 +310,7 @@ export declare class Squid {
|
|
|
306
310
|
destruct(): Promise<void>;
|
|
307
311
|
/** Provides information about the connection to the Squid Server. */
|
|
308
312
|
connectionDetails(): ConnectionDetails;
|
|
313
|
+
/** Returns the notification client for handling (publishing and receiving) custom messages. */
|
|
314
|
+
getNotificationClient(): NotificationClient;
|
|
309
315
|
private _validateNotDestructed;
|
|
310
316
|
}
|