@squidcloud/client 1.0.302 → 1.0.304

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.
@@ -1,6 +1,6 @@
1
1
  import { FunctionName, FunctionNameWithContext } from './bundle-data.public-types';
2
2
  import { IntegrationId } from './communication.public-types';
3
- import { AiChatPromptQuotas, AiConnectedAgentMetadata } from '../types/ai-chatbot.types';
3
+ import { AiChatPromptQuotas, AiConnectedAgentMetadata, AiConnectedIntegrationMetadata } from '../types/ai-chatbot.types';
4
4
  /** The supported OpenAI models */
5
5
  export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["gpt-4o", "gpt-4o-mini", "o1", "o1-mini"];
6
6
  export declare const GEMINI_CHAT_MODEL_NAMES: readonly ["gemini-1.5-pro", "gemini-1.5-flash"];
@@ -141,6 +141,7 @@ export interface AiChatbotChatOptions {
141
141
  * Functions to expose to the AI.
142
142
  * Either a function name or a name with an extra function context passed only to this function.
143
143
  * The parameter values must be valid serializable JSON values.
144
+ * Overrides the stored value.
144
145
  */
145
146
  functions?: Array<FunctionName | FunctionNameWithContext>;
146
147
  /** A list of instructions to include with the prompt. */
@@ -149,8 +150,10 @@ export interface AiChatbotChatOptions {
149
150
  contextMetadataFilter?: AiContextMetadataFilter;
150
151
  /** The options to use for the response in voice. */
151
152
  voiceOptions?: AiAudioCreateSpeechOptions;
152
- /** List of connected AI agents can be called by the current agent. */
153
+ /** List of connected AI agents can be called by the current agent. Overrides the stored value. */
153
154
  connectedAgents?: Array<AiConnectedAgentMetadata>;
155
+ /** List of connected AI agents can be called by the current agent. Overrides the stored value. */
156
+ connectedIntegrations?: Array<AiConnectedIntegrationMetadata>;
154
157
  /** Current budget for nested or recursive AI chat calls per single prompt. */
155
158
  quotas?: AiChatPromptQuotas;
156
159
  }
@@ -1,3 +1,4 @@
1
+ import { IntegrationType } from './integration.public-types';
1
2
  /** The different types of actions that can be performed on a database. */
2
3
  export type DatabaseActionType = 'read' | 'write' | 'update' | 'insert' | 'delete' | 'all';
3
4
  /** The different types of actions that can be performed for storage. */
@@ -15,6 +16,14 @@ export interface AiFunctionParam {
15
16
  type: AiFunctionParamType;
16
17
  required: boolean;
17
18
  }
19
+ /** Additional optional readonly metadata for AI function. */
20
+ export interface AiFunctionAttributes {
21
+ /**
22
+ * Type of integration this function is used for.
23
+ * Functions with defined 'integrationType' require 'integrationId' to be passed as part of the function context.
24
+ */
25
+ integrationType?: IntegrationType;
26
+ }
18
27
  export type TopicName = string;
19
28
  export type FunctionName = string;
20
29
  /** Function name with the contextual data. The data must be a serializable JSON. */
@@ -1,76 +1,14 @@
1
1
  import { IntegrationId } from './communication.public-types';
2
- export declare enum IntegrationType {
3
- 'built_in_db' = "built_in_db",
4
- 'mongo' = "mongo",
5
- 'mysql' = "mysql",
6
- 'clickhouse' = "clickhouse",
7
- 'mssql' = "mssql",
8
- 'postgres' = "postgres",
9
- 'cockroach' = "cockroach",
10
- 'api' = "api",
11
- 'graphql' = "graphql",
12
- 'snowflake' = "snowflake",
13
- 'datadog' = "datadog",
14
- 'newrelic' = "newrelic",
15
- 'auth0' = "auth0",
16
- 'jwt_rsa' = "jwt_rsa",
17
- 'jwt_hmac' = "jwt_hmac",
18
- 'ai_chatbot' = "ai_chatbot",
19
- 'cognito' = "cognito",
20
- 'okta' = "okta",
21
- 'descope' = "descope",
22
- 'firebase_auth' = "firebase_auth",
23
- 'kafka' = "kafka",
24
- 'confluent' = "confluent",
25
- 'built_in_queue' = "built_in_queue",
26
- 's3' = "s3",
27
- 'gcs' = "gcs",
28
- 'built_in_s3' = "built_in_s3",
29
- 'built_in_gcs' = "built_in_gcs",
30
- 'google_drive' = "google_drive",
31
- 'ai_agents' = "ai_agents",
32
- 'algolia' = "algolia",
33
- 'elastic_observability' = "elastic_observability",
34
- 'elastic_search' = "elastic_search",
35
- 'elastic_enterprise_search' = "elastic_enterprise_search",
36
- 'sentry' = "sentry",
37
- 'sap_hana' = "sap_hana",
38
- 'salesforce_crm' = "salesforce_crm",
39
- 'documentdb' = "documentdb",
40
- 'dynamodb' = "dynamodb",
41
- 'cassandra' = "cassandra",
42
- 'alloydb' = "alloydb",
43
- 'spanner' = "spanner",
44
- 'db2' = "db2",
45
- 'mariadb' = "mariadb",
46
- 'oracledb' = "oracledb",
47
- 'redis' = "redis",
48
- 'xata' = "xata",
49
- 'azure_sql' = "azure_sql",
50
- 'azure_postgresql' = "azure_postgresql",
51
- 'azure_cosmosdb' = "azure_cosmosdb",
52
- 'firestore' = "firestore",
53
- 'bigquery' = "bigquery",
54
- 'cloudsql' = "cloudsql",
55
- 'slack' = "slack",
56
- 'hubspot' = "hubspot",
57
- 'monday' = "monday",
58
- 'google_docs' = "google_docs",
59
- 'onedrive' = "onedrive",
60
- 'zendesk' = "zendesk",
61
- 'pinecone' = "pinecone",
62
- 'active_directory' = "active_directory",
63
- 'jira' = "jira",
64
- 'confluence' = "confluence",
65
- 'servicenow' = "servicenow",
66
- 'linear' = "linear"
67
- }
68
- export declare enum IntegrationSchemaType {
69
- 'data' = "data",
70
- 'api' = "api",
71
- 'graphql' = "graphql"
72
- }
2
+ /** List of all integration types supported by Squid. */
3
+ export declare const INTEGRATION_TYPES: readonly ["active_directory", "ai_agents", "ai_chatbot", "algolia", "alloydb", "api", "auth0", "azure_cosmosdb", "azure_postgresql", "azure_sql", "bigquery", "built_in_db", "built_in_gcs", "built_in_queue", "built_in_s3", "cassandra", "clickhouse", "cloudsql", "cockroach", "cognito", "confluence", "confluent", "datadog", "db2", "descope", "documentdb", "dynamodb", "elastic_enterprise_search", "elastic_observability", "elastic_search", "firebase_auth", "firestore", "gcs", "google_docs", "google_drive", "graphql", "hubspot", "jira", "jwt_hmac", "jwt_rsa", "kafka", "linear", "mariadb", "monday", "mongo", "mssql", "mysql", "newrelic", "okta", "onedrive", "oracledb", "pinecone", "postgres", "redis", "s3", "salesforce_crm", "sap_hana", "sentry", "servicenow", "slack", "snowflake", "spanner", "xata", "zendesk"];
4
+ export type IntegrationType = (typeof INTEGRATION_TYPES)[number];
5
+ export declare const INTEGRATION_SCHEMA_TYPES: readonly ["data", "api", "graphql"];
6
+ export type IntegrationSchemaType = (typeof INTEGRATION_SCHEMA_TYPES)[number];
7
+ export declare const BUILT_IN_DB_INTEGRATION_ID: IntegrationId;
8
+ export declare const BUILT_IN_QUEUE_INTEGRATION_ID: IntegrationId;
73
9
  export declare const AI_AGENTS_INTEGRATION_ID: IntegrationId;
10
+ /** ID for the cloud specific storage integration: s3 (built_in_s3) or gcs (built_in_gcs). */
11
+ export declare const BUILT_IN_STORAGE_INTEGRATION_ID: IntegrationId;
74
12
  export interface IntegrationInfo<ConfigurationType = Record<string, any> | undefined> {
75
13
  id: IntegrationId;
76
14
  type: IntegrationType;
@@ -1,6 +1,6 @@
1
1
  import { AiChatModelName, AiEmbeddingsModelName, VectorDbType } from '../ai-chatbot.public-types';
2
2
  import { FunctionName } from '../bundle-data.public-types';
3
- import { AiConnectedAgentMetadata } from '../../types/ai-chatbot.types';
3
+ import { AiConnectedAgentMetadata, AiConnectedIntegrationMetadata } from '../../types/ai-chatbot.types';
4
4
  export type AiChatbotConfiguration = {
5
5
  apiKey?: string;
6
6
  };
@@ -16,8 +16,10 @@ export type AiChatbotProfileMetadata = {
16
16
  vectorDbType?: VectorDbType;
17
17
  /** List of AI functions attached to the profile by default. */
18
18
  functions?: Array<FunctionName>;
19
- /** List of child AI profiles (agents) that can be used by the current agent. */
20
- connectedProfiles?: Array<AiConnectedAgentMetadata>;
19
+ /** List of child AI agents that can be used by the current agent. */
20
+ connectedAgents?: Array<AiConnectedAgentMetadata>;
21
+ /** List of connected integrations. */
22
+ connectedIntegrations?: Array<AiConnectedIntegrationMetadata>;
21
23
  auditLog?: boolean;
22
24
  };
23
25
  export type AiChatbotContextMetadata = {
@@ -26,6 +28,6 @@ export type AiChatbotContextMetadata = {
26
28
  preview: boolean;
27
29
  sizeBytes?: number;
28
30
  };
29
- export type MutableAiChatbotProfileMetadataFieldsType = keyof Pick<AiChatbotProfileMetadata, 'modelName' | 'isPublic' | 'functions' | 'connectedProfiles' | 'auditLog'>;
31
+ export type MutableAiChatbotProfileMetadataFieldsType = keyof Pick<AiChatbotProfileMetadata, 'modelName' | 'isPublic' | 'functions' | 'connectedAgents' | 'connectedIntegrations' | 'auditLog'>;
30
32
  /** List of fields that can be updated in runtime via API. */
31
33
  export declare const MUTABLE_AI_CHATBOT_PROFILE_METADATA_FIELDS: Array<MutableAiChatbotProfileMetadataFieldsType>;
@@ -60,10 +60,10 @@ export interface ApiEndpoint {
60
60
  }
61
61
  export interface DiscoverOpenApiSchemaRequest {
62
62
  integrationId: IntegrationId;
63
- integrationType: IntegrationType.api;
63
+ integrationType: Extract<IntegrationType, 'api'>;
64
64
  discoveryOptions: OpenApiDiscoveryOptions;
65
65
  }
66
66
  export interface DiscoverOpenApiSchemaFromFileRequest {
67
67
  integrationId: IntegrationId;
68
- integrationType: IntegrationType.api;
68
+ integrationType: Extract<IntegrationType, 'api'>;
69
69
  }
@@ -1,6 +1,7 @@
1
1
  import { AiFileUrl } from '../public-types/ai-chatbot.public-types';
2
- import { AiAgentId } from '../public-types/communication.public-types';
2
+ import { AiAgentId, IntegrationId } from '../public-types/communication.public-types';
3
3
  import { FunctionName, FunctionNameWithContext } from '../public-types/bundle-data.public-types';
4
+ import { IntegrationType } from '../public-types/integration.public-types';
4
5
  export type AiChatResponseFormat = 'text' | 'json_object';
5
6
  export interface AiChatOptions {
6
7
  maxTokens: number;
@@ -16,10 +17,12 @@ export interface AiChatOptions {
16
17
  agentId?: AiAgentId;
17
18
  /** Global per-agent context passed to all AI functions. Must be a serializable JSON. */
18
19
  agentContext?: Record<string, unknown>;
19
- /** List of AI functions available for the chatbot. */
20
+ /** List of AI functions available for the chatbot. Overrides the stored list.*/
20
21
  functions?: Array<FunctionName | FunctionNameWithContext>;
21
- /** List of connected AI agents can be called by the current agent. */
22
+ /** List of connected AI agents can be called by the current agent. Overrides the stored list.*/
22
23
  connectedAgents?: Array<AiConnectedAgentMetadata>;
24
+ /** List of connected integrations. Overrides the stored list. */
25
+ connectedIntegrations?: Array<AiConnectedIntegrationMetadata>;
23
26
  /** Current budget for nested or recursive AI chat calls per single prompt. */
24
27
  quotas?: AiChatPromptQuotas;
25
28
  }
@@ -31,6 +34,17 @@ export interface AiConnectedAgentMetadata {
31
34
  */
32
35
  description: string;
33
36
  }
37
+ export interface AiConnectedIntegrationMetadata {
38
+ integrationId: IntegrationId;
39
+ /** Type of the connected integration. */
40
+ integrationType: IntegrationType;
41
+ /**
42
+ * Description of the connected integration for the parent agent context.
43
+ * Works as AI function description.
44
+ * If not provided the default one is used.
45
+ */
46
+ description?: string;
47
+ }
34
48
  /** Quotas for a single AI chat prompt (`ask()` method call). */
35
49
  export interface AiChatPromptQuotas {
36
50
  /**
@@ -0,0 +1,15 @@
1
+ import { IntegrationClient } from './integration-client';
2
+ import { RpcManager } from './rpc.manager';
3
+ import { SecretClient } from './secret.client';
4
+ import { SquidRegion } from '../../internal-common/src/public-types/regions.public-types';
5
+ import { AppId } from '../../internal-common/src/public-types/communication.public-types';
6
+ export declare class AdminClient {
7
+ private readonly rpcManager;
8
+ private readonly region;
9
+ private readonly appId;
10
+ private readonly integrationClient;
11
+ private readonly secretClient;
12
+ constructor(rpcManager: RpcManager, region: SquidRegion, appId: AppId);
13
+ integrations(): IntegrationClient;
14
+ secrets(): SecretClient;
15
+ }
@@ -0,0 +1 @@
1
+ export declare function getConsoleBaseUrl(appRegion: string, path?: string): string;
@@ -48,3 +48,5 @@ export * from './personal-storage-client';
48
48
  export * from './extraction-client';
49
49
  export * from './file-utils';
50
50
  export * from './ai-matchmaking-client';
51
+ export * from './admin-client';
52
+ export * from './console-utils';
@@ -1,6 +1,10 @@
1
1
  import { IntegrationId, IntegrationInfo, IntegrationType } from './public-types';
2
2
  export declare class IntegrationClient {
3
3
  private readonly rpcManager;
4
+ private readonly iacBaseUrl;
4
5
  list<ConfigurationType = Record<string, any>>(type?: IntegrationType): Promise<Array<IntegrationInfo<ConfigurationType>>>;
5
- get<ConfigurationType = Record<string, any>>(id: IntegrationId): Promise<IntegrationInfo<ConfigurationType> | undefined>;
6
+ get<ConfigurationType = Record<string, any>>(integrationId: IntegrationId): Promise<IntegrationInfo<ConfigurationType> | undefined>;
7
+ delete(integrationId: IntegrationId): Promise<void>;
8
+ deleteMany(integrationIds: Array<IntegrationId>): Promise<void>;
9
+ upsertIntegration<ConfigurationType = Record<string, any>>(integration: IntegrationInfo<ConfigurationType>): Promise<void>;
6
10
  }
@@ -1,3 +1,4 @@
1
+ import { BlobAndFilename } from './types';
1
2
  export declare class RpcError<BodyType = unknown> extends Error {
2
3
  readonly statusCode: number;
3
4
  readonly statusText: string;
@@ -5,6 +6,23 @@ export declare class RpcError<BodyType = unknown> extends Error {
5
6
  readonly headers: Record<string, string>;
6
7
  readonly body: BodyType;
7
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
+ }
8
26
  /** A response object with type T for the body. */
9
27
  export interface HttpResponse<BodyType = unknown> {
10
28
  status: number;
@@ -12,3 +30,14 @@ export interface HttpResponse<BodyType = unknown> {
12
30
  headers: Record<string, string>;
13
31
  body: BodyType;
14
32
  }
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 {};
@@ -5,14 +5,13 @@ import { ConnectionDetails } from './connection-details';
5
5
  import { DistributedLock } from './distributed-lock.manager';
6
6
  import { ApiKey, AppId, CollectionName, DocumentData, EnvironmentId, IntegrationId, SquidDeveloperId, SquidRegion } from './public-types';
7
7
  import { QueueManager } from './queue.manager';
8
- import { SecretClient } from './secret.client';
9
8
  import { StorageClient } from './storage-client';
10
9
  import { TransactionId } from './types';
11
10
  import { ObservabilityClient } from './observability-client';
12
11
  import { ExtractionClient } from './extraction-client';
13
12
  import { PersonalStorageClient } from './personal-storage-client';
14
13
  import { SchedulerClient } from './scheduler-client';
15
- import { IntegrationClient } from './integration-client';
14
+ import { AdminClient } from './admin-client';
16
15
  /** The different options that can be used to initialize a Squid instance. */
17
16
  export interface SquidOptions {
18
17
  /**
@@ -98,15 +97,14 @@ export declare class Squid {
98
97
  private readonly clientIdService;
99
98
  private readonly aiClientFactory;
100
99
  private readonly _connectionDetails;
101
- private readonly secretClient;
102
100
  private readonly querySender;
103
101
  private static readonly squidInstancesMap;
104
102
  private readonly aiClient;
105
103
  private readonly apiClient;
104
+ private readonly adminClient;
106
105
  private readonly observabilityClient;
107
106
  private readonly queueManagerFactory;
108
107
  private readonly schedulerClient;
109
- private readonly integrationClient;
110
108
  private readonly _appId;
111
109
  /**
112
110
  * Creates a new instance of Squid with the given options.
@@ -207,13 +205,12 @@ export declare class Squid {
207
205
  */
208
206
  ai(): AiClient;
209
207
  api(): ApiClient;
208
+ admin(): AdminClient;
210
209
  storage(integrationId?: IntegrationId): StorageClient;
211
210
  personalStorage(integrationId: IntegrationId): PersonalStorageClient;
212
211
  extraction(): ExtractionClient;
213
- get secrets(): SecretClient;
214
212
  get observability(): ObservabilityClient;
215
213
  get schedulers(): SchedulerClient;
216
- get integrations(): IntegrationClient;
217
214
  get appId(): AppId;
218
215
  /**
219
216
  * Returns a distributed lock for the given mutex. The lock can be used to synchronize access to a shared resource.
@@ -1 +1 @@
1
- export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.302";
1
+ export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.304";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/client",
3
- "version": "1.0.302",
3
+ "version": "1.0.304",
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",
@@ -38,7 +38,7 @@
38
38
  "license": "ISC",
39
39
  "dependencies": {
40
40
  "json-schema-typed": "^8.0.1",
41
- "ws": "^8.18.0"
41
+ "ws": "^8.17.1"
42
42
  },
43
43
  "optionalDependencies": {
44
44
  "bufferutil": "^4.0.8",
@@ -56,7 +56,7 @@
56
56
  "otrie": "^1.1.3",
57
57
  "tsconfig-paths-webpack-plugin": "^4.1.0",
58
58
  "tscpaths": "^0.0.9",
59
- "webpack": "^5.95.0",
59
+ "webpack": "^5.96.0",
60
60
  "webpack-cli": "^5.1.4"
61
61
  },
62
62
  "engines": {