@squidcloud/client 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/cjs/index.js +1 -1
- package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +287 -62
- package/dist/internal-common/src/public-types/ai-assistant.public-types.d.ts +9 -2
- package/dist/internal-common/src/public-types/ai-matchmaking.types.d.ts +6 -0
- package/dist/internal-common/src/public-types/backend.public-types.d.ts +13 -0
- package/dist/internal-common/src/public-types/communication.public-types.d.ts +7 -0
- package/dist/internal-common/src/public-types/context.public-types.d.ts +12 -1
- package/dist/internal-common/src/public-types/document.public-types.d.ts +42 -12
- package/dist/internal-common/src/public-types/extraction.public-types.d.ts +21 -0
- package/dist/internal-common/src/public-types/integration.public-types.d.ts +16 -2
- package/dist/internal-common/src/public-types/integrations/api.public-types.d.ts +0 -11
- package/dist/internal-common/src/public-types/query.public-types.d.ts +35 -7
- package/dist/internal-common/src/public-types/scheduler.public-types.d.ts +13 -4
- package/dist/internal-common/src/public-types/secret.public-types.d.ts +24 -7
- package/dist/internal-common/src/public-types/serialized-query.public-types.d.ts +12 -0
- package/dist/internal-common/src/public-types/typescript.public-types.d.ts +0 -3
- package/dist/typescript-client/src/admin-client.d.ts +1 -0
- package/dist/typescript-client/src/agent/ai-agent-client-reference.d.ts +73 -2
- package/dist/typescript-client/src/agent/ai-agent-client.d.ts +1 -0
- package/dist/typescript-client/src/agent/ai-agent-client.types.d.ts +8 -1
- package/dist/typescript-client/src/ai-assistant-client.d.ts +3 -2
- package/dist/typescript-client/src/ai-audio-client.d.ts +15 -0
- package/dist/typescript-client/src/ai-client.d.ts +5 -0
- package/dist/typescript-client/src/ai-image-client.d.ts +16 -1
- package/dist/typescript-client/src/ai-matchmaking-client.d.ts +57 -11
- package/dist/typescript-client/src/ai.types.d.ts +24 -30
- package/dist/typescript-client/src/api-client.d.ts +1 -0
- package/dist/typescript-client/src/auth.manager.d.ts +4 -1
- package/dist/typescript-client/src/collection-reference.d.ts +2 -0
- package/dist/typescript-client/src/connection-details.d.ts +1 -0
- package/dist/typescript-client/src/destruct.manager.d.ts +1 -21
- package/dist/typescript-client/src/distributed-lock.manager.d.ts +4 -1
- package/dist/typescript-client/src/document-reference.d.ts +1 -0
- package/dist/typescript-client/src/document-store.d.ts +1 -17
- package/dist/typescript-client/src/extraction-client.d.ts +1 -0
- package/dist/typescript-client/src/integration-client.d.ts +1 -0
- package/dist/typescript-client/src/observability-client.d.ts +5 -1
- package/dist/typescript-client/src/personal-storage-client.d.ts +23 -4
- package/dist/typescript-client/src/public-types.d.ts +1 -4
- package/dist/typescript-client/src/query/deserializer.d.ts +1 -0
- package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +34 -8
- package/dist/typescript-client/src/query/pagination.d.ts +10 -10
- package/dist/typescript-client/src/query/query-builder.factory.d.ts +12 -4
- package/dist/typescript-client/src/query/query-subscription.manager.d.ts +1 -12
- package/dist/typescript-client/src/query/query.types.d.ts +2 -93
- package/dist/typescript-client/src/query/snapshot-emitter.d.ts +1 -0
- package/dist/typescript-client/src/query-utils.d.ts +5 -1
- package/dist/typescript-client/src/queue.manager.d.ts +1 -0
- package/dist/typescript-client/src/scheduler-client.d.ts +1 -0
- package/dist/typescript-client/src/secret.client.d.ts +2 -0
- package/dist/typescript-client/src/squid.d.ts +16 -4
- package/dist/typescript-client/src/storage-client.d.ts +9 -9
- package/dist/typescript-client/src/types.d.ts +4 -1
- package/dist/typescript-client/src/version.d.ts +2 -2
- package/package.json +6 -2
- package/dist/internal-common/src/metric-name.d.ts +0 -9
- package/dist/internal-common/src/public-types/application.public-types.d.ts +0 -94
- package/dist/internal-common/src/public-types/bundle-data.public-types.d.ts +0 -33
- package/dist/internal-common/src/public-types/mutation.public-types.d.ts +0 -54
- package/dist/internal-common/src/public-types/storage.types.d.ts +0 -9
- package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +0 -21
- package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +0 -18
- package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +0 -127
- package/dist/internal-common/src/types/ai-agent.types.d.ts +0 -1
- package/dist/internal-common/src/types/ai-assistant.types.d.ts +0 -1
- package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +0 -53
- 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/mutation.types.d.ts +0 -1
- package/dist/internal-common/src/types/observability.types.d.ts +0 -71
- package/dist/internal-common/src/types/query.types.d.ts +0 -10
- package/dist/internal-common/src/types/secret.types.d.ts +0 -2
- package/dist/internal-common/src/types/socket.types.d.ts +0 -1
- package/dist/internal-common/src/types/time-units.d.ts +0 -1
- package/dist/internal-common/src/utils/array.d.ts +0 -1
- package/dist/internal-common/src/utils/e2e-test-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 -1
- 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 -49
- package/dist/internal-common/src/utils/serialization.d.ts +0 -5
- package/dist/internal-common/src/utils/squid.constants.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
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { AppId, ClientId } from './communication.public-types';
|
|
2
|
+
/**
|
|
3
|
+
* @category Auth
|
|
4
|
+
*/
|
|
2
5
|
export type AuthType = 'Bearer' | 'ApiKey';
|
|
3
6
|
/**
|
|
4
7
|
* The payload of a JWT token in case an auth token was used.
|
|
8
|
+
* @category Auth
|
|
5
9
|
*/
|
|
6
10
|
export interface AuthWithBearer {
|
|
7
11
|
type: 'Bearer';
|
|
@@ -12,13 +16,20 @@ export interface AuthWithBearer {
|
|
|
12
16
|
}
|
|
13
17
|
/**
|
|
14
18
|
* The authentication object for the current request in case an API key is used.
|
|
19
|
+
* @category Auth
|
|
15
20
|
*/
|
|
16
21
|
export interface AuthWithApiKey {
|
|
17
22
|
type: 'ApiKey';
|
|
18
23
|
apiKey: string;
|
|
19
24
|
}
|
|
20
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* The authentication object for the current request.
|
|
27
|
+
* @category Auth
|
|
28
|
+
*/
|
|
21
29
|
export type Auth = AuthWithBearer | AuthWithApiKey;
|
|
30
|
+
/**
|
|
31
|
+
* @category Auth
|
|
32
|
+
*/
|
|
22
33
|
export interface AuthToken {
|
|
23
34
|
type: AuthType;
|
|
24
35
|
token: string;
|
|
@@ -1,32 +1,62 @@
|
|
|
1
1
|
import { IntegrationId } from './communication.public-types';
|
|
2
|
+
/**
|
|
3
|
+
* @category Database
|
|
4
|
+
*/
|
|
2
5
|
export type PrimitiveFieldType = string | number | boolean | null | Date;
|
|
6
|
+
/**
|
|
7
|
+
* @category Database
|
|
8
|
+
*/
|
|
3
9
|
export type FieldType = PrimitiveFieldType | Array<FieldType> | {
|
|
4
10
|
[key: string]: FieldType;
|
|
5
11
|
};
|
|
6
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* A type alias for a field name.
|
|
14
|
+
* @category Database
|
|
15
|
+
*/
|
|
7
16
|
export type FieldName<T = any> = string & keyof T;
|
|
8
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* A type alias for a document id as string.
|
|
19
|
+
* @category Database
|
|
20
|
+
*/
|
|
9
21
|
export type DocId = string;
|
|
10
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* A type alias for a document id object when the ID is a composite of primary keys.
|
|
24
|
+
* @category Database
|
|
25
|
+
*/
|
|
11
26
|
export type DocIdObj = Record<FieldName, any>;
|
|
12
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* A type alias for a document id or a document id object.
|
|
29
|
+
* @category Database
|
|
30
|
+
*/
|
|
13
31
|
export type DocIdOrDocIdObj = DocId | DocIdObj;
|
|
14
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* A type alias for a collection name.
|
|
34
|
+
* @category Database
|
|
35
|
+
*/
|
|
15
36
|
export type CollectionName = string;
|
|
16
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* A generic document data type.
|
|
39
|
+
* @category Database
|
|
40
|
+
*/
|
|
17
41
|
export type DocumentData = Record<FieldName, any | undefined>;
|
|
42
|
+
/**
|
|
43
|
+
* A type alias for timestamp field..
|
|
44
|
+
* @category Database
|
|
45
|
+
*/
|
|
18
46
|
export type DocTimestamp = number;
|
|
47
|
+
/**
|
|
48
|
+
* The structure of a Squid Document.
|
|
49
|
+
* @category Database
|
|
50
|
+
*/
|
|
19
51
|
export interface SquidDocument {
|
|
20
52
|
__docId__: DocId;
|
|
21
53
|
__ts__: DocTimestamp;
|
|
22
54
|
[fieldName: string]: FieldType | undefined;
|
|
23
55
|
}
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
/** The full document id, including the collection name and the integration id. */
|
|
56
|
+
/**
|
|
57
|
+
* The full document id, including the collection name and the integration id.
|
|
58
|
+
* @category Database
|
|
59
|
+
*/
|
|
30
60
|
export interface SquidDocIdObj {
|
|
31
61
|
collectionName: CollectionName;
|
|
32
62
|
docId: DocId;
|
|
@@ -1,24 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @category Storage
|
|
3
|
+
*/
|
|
1
4
|
export type DocumentFileDataType = 'image';
|
|
5
|
+
/**
|
|
6
|
+
* @category Storage
|
|
7
|
+
*/
|
|
2
8
|
export interface ExtractDataFromDocumentFileOptions {
|
|
3
9
|
password?: string;
|
|
4
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* @category Storage
|
|
13
|
+
*/
|
|
5
14
|
export interface DocumentFileData {
|
|
6
15
|
type: DocumentFileDataType;
|
|
7
16
|
pathInBucket: string;
|
|
8
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* @category Storage
|
|
20
|
+
*/
|
|
9
21
|
export interface DocumentPageData {
|
|
10
22
|
title?: string;
|
|
11
23
|
text: string;
|
|
12
24
|
fileDataList: DocumentFileData[];
|
|
13
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* @category Storage
|
|
28
|
+
*/
|
|
14
29
|
export interface ExtractDataFromDocumentResponse {
|
|
15
30
|
documentPathInBucket?: string;
|
|
16
31
|
pages: DocumentPageData[];
|
|
17
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* @category Storage
|
|
35
|
+
*/
|
|
18
36
|
export interface TextOnlyPageData {
|
|
19
37
|
text: string;
|
|
20
38
|
title?: string;
|
|
21
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* @category Storage
|
|
42
|
+
*/
|
|
22
43
|
export interface DocumentTextDataResponse {
|
|
23
44
|
pages: TextOnlyPageData[];
|
|
24
45
|
}
|
|
@@ -1,17 +1,31 @@
|
|
|
1
1
|
import { IntegrationId } from './communication.public-types';
|
|
2
|
-
export declare const AI_AGENTS_INTEGRATION_ID = "ai_agents";
|
|
3
2
|
/** List of all integration types supported by Squid. */
|
|
4
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", "snowflake", "spanner", "xata", "zendesk", "mail", "slack"];
|
|
4
|
+
/**
|
|
5
|
+
* @category Database
|
|
6
|
+
*/
|
|
5
7
|
export declare const DATA_INTEGRATION_TYPES: readonly ["bigquery", "built_in_db", "clickhouse", "cockroach", "mongo", "mssql", "mysql", "oracledb", "postgres", "sap_hana", "snowflake"];
|
|
8
|
+
/**
|
|
9
|
+
* @category Auth
|
|
10
|
+
*/
|
|
6
11
|
export declare const AUTH_INTEGRATION_TYPES: readonly ["auth0", "jwt_rsa", "jwt_hmac", "cognito", "okta", "descope", "firebase_auth"];
|
|
7
12
|
export declare const GRAPHQL_INTEGRATION_TYPES: readonly ["graphql", "linear"];
|
|
8
13
|
export declare const HTTP_INTEGRATION_TYPES: readonly ["api", "confluence"];
|
|
9
14
|
export type IntegrationType = (typeof INTEGRATION_TYPES)[number];
|
|
10
15
|
export declare const INTEGRATION_SCHEMA_TYPES: readonly ["data", "api", "graphql"];
|
|
11
16
|
export type IntegrationSchemaType = (typeof INTEGRATION_SCHEMA_TYPES)[number];
|
|
17
|
+
/**
|
|
18
|
+
* @category Database
|
|
19
|
+
*/
|
|
12
20
|
export declare const BUILT_IN_DB_INTEGRATION_ID: IntegrationId;
|
|
21
|
+
/**
|
|
22
|
+
* @category Queue
|
|
23
|
+
*/
|
|
13
24
|
export declare const BUILT_IN_QUEUE_INTEGRATION_ID: IntegrationId;
|
|
14
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* ID for the cloud specific storage integration: s3 (built_in_s3) or gcs (built_in_gcs).
|
|
27
|
+
* @category Storage
|
|
28
|
+
*/
|
|
15
29
|
export declare const BUILT_IN_STORAGE_INTEGRATION_ID: IntegrationId;
|
|
16
30
|
export interface IntegrationInfo<ConfigurationType = Record<string, any> | undefined> {
|
|
17
31
|
id: IntegrationId;
|
|
@@ -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';
|
|
@@ -60,12 +58,3 @@ export interface ApiEndpoint {
|
|
|
60
58
|
bodyMimeType?: string;
|
|
61
59
|
isRequestBodyRequired?: boolean;
|
|
62
60
|
}
|
|
63
|
-
export interface DiscoverOpenApiSchemaRequest {
|
|
64
|
-
integrationId: IntegrationId;
|
|
65
|
-
integrationType: Extract<IntegrationType, 'api'>;
|
|
66
|
-
discoveryOptions: OpenApiDiscoveryOptions;
|
|
67
|
-
}
|
|
68
|
-
export interface DiscoverOpenApiSchemaFromFileRequest {
|
|
69
|
-
integrationId: IntegrationId;
|
|
70
|
-
integrationType: Extract<IntegrationType, 'api'>;
|
|
71
|
-
}
|
|
@@ -2,11 +2,13 @@ import { CollectionName, DocumentData, FieldName } from './document.public-types
|
|
|
2
2
|
import { Paths } from './typescript.public-types';
|
|
3
3
|
/**
|
|
4
4
|
* An alias for a join result. This is used to disambiguate fields in the result.
|
|
5
|
+
* @category Database
|
|
5
6
|
*/
|
|
6
7
|
export type Alias = string;
|
|
7
8
|
/**
|
|
8
9
|
* A join condition.
|
|
9
10
|
* The join conditions defines the alias for the left side of the join and the field names to join on.
|
|
11
|
+
* @category Database
|
|
10
12
|
*/
|
|
11
13
|
export interface JoinCondition {
|
|
12
14
|
leftAlias: Alias;
|
|
@@ -14,10 +16,20 @@ export interface JoinCondition {
|
|
|
14
16
|
right: FieldName;
|
|
15
17
|
isInner: boolean;
|
|
16
18
|
}
|
|
17
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* A list of query conditions.
|
|
21
|
+
* @category Database
|
|
22
|
+
*/
|
|
18
23
|
export type Condition<Doc extends DocumentData = any> = SimpleCondition<Doc> | CompositeCondition<Doc>;
|
|
24
|
+
/**
|
|
25
|
+
* A list of query conditions.
|
|
26
|
+
* @category Database
|
|
27
|
+
*/
|
|
19
28
|
export type Conditions<Doc extends DocumentData = any> = Array<Condition<Doc>>;
|
|
20
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* A single field query condition.
|
|
31
|
+
* @category Database
|
|
32
|
+
*/
|
|
21
33
|
export interface SimpleCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>, MyOperator = Operator> {
|
|
22
34
|
fieldName: F;
|
|
23
35
|
operator: MyOperator;
|
|
@@ -29,23 +41,39 @@ export interface SimpleCondition<Doc extends DocumentData = any, F extends Paths
|
|
|
29
41
|
* evaluated this way:
|
|
30
42
|
* If A, B, C are the conditions and A` = A with '==' operator:
|
|
31
43
|
* A || (A' && B) || (A' && B' && C)
|
|
44
|
+
* @category Database
|
|
32
45
|
*/
|
|
33
46
|
export interface CompositeCondition<Doc extends DocumentData = any> {
|
|
34
47
|
fields: Array<SimpleCondition<Doc, Paths<Doc>, CompositeConditionOperator>>;
|
|
35
48
|
}
|
|
36
|
-
/** Returns true if the condition is a 'SimpleCondition' or false otherwise. */
|
|
37
|
-
export declare function isSimpleCondition(condition: Condition): condition is SimpleCondition;
|
|
38
49
|
type CompositeConditionOperator = '>=' | '<=' | '>' | '<';
|
|
50
|
+
/**
|
|
51
|
+
* The list of operators related to arrays.
|
|
52
|
+
* @category Database
|
|
53
|
+
*/
|
|
39
54
|
export declare const ARRAY_OPERATORS: readonly ["in", "not in", "array_includes_some", "array_includes_all", "array_not_includes"];
|
|
55
|
+
/**
|
|
56
|
+
* The list of all operators.
|
|
57
|
+
* @category Database
|
|
58
|
+
*/
|
|
40
59
|
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"];
|
|
41
|
-
/**
|
|
60
|
+
/**
|
|
61
|
+
* An operator in a query condition.
|
|
62
|
+
* @category Database
|
|
63
|
+
*/
|
|
42
64
|
export type Operator = (typeof ALL_OPERATORS)[number];
|
|
43
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* A definition of a sort by a field.
|
|
67
|
+
* @category Database
|
|
68
|
+
*/
|
|
44
69
|
export interface FieldSort<Doc> {
|
|
45
70
|
fieldName: FieldName<Doc>;
|
|
46
71
|
asc: boolean;
|
|
47
72
|
}
|
|
48
|
-
/**
|
|
73
|
+
/**
|
|
74
|
+
* A query object.
|
|
75
|
+
* @category Database
|
|
76
|
+
*/
|
|
49
77
|
export interface Query<Doc extends DocumentData = any> {
|
|
50
78
|
collectionName: CollectionName;
|
|
51
79
|
integrationId: string;
|
|
@@ -1,21 +1,30 @@
|
|
|
1
|
-
import { ServiceFunctionName } from './
|
|
1
|
+
import { ServiceFunctionName } from './backend.public-types';
|
|
2
|
+
/**
|
|
3
|
+
* @category Platform
|
|
4
|
+
*/
|
|
2
5
|
export interface SchedulerConfig {
|
|
3
6
|
functionName: ServiceFunctionName;
|
|
4
7
|
cronExpression: string;
|
|
5
8
|
exclusive: boolean;
|
|
6
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* @category Platform
|
|
12
|
+
*/
|
|
7
13
|
export interface SchedulerInfo {
|
|
8
14
|
schedulerId: string;
|
|
9
15
|
config: SchedulerConfig;
|
|
10
16
|
enabled: boolean;
|
|
11
17
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
/**
|
|
19
|
+
* @category Platform
|
|
20
|
+
*/
|
|
15
21
|
export interface UpdateSchedulerOptions {
|
|
16
22
|
schedulerId: string;
|
|
17
23
|
enabled?: boolean;
|
|
18
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* @category Platform
|
|
27
|
+
*/
|
|
19
28
|
export interface UpdateSchedulersRequest {
|
|
20
29
|
schedulers: UpdateSchedulerOptions[];
|
|
21
30
|
}
|
|
@@ -1,23 +1,40 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* A type alias for an ApiKey.
|
|
3
|
+
* @category Secret
|
|
4
|
+
*/
|
|
2
5
|
export type ApiKey = string;
|
|
3
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* The secret key, an alias for a string.
|
|
8
|
+
* @category Secret
|
|
9
|
+
*/
|
|
4
10
|
export type SecretKey = string;
|
|
5
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* The secret value.
|
|
13
|
+
* @category Secret
|
|
14
|
+
*/
|
|
6
15
|
export type SecretValue = string | number | boolean;
|
|
16
|
+
/**
|
|
17
|
+
* @category Secret
|
|
18
|
+
*/
|
|
7
19
|
export interface SecretMetadata {
|
|
8
20
|
key: SecretKey;
|
|
9
21
|
lastUpdated: number;
|
|
10
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* @category Secret
|
|
25
|
+
*/
|
|
11
26
|
export interface SecretEntry<T extends SecretValue = SecretValue> extends SecretMetadata {
|
|
12
27
|
value: T;
|
|
13
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* @category Secret
|
|
31
|
+
*/
|
|
14
32
|
export interface ApiKeyEntry extends SecretMetadata {
|
|
15
33
|
value: string;
|
|
16
34
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
35
|
+
/**
|
|
36
|
+
* @category Secret
|
|
37
|
+
*/
|
|
21
38
|
export interface SetSecretRequestEntry {
|
|
22
39
|
key: SecretKey;
|
|
23
40
|
value: SecretValue;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { DocumentData } from './document.public-types';
|
|
2
2
|
import { Alias, JoinCondition, Query } from './query.public-types';
|
|
3
|
+
/**
|
|
4
|
+
* @category Database
|
|
5
|
+
*/
|
|
3
6
|
export type SerializedSimpleQuery = {
|
|
4
7
|
type: 'simple';
|
|
5
8
|
query: Query;
|
|
6
9
|
dereference: boolean;
|
|
7
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* @category Database
|
|
13
|
+
*/
|
|
8
14
|
export type SerializedJoinQuery = {
|
|
9
15
|
type: 'join';
|
|
10
16
|
grouped: boolean;
|
|
@@ -17,8 +23,14 @@ export type SerializedJoinQuery = {
|
|
|
17
23
|
joins: Record<Alias, Query<DocumentData>>;
|
|
18
24
|
joinConditions: Record<Alias, JoinCondition>;
|
|
19
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* @category Database
|
|
28
|
+
*/
|
|
20
29
|
export type SerializedMergedQuery = {
|
|
21
30
|
type: 'merged';
|
|
22
31
|
queries: Array<SerializedQuery>;
|
|
23
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* @category Database
|
|
35
|
+
*/
|
|
24
36
|
export type SerializedQuery = SerializedSimpleQuery | SerializedJoinQuery | SerializedMergedQuery;
|
|
@@ -3,6 +3,7 @@ import { SecretClient } from './secret.client';
|
|
|
3
3
|
/**
|
|
4
4
|
* AdminClient provides access to application administrative operations,
|
|
5
5
|
* including integrations and secrets management.
|
|
6
|
+
* @category Platform
|
|
6
7
|
*/
|
|
7
8
|
export declare class AdminClient {
|
|
8
9
|
private readonly rpcManager;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { AgentContextRequest, AiAgent, AiAgentChatOptions, AiAgentContext, AiChatModelName, AiConnectedAgentMetadata, AiObserveStatusOptions, AiSearchOptions,
|
|
1
|
+
import { AgentContextRequest, AiAgent, AiAgentChatOptions, AiAgentContext, AiChatModelName, AiConnectedAgentMetadata, AiObserveStatusOptions, AiSearchOptions, AiSearchResultChunk, AiStatusMessage, AiTranscribeAndAskResponse, GuardrailsOptions, UpsertAgentRequest } from '../../../internal-common/src/public-types/ai-agent.public-types';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { AskOptionsWithoutVoice, AskWithVoiceResponse, ChatOptionsWithoutVoice, TranscribeAndAskWithVoiceResponse, TranscribeAndChatResponse } from './ai-agent-client.types';
|
|
4
4
|
/**
|
|
5
5
|
* Parameters for creating or updating an AI agent.
|
|
6
6
|
* Excludes the `id` field, as it is derived from the agent instance.
|
|
7
|
+
* @category AI
|
|
7
8
|
*/
|
|
8
9
|
export type UpsertAgentRequestParams = Omit<UpsertAgentRequest, 'id'>;
|
|
9
10
|
/**
|
|
10
11
|
* AiAgentReference provides methods for managing AI agents, including
|
|
11
12
|
* retrieving, updating, and deleting agents, handling agent contexts,
|
|
12
13
|
* and interacting with chat or voice-based AI functionalities.
|
|
14
|
+
* @category AI
|
|
13
15
|
*/
|
|
14
16
|
export declare class AiAgentReference {
|
|
15
17
|
private readonly agentId;
|
|
@@ -17,27 +19,96 @@ export declare class AiAgentReference {
|
|
|
17
19
|
private readonly statusUpdates;
|
|
18
20
|
private readonly rpcManager;
|
|
19
21
|
private readonly socketManager;
|
|
22
|
+
/**
|
|
23
|
+
* Retrieves metadata and configuration of the AI agent.
|
|
24
|
+
*/
|
|
20
25
|
get(): Promise<AiAgent | undefined>;
|
|
26
|
+
/**
|
|
27
|
+
* Creates or updates the AI agent with the provided parameters.
|
|
28
|
+
*/
|
|
21
29
|
upsert(agent: UpsertAgentRequestParams): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Deletes the AI agent.
|
|
32
|
+
*/
|
|
22
33
|
delete(): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Updates the agent's instruction prompt.
|
|
36
|
+
*/
|
|
23
37
|
updateInstructions(instructions: string): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Changes the AI model used by the agent.
|
|
40
|
+
*/
|
|
24
41
|
updateModel(model: AiChatModelName): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Updates the list of agents connected to this agent.
|
|
44
|
+
*/
|
|
25
45
|
updateConnectedAgents(connectedAgents: Array<AiConnectedAgentMetadata>): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Retrieves a specific agent context by its ID.
|
|
48
|
+
*/
|
|
26
49
|
getContext(contextId: string): Promise<AiAgentContext | undefined>;
|
|
50
|
+
/**
|
|
51
|
+
* Lists all contexts associated with the agent.
|
|
52
|
+
*/
|
|
27
53
|
listContexts(): Promise<Array<AiAgentContext>>;
|
|
54
|
+
/**
|
|
55
|
+
* Deletes a specific context by its ID.
|
|
56
|
+
*/
|
|
28
57
|
deleteContext(contextId: string): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Deletes multiple agent contexts.
|
|
60
|
+
*/
|
|
29
61
|
deleteContexts(contextIds: Array<string>): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Adds or updates a single agent context.
|
|
64
|
+
*/
|
|
30
65
|
upsertContext(contextRequest: AgentContextRequest, file?: File): Promise<void>;
|
|
66
|
+
/**
|
|
67
|
+
* Adds or updates multiple agent contexts.
|
|
68
|
+
*/
|
|
31
69
|
upsertContexts(contextRequests: Array<AgentContextRequest>, files?: Array<File>): Promise<void>;
|
|
70
|
+
/**
|
|
71
|
+
* Sends user feedback to the agent.
|
|
72
|
+
*/
|
|
32
73
|
provideFeedback(feedback: string): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* Resets any feedback previously provided to the agent.
|
|
76
|
+
*/
|
|
33
77
|
resetFeedback(): Promise<void>;
|
|
78
|
+
updateGuardrails(guardrails: GuardrailsOptions): Promise<void>;
|
|
79
|
+
upsertCustomGuardrails(customGuardrail: string): Promise<void>;
|
|
80
|
+
deleteCustomGuardrail(): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Sends a prompt to the agent and receives streamed text responses.
|
|
83
|
+
*/
|
|
34
84
|
chat(prompt: string, options?: ChatOptionsWithoutVoice): Observable<string>;
|
|
85
|
+
/**
|
|
86
|
+
* Transcribes the given file and performs a chat interaction.
|
|
87
|
+
*/
|
|
35
88
|
transcribeAndChat(fileToTranscribe: File, options?: ChatOptionsWithoutVoice): Promise<TranscribeAndChatResponse>;
|
|
36
|
-
|
|
89
|
+
/**
|
|
90
|
+
* Performs a semantic search using the agent's knowledge base.
|
|
91
|
+
*/
|
|
92
|
+
search(options: AiSearchOptions): Promise<Array<AiSearchResultChunk>>;
|
|
93
|
+
/**
|
|
94
|
+
* Sends a prompt and receives a full string response.
|
|
95
|
+
*/
|
|
37
96
|
ask(prompt: string, options?: AskOptionsWithoutVoice): Promise<string>;
|
|
97
|
+
/**
|
|
98
|
+
* Observes live status messages from the agent.
|
|
99
|
+
*/
|
|
38
100
|
observeStatusUpdates(options?: AiObserveStatusOptions): Observable<AiStatusMessage>;
|
|
101
|
+
/**
|
|
102
|
+
* Transcribes audio and sends it to the agent for response.
|
|
103
|
+
*/
|
|
39
104
|
transcribeAndAsk(fileToTranscribe: File, options?: AskOptionsWithoutVoice): Promise<AiTranscribeAndAskResponse>;
|
|
105
|
+
/**
|
|
106
|
+
* Transcribes audio and gets both text and voice response from the agent.
|
|
107
|
+
*/
|
|
40
108
|
transcribeAndAskWithVoiceResponse(fileToTranscribe: File, options?: Omit<AiAgentChatOptions, 'smoothTyping'>): Promise<TranscribeAndAskWithVoiceResponse>;
|
|
109
|
+
/**
|
|
110
|
+
* Sends a prompt and gets both text and voice response from the agent.
|
|
111
|
+
*/
|
|
41
112
|
askWithVoiceResponse(prompt: string, options?: Omit<AiAgentChatOptions, 'smoothTyping'>): Promise<AskWithVoiceResponse>;
|
|
42
113
|
private askInternal;
|
|
43
114
|
private createStatusSubject;
|
|
@@ -4,6 +4,7 @@ import { AiAgentReference } from './ai-agent-client-reference';
|
|
|
4
4
|
* AiAgentClient manages AI agent interactions, including listing agents,
|
|
5
5
|
* handling real-time chat responses, and processing AI status updates
|
|
6
6
|
* through WebSocket notifications.
|
|
7
|
+
* @category AI
|
|
7
8
|
*/
|
|
8
9
|
export declare class AiAgentClient {
|
|
9
10
|
private readonly rpcManager;
|
|
@@ -3,6 +3,7 @@ import { Observable } from 'rxjs';
|
|
|
3
3
|
/**
|
|
4
4
|
* Response format for transcribing audio and generating a chat response.
|
|
5
5
|
* Contains the transcribed text and a stream of AI-generated responses.
|
|
6
|
+
* @category AI
|
|
6
7
|
*/
|
|
7
8
|
export interface TranscribeAndChatResponse {
|
|
8
9
|
/** Transcribed text from the audio input. */
|
|
@@ -13,6 +14,7 @@ export interface TranscribeAndChatResponse {
|
|
|
13
14
|
/**
|
|
14
15
|
* Response format for transcribing audio and generating a text and voice response.
|
|
15
16
|
* Includes the transcribed prompt, the AI-generated response as text, and an audio file.
|
|
17
|
+
* @category AI
|
|
16
18
|
*/
|
|
17
19
|
export interface TranscribeAndAskWithVoiceResponse {
|
|
18
20
|
/** Transcribed text from the audio input. */
|
|
@@ -25,6 +27,7 @@ export interface TranscribeAndAskWithVoiceResponse {
|
|
|
25
27
|
/**
|
|
26
28
|
* Response format for AI-generated voice responses.
|
|
27
29
|
* Contains the AI-generated text response and the corresponding audio file.
|
|
30
|
+
* @category AI
|
|
28
31
|
*/
|
|
29
32
|
export interface AskWithVoiceResponse {
|
|
30
33
|
/** AI-generated response as a string. */
|
|
@@ -32,9 +35,13 @@ export interface AskWithVoiceResponse {
|
|
|
32
35
|
/** AI-generated voice response as an audio file. */
|
|
33
36
|
voiceResponseFile: File;
|
|
34
37
|
}
|
|
35
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* Chat options that exclude voice-specific configurations.
|
|
40
|
+
* @category AI
|
|
41
|
+
*/
|
|
36
42
|
export type ChatOptionsWithoutVoice = Omit<AiAgentChatOptions, 'voiceOptions'>;
|
|
37
43
|
/**
|
|
38
44
|
* Options for AI-generated responses that exclude voice-specific settings and smooth typing behavior.
|
|
45
|
+
* @category AI
|
|
39
46
|
*/
|
|
40
47
|
export type AskOptionsWithoutVoice = Omit<AiAgentChatOptions, 'voiceOptions' | 'smoothTyping'>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { AssistantToolType,
|
|
1
|
+
import { AssistantToolType, QueryAssistantOptions } from './public-types';
|
|
2
2
|
/**
|
|
3
3
|
* Client class for interacting with an AI Assistant server.
|
|
4
4
|
* Provides functionalities like creating and deleting assistants and threads,
|
|
5
5
|
* querying assistants, and managing files associated with assistants and threads.
|
|
6
|
+
* @category AI
|
|
6
7
|
*/
|
|
7
8
|
export declare class AiAssistantClient {
|
|
8
9
|
private readonly rpcManager;
|
|
@@ -16,7 +17,7 @@ export declare class AiAssistantClient {
|
|
|
16
17
|
* the addFileToAssistant method.
|
|
17
18
|
* @returns A promise that resolves to the created assistant's ID.
|
|
18
19
|
*/
|
|
19
|
-
createAssistant(name: string, instructions: string, functions: Array<
|
|
20
|
+
createAssistant(name: string, instructions: string, functions: Array<string>, toolTypes?: Array<AssistantToolType>): Promise<string>;
|
|
20
21
|
/**
|
|
21
22
|
* Deletes an AI assistant.
|
|
22
23
|
* @param assistantId - The ID of the assistant to be deleted.
|
|
@@ -2,9 +2,24 @@ import { AiAudioCreateSpeechOptions, AiAudioTranscribeOptions } from './public-t
|
|
|
2
2
|
/**
|
|
3
3
|
* AiAudioClient provides methods for AI-driven audio processing,
|
|
4
4
|
* including speech transcription and text-to-speech synthesis.
|
|
5
|
+
* @category AI
|
|
5
6
|
*/
|
|
6
7
|
export declare class AiAudioClient {
|
|
7
8
|
private readonly rpcManager;
|
|
9
|
+
/**
|
|
10
|
+
* Transcribes the spoken content of an audio file into text.
|
|
11
|
+
*
|
|
12
|
+
* @param file - The audio file to transcribe.
|
|
13
|
+
* @param options - Options specifying the transcription model and behavior.
|
|
14
|
+
* @returns A Promise that resolves to the transcribed text.
|
|
15
|
+
*/
|
|
8
16
|
transcribe(file: File, options?: AiAudioTranscribeOptions): Promise<string>;
|
|
17
|
+
/**
|
|
18
|
+
* Converts a text input into a spoken audio file using AI-generated speech.
|
|
19
|
+
*
|
|
20
|
+
* @param input - The text to convert to speech.
|
|
21
|
+
* @param options - Options for customizing speech synthesis (e.g., voice, speed).
|
|
22
|
+
* @returns A Promise that resolves to an audio File containing the synthesized speech.
|
|
23
|
+
*/
|
|
9
24
|
createSpeech(input: string, options: AiAudioCreateSpeechOptions): Promise<File>;
|
|
10
25
|
}
|
|
@@ -9,6 +9,7 @@ import { AiAgentReference } from './agent/ai-agent-client-reference';
|
|
|
9
9
|
* AiClient class serves as a facade for interacting with different AI services.
|
|
10
10
|
* It provides simplified access to AI chatbot and assistant functionalities
|
|
11
11
|
* through its methods.
|
|
12
|
+
* @category AI
|
|
12
13
|
*/
|
|
13
14
|
export declare class AiClient {
|
|
14
15
|
private readonly socketManager;
|
|
@@ -61,5 +62,9 @@ export declare class AiClient {
|
|
|
61
62
|
*/
|
|
62
63
|
executeAiQuery(integrationId: IntegrationId, prompt: string, options?: ExecuteAiQueryOptions): Promise<ExecuteAiQueryResponse>;
|
|
63
64
|
executeAiQueryMulti(integrationIds: Array<IntegrationId>, prompt: string, options?: ExecuteAiQueryOptions): Promise<ExecuteAiQueryMultiResponse>;
|
|
65
|
+
/**
|
|
66
|
+
* Request to execute an AI-powered API call.
|
|
67
|
+
* Allows specifying allowed endpoints and whether to provide an explanation.
|
|
68
|
+
*/
|
|
64
69
|
executeAiApiCall(integrationId: IntegrationId, prompt: string, allowedEndpoints?: string[], provideExplanation?: boolean): Promise<ExecuteAiApiResponse>;
|
|
65
70
|
}
|