@squidcloud/client 1.0.116 → 1.0.118
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 +21518 -21499
- package/dist/common/src/ai-assistant.context.d.ts +12 -12
- package/dist/common/src/ai-assistant.schemas.d.ts +1 -1
- package/dist/common/src/ai-assistant.types.d.ts +12 -12
- package/dist/common/src/api-call.context.d.ts +13 -13
- package/dist/common/src/api.types.d.ts +4 -4
- package/dist/common/src/application.schemas.d.ts +66 -66
- package/dist/common/src/application.types.d.ts +143 -143
- package/dist/common/src/backend-function.schemas.d.ts +1 -1
- package/dist/common/src/backend-function.types.d.ts +1 -1
- package/dist/common/src/backend-run.types.d.ts +2 -2
- package/dist/common/src/bundle-api.types.d.ts +39 -39
- package/dist/common/src/bundle-data.types.d.ts +4 -4
- package/dist/common/src/communication.types.d.ts +12 -12
- package/dist/common/src/context.types.d.ts +40 -40
- package/dist/common/src/distributed-lock.context.d.ts +5 -5
- package/dist/common/src/document.types.d.ts +22 -22
- package/dist/common/src/graphql.context.d.ts +7 -7
- package/dist/common/src/graphql.types.d.ts +9 -9
- package/dist/common/src/heartbeat.types.d.ts +1 -1
- package/dist/common/src/http-status.enum.d.ts +50 -50
- package/dist/common/src/index.d.ts +55 -55
- package/dist/common/src/integrations/ai_assistant.types.d.ts +30 -30
- package/dist/common/src/integrations/api.types.d.ts +80 -80
- package/dist/common/src/integrations/auth.types.d.ts +39 -39
- package/dist/common/src/integrations/database.types.d.ts +231 -231
- package/dist/common/src/integrations/index.d.ts +126 -126
- package/dist/common/src/integrations/observability.types.d.ts +23 -23
- package/dist/common/src/logger.types.d.ts +21 -21
- package/dist/common/src/metrics.types.d.ts +1 -1
- package/dist/common/src/mutation.context.d.ts +14 -14
- package/dist/common/src/mutation.schemas.d.ts +1 -1
- package/dist/common/src/mutation.types.d.ts +53 -53
- package/dist/common/src/named-query.context.d.ts +4 -4
- package/dist/common/src/named-query.schemas.d.ts +1 -1
- package/dist/common/src/named-query.types.d.ts +1 -1
- package/dist/common/src/query/base-query-builder.d.ts +147 -147
- package/dist/common/src/query/index.d.ts +4 -4
- package/dist/common/src/query/pagination.d.ts +44 -44
- package/dist/common/src/query/query-context.d.ts +137 -137
- package/dist/common/src/query/serialized-query.types.d.ts +24 -24
- package/dist/common/src/query.types.d.ts +64 -64
- package/dist/common/src/regions.d.ts +1 -1
- package/dist/common/src/schema/schema.types.d.ts +54 -54
- package/dist/common/src/secret.schemas.d.ts +1 -1
- package/dist/common/src/secret.types.d.ts +22 -22
- package/dist/common/src/security.types.d.ts +1 -1
- package/dist/common/src/socket.schemas.d.ts +1 -1
- package/dist/common/src/socket.types.d.ts +5 -5
- package/dist/common/src/time-units.d.ts +1 -1
- package/dist/common/src/trigger.types.d.ts +1 -1
- package/dist/common/src/types.d.ts +14 -14
- package/dist/common/src/utils/array.d.ts +1 -1
- package/dist/common/src/utils/assert.d.ts +1 -1
- package/dist/common/src/utils/error.d.ts +4 -4
- package/dist/common/src/utils/global.utils.d.ts +1 -1
- package/dist/common/src/utils/http.d.ts +2 -2
- package/dist/common/src/utils/id.d.ts +2 -2
- package/dist/common/src/utils/lock.manager.d.ts +14 -14
- package/dist/common/src/utils/nullish.d.ts +2 -2
- package/dist/common/src/utils/object.d.ts +5 -5
- package/dist/common/src/utils/serialization.d.ts +6 -6
- package/dist/common/src/utils/transforms.d.ts +18 -18
- package/dist/common/src/utils/url.d.ts +1 -1
- package/dist/common/src/utils/validation.d.ts +30 -30
- package/dist/common/src/webhook-response.d.ts +1 -1
- package/dist/common/src/websocket.impl.d.ts +21 -21
- package/dist/node_modules/json-schema-typed/draft-2020-12.d.ts +1239 -1239
- package/dist/typescript-client/src/ai-assistant-client.d.ts +172 -172
- package/dist/typescript-client/src/ai-client.factory.d.ts +11 -11
- package/dist/typescript-client/src/api.manager.d.ts +15 -15
- package/dist/typescript-client/src/auth.manager.d.ts +23 -23
- package/dist/typescript-client/src/backend-function.manager.d.ts +13 -13
- package/dist/typescript-client/src/client-id.service.d.ts +27 -27
- package/dist/typescript-client/src/collection-reference.d.ts +80 -80
- package/dist/typescript-client/src/collection-reference.factory.d.ts +13 -13
- package/dist/typescript-client/src/connection-details.d.ts +23 -23
- package/dist/typescript-client/src/data.manager.d.ts +173 -173
- package/dist/typescript-client/src/destruct.manager.d.ts +12 -12
- package/dist/typescript-client/src/distributed-lock.manager.d.ts +16 -16
- package/dist/typescript-client/src/document-identity.service.d.ts +12 -12
- package/dist/typescript-client/src/document-reference.d.ts +140 -140
- package/dist/typescript-client/src/document-reference.factory.d.ts +13 -13
- package/dist/typescript-client/src/document-store.d.ts +11 -11
- package/dist/typescript-client/src/graphql-client.d.ts +14 -14
- package/dist/typescript-client/src/graphql-client.factory.d.ts +11 -11
- package/dist/typescript-client/src/index.d.ts +8 -8
- package/dist/typescript-client/src/mutation/mutation-sender.d.ts +10 -10
- package/dist/typescript-client/src/named-query.manager.d.ts +12 -12
- package/dist/typescript-client/src/query/deserializer.d.ts +3 -3
- package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +161 -161
- package/dist/typescript-client/src/query/local-query-manager.d.ts +9 -9
- package/dist/typescript-client/src/query/query-builder.factory.d.ts +77 -77
- package/dist/typescript-client/src/query/query-sender.d.ts +33 -33
- package/dist/typescript-client/src/query/query-subscription.manager.d.ts +130 -130
- package/dist/typescript-client/src/query/query.types.d.ts +49 -49
- package/dist/typescript-client/src/rpc.manager.d.ts +27 -27
- package/dist/typescript-client/src/secret.client.d.ts +22 -22
- package/dist/typescript-client/src/socket.manager.d.ts +35 -35
- package/dist/typescript-client/src/squid.d.ts +222 -222
- package/dist/typescript-client/src/state/action.applier.d.ts +7 -7
- package/dist/typescript-client/src/state/actions.d.ts +29 -29
- package/dist/typescript-client/src/state/path_trie.d.ts +27 -27
- package/dist/typescript-client/src/state/state.service.d.ts +22 -22
- package/dist/typescript-client/src/state/state.service.spec.d.ts +1 -1
- package/dist/typescript-client/src/testing/setup-tests.d.ts +1 -1
- package/dist/typescript-client/src/types.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,172 +1,172 @@
|
|
|
1
|
-
import { AiAssistantContext, IntegrationId, OpenAiModelName } from '@squidcloud/common';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { RpcManager } from './rpc.manager';
|
|
4
|
-
import { SocketManager } from './socket.manager';
|
|
5
|
-
export declare class AiAssistantClient {
|
|
6
|
-
private readonly rpcManager;
|
|
7
|
-
private readonly socketManager;
|
|
8
|
-
private readonly integrationId;
|
|
9
|
-
private readonly ongoingChatRequests;
|
|
10
|
-
private readonly ongoingChatSequences;
|
|
11
|
-
constructor(rpcManager: RpcManager, socketManager: SocketManager, integrationId: IntegrationId);
|
|
12
|
-
/**
|
|
13
|
-
* Retrieves a profile reference for the provided id. A profile reference
|
|
14
|
-
* can be used to create and update profiles, add instructions and context
|
|
15
|
-
* and start chats.
|
|
16
|
-
*
|
|
17
|
-
* @param id - The id of the profile.
|
|
18
|
-
* @returns The profile reference.
|
|
19
|
-
*/
|
|
20
|
-
profile(id: string): AiAssistantProfileReference;
|
|
21
|
-
/**
|
|
22
|
-
* Sends a prompt to the specified profile id.
|
|
23
|
-
*
|
|
24
|
-
* @param profileId - The profile id.
|
|
25
|
-
* @param prompt - The prompt.
|
|
26
|
-
* @returns An observable that emits when a new response token is received. The emitted value is the entire response
|
|
27
|
-
* that has been received so far.
|
|
28
|
-
*/
|
|
29
|
-
chat(profileId: string, prompt: string): Observable<string>;
|
|
30
|
-
private handleChatResponse;
|
|
31
|
-
}
|
|
32
|
-
declare class AiAssistantProfileReference {
|
|
33
|
-
private readonly client;
|
|
34
|
-
private readonly integrationId;
|
|
35
|
-
private readonly profileId;
|
|
36
|
-
constructor(client: AiAssistantClient, integrationId: IntegrationId, profileId: string);
|
|
37
|
-
/**
|
|
38
|
-
* Sends a prompt to the current profile.
|
|
39
|
-
*
|
|
40
|
-
* @param prompt - The prompt.
|
|
41
|
-
* @returns An observable that emits when a new response token is received. The emitted value is the entire response
|
|
42
|
-
* that has been received so far.
|
|
43
|
-
*/
|
|
44
|
-
chat(prompt: string): Observable<string>;
|
|
45
|
-
/**
|
|
46
|
-
* Retrieves a context reference for the current profile. A context reference can be used to add a new context entry
|
|
47
|
-
* to the profile, or update/delete an existing entry context.
|
|
48
|
-
*
|
|
49
|
-
* @param id - The id of the context entry. If no id is passed, an id will be
|
|
50
|
-
* generated and the reference will point to a new context entry.
|
|
51
|
-
* @returns The context reference.
|
|
52
|
-
*/
|
|
53
|
-
context(id?: string): AiAssistantContextReference;
|
|
54
|
-
/**
|
|
55
|
-
* Retrieves an instruction reference for the current profile. An instruction reference can be used to add a new
|
|
56
|
-
* instruction entry to the profile, or update/delete an existing instruction entry.
|
|
57
|
-
*
|
|
58
|
-
* @param id - The id of the instruction entry. If no id is passed, an id will be
|
|
59
|
-
* generated and the reference will point to a new instruction entry.
|
|
60
|
-
* @returns The instruction reference.
|
|
61
|
-
*/
|
|
62
|
-
instruction(id?: string): AiAssistantInstructionReference;
|
|
63
|
-
/**
|
|
64
|
-
* Adds a new profile to the assistant. This will result in an error if a profile already exists with the same id.
|
|
65
|
-
*
|
|
66
|
-
* @param data An object containing options for creating the profile.
|
|
67
|
-
* @param data.modelName - The name of the OpenAI model (`gpt-3.5 or `gpt-4`).
|
|
68
|
-
* @param data.isPublic - Whether the chat functionality of the profile can be accessed without security rules.
|
|
69
|
-
* @returns A promise that resolves when the profile is successfully created.
|
|
70
|
-
*/
|
|
71
|
-
insert(data: {
|
|
72
|
-
modelName: OpenAiModelName;
|
|
73
|
-
isPublic: boolean;
|
|
74
|
-
}): Promise<void>;
|
|
75
|
-
/**
|
|
76
|
-
* Updates an existing assistant profile. This will result in an error if a profile has not yet been created for the
|
|
77
|
-
* current profile id.
|
|
78
|
-
*
|
|
79
|
-
* @param data An object containing options for updating the profile.
|
|
80
|
-
* @param data.modelName - The name of the OpenAI model (`gpt-3.5 or `gpt-4`).
|
|
81
|
-
* @param data.isPublic - Whether the chat functionality of the profile can be accessed without security rules.
|
|
82
|
-
* @returns A promise that resolves when the profile is successfully updated.
|
|
83
|
-
*/
|
|
84
|
-
update(data: {
|
|
85
|
-
modelName?: OpenAiModelName;
|
|
86
|
-
isPublic?: boolean;
|
|
87
|
-
}): Promise<void>;
|
|
88
|
-
/**
|
|
89
|
-
* Deletes an existing assistant profile. This will result in an error if a profile has not yet been created for the
|
|
90
|
-
* current profile id.
|
|
91
|
-
*
|
|
92
|
-
* @returns A promise that resolves when the profile is successfully deleted.
|
|
93
|
-
*/
|
|
94
|
-
delete(): Promise<void>;
|
|
95
|
-
}
|
|
96
|
-
declare class AiAssistantContextReference {
|
|
97
|
-
private readonly client;
|
|
98
|
-
private readonly integrationId;
|
|
99
|
-
private readonly profileId;
|
|
100
|
-
private readonly id;
|
|
101
|
-
constructor(client: AiAssistantClient, integrationId: IntegrationId, profileId: string, id?: string);
|
|
102
|
-
/**
|
|
103
|
-
* Adds a new context entry to the assistant profile. This will result in an error if an entry already exists with
|
|
104
|
-
* the same id.
|
|
105
|
-
*
|
|
106
|
-
* @param data An object containing options for creating the entry.
|
|
107
|
-
* @param data.title - The title of the entry.
|
|
108
|
-
* @param data.context - The context data.
|
|
109
|
-
* @returns A promise that resolves when the context is successfully created.
|
|
110
|
-
*/
|
|
111
|
-
insert(data: {
|
|
112
|
-
title: string;
|
|
113
|
-
context: AiAssistantContext;
|
|
114
|
-
}): Promise<void>;
|
|
115
|
-
/**
|
|
116
|
-
* Updates an existing context entry on the assistant profile. This will result in an error if an entry has not yet
|
|
117
|
-
* been created for the current context id.
|
|
118
|
-
*
|
|
119
|
-
* @param data An object containing options for updated the entry.
|
|
120
|
-
* @param data.title - The title of the entry.
|
|
121
|
-
* @param data.context - The context data.
|
|
122
|
-
* @returns A promise that resolves when the context is successfully updated.
|
|
123
|
-
*/
|
|
124
|
-
update(data: {
|
|
125
|
-
title?: string;
|
|
126
|
-
context?: AiAssistantContext;
|
|
127
|
-
}): Promise<void>;
|
|
128
|
-
/**
|
|
129
|
-
* Deletes an existing context entry on the assistant profile. This will result in an error if an entry has not yet
|
|
130
|
-
* been created for the current context id.
|
|
131
|
-
*
|
|
132
|
-
* @returns A promise that resolves when the context is successfully deleted.
|
|
133
|
-
*/
|
|
134
|
-
delete(): Promise<void>;
|
|
135
|
-
}
|
|
136
|
-
declare class AiAssistantInstructionReference {
|
|
137
|
-
private readonly client;
|
|
138
|
-
private readonly integrationId;
|
|
139
|
-
private readonly profileId;
|
|
140
|
-
private readonly id;
|
|
141
|
-
constructor(client: AiAssistantClient, integrationId: IntegrationId, profileId: string, id?: string);
|
|
142
|
-
/**
|
|
143
|
-
* Adds a new instruction entry to the assistant profile. This will result in an error if an entry already exists with
|
|
144
|
-
* the same id.
|
|
145
|
-
*
|
|
146
|
-
* @param data An object containing options for creating the entry.
|
|
147
|
-
* @param data.instruction - The instruction data.
|
|
148
|
-
* @returns A promise that resolves when the instruction is successfully created.
|
|
149
|
-
*/
|
|
150
|
-
insert(data: {
|
|
151
|
-
instruction: string;
|
|
152
|
-
}): Promise<void>;
|
|
153
|
-
/**
|
|
154
|
-
* Updates an existing instruction entry on the assistant profile. This will result in an error if an entry has not
|
|
155
|
-
* yet been created for the current instruction id.
|
|
156
|
-
*
|
|
157
|
-
* @param data An object containing options for updated the entry.
|
|
158
|
-
* @param data.instruction - The instruction data.
|
|
159
|
-
* @returns A promise that resolves when the instruction is successfully updated.
|
|
160
|
-
*/
|
|
161
|
-
update(data: {
|
|
162
|
-
instruction: string;
|
|
163
|
-
}): Promise<void>;
|
|
164
|
-
/**
|
|
165
|
-
* Deletes an existing instruction entry on the assistant profile. This will result in an error if an entry has not
|
|
166
|
-
* yet been created for the current instruction id.
|
|
167
|
-
*
|
|
168
|
-
* @returns A promise that resolves when the instruction is successfully deleted.
|
|
169
|
-
*/
|
|
170
|
-
delete(): Promise<void>;
|
|
171
|
-
}
|
|
172
|
-
export {};
|
|
1
|
+
import { AiAssistantContext, IntegrationId, OpenAiModelName } from '@squidcloud/common';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RpcManager } from './rpc.manager';
|
|
4
|
+
import { SocketManager } from './socket.manager';
|
|
5
|
+
export declare class AiAssistantClient {
|
|
6
|
+
private readonly rpcManager;
|
|
7
|
+
private readonly socketManager;
|
|
8
|
+
private readonly integrationId;
|
|
9
|
+
private readonly ongoingChatRequests;
|
|
10
|
+
private readonly ongoingChatSequences;
|
|
11
|
+
constructor(rpcManager: RpcManager, socketManager: SocketManager, integrationId: IntegrationId);
|
|
12
|
+
/**
|
|
13
|
+
* Retrieves a profile reference for the provided id. A profile reference
|
|
14
|
+
* can be used to create and update profiles, add instructions and context
|
|
15
|
+
* and start chats.
|
|
16
|
+
*
|
|
17
|
+
* @param id - The id of the profile.
|
|
18
|
+
* @returns The profile reference.
|
|
19
|
+
*/
|
|
20
|
+
profile(id: string): AiAssistantProfileReference;
|
|
21
|
+
/**
|
|
22
|
+
* Sends a prompt to the specified profile id.
|
|
23
|
+
*
|
|
24
|
+
* @param profileId - The profile id.
|
|
25
|
+
* @param prompt - The prompt.
|
|
26
|
+
* @returns An observable that emits when a new response token is received. The emitted value is the entire response
|
|
27
|
+
* that has been received so far.
|
|
28
|
+
*/
|
|
29
|
+
chat(profileId: string, prompt: string): Observable<string>;
|
|
30
|
+
private handleChatResponse;
|
|
31
|
+
}
|
|
32
|
+
declare class AiAssistantProfileReference {
|
|
33
|
+
private readonly client;
|
|
34
|
+
private readonly integrationId;
|
|
35
|
+
private readonly profileId;
|
|
36
|
+
constructor(client: AiAssistantClient, integrationId: IntegrationId, profileId: string);
|
|
37
|
+
/**
|
|
38
|
+
* Sends a prompt to the current profile.
|
|
39
|
+
*
|
|
40
|
+
* @param prompt - The prompt.
|
|
41
|
+
* @returns An observable that emits when a new response token is received. The emitted value is the entire response
|
|
42
|
+
* that has been received so far.
|
|
43
|
+
*/
|
|
44
|
+
chat(prompt: string): Observable<string>;
|
|
45
|
+
/**
|
|
46
|
+
* Retrieves a context reference for the current profile. A context reference can be used to add a new context entry
|
|
47
|
+
* to the profile, or update/delete an existing entry context.
|
|
48
|
+
*
|
|
49
|
+
* @param id - The id of the context entry. If no id is passed, an id will be
|
|
50
|
+
* generated and the reference will point to a new context entry.
|
|
51
|
+
* @returns The context reference.
|
|
52
|
+
*/
|
|
53
|
+
context(id?: string): AiAssistantContextReference;
|
|
54
|
+
/**
|
|
55
|
+
* Retrieves an instruction reference for the current profile. An instruction reference can be used to add a new
|
|
56
|
+
* instruction entry to the profile, or update/delete an existing instruction entry.
|
|
57
|
+
*
|
|
58
|
+
* @param id - The id of the instruction entry. If no id is passed, an id will be
|
|
59
|
+
* generated and the reference will point to a new instruction entry.
|
|
60
|
+
* @returns The instruction reference.
|
|
61
|
+
*/
|
|
62
|
+
instruction(id?: string): AiAssistantInstructionReference;
|
|
63
|
+
/**
|
|
64
|
+
* Adds a new profile to the assistant. This will result in an error if a profile already exists with the same id.
|
|
65
|
+
*
|
|
66
|
+
* @param data An object containing options for creating the profile.
|
|
67
|
+
* @param data.modelName - The name of the OpenAI model (`gpt-3.5 or `gpt-4`).
|
|
68
|
+
* @param data.isPublic - Whether the chat functionality of the profile can be accessed without security rules.
|
|
69
|
+
* @returns A promise that resolves when the profile is successfully created.
|
|
70
|
+
*/
|
|
71
|
+
insert(data: {
|
|
72
|
+
modelName: OpenAiModelName;
|
|
73
|
+
isPublic: boolean;
|
|
74
|
+
}): Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* Updates an existing assistant profile. This will result in an error if a profile has not yet been created for the
|
|
77
|
+
* current profile id.
|
|
78
|
+
*
|
|
79
|
+
* @param data An object containing options for updating the profile.
|
|
80
|
+
* @param data.modelName - The name of the OpenAI model (`gpt-3.5 or `gpt-4`).
|
|
81
|
+
* @param data.isPublic - Whether the chat functionality of the profile can be accessed without security rules.
|
|
82
|
+
* @returns A promise that resolves when the profile is successfully updated.
|
|
83
|
+
*/
|
|
84
|
+
update(data: {
|
|
85
|
+
modelName?: OpenAiModelName;
|
|
86
|
+
isPublic?: boolean;
|
|
87
|
+
}): Promise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* Deletes an existing assistant profile. This will result in an error if a profile has not yet been created for the
|
|
90
|
+
* current profile id.
|
|
91
|
+
*
|
|
92
|
+
* @returns A promise that resolves when the profile is successfully deleted.
|
|
93
|
+
*/
|
|
94
|
+
delete(): Promise<void>;
|
|
95
|
+
}
|
|
96
|
+
declare class AiAssistantContextReference {
|
|
97
|
+
private readonly client;
|
|
98
|
+
private readonly integrationId;
|
|
99
|
+
private readonly profileId;
|
|
100
|
+
private readonly id;
|
|
101
|
+
constructor(client: AiAssistantClient, integrationId: IntegrationId, profileId: string, id?: string);
|
|
102
|
+
/**
|
|
103
|
+
* Adds a new context entry to the assistant profile. This will result in an error if an entry already exists with
|
|
104
|
+
* the same id.
|
|
105
|
+
*
|
|
106
|
+
* @param data An object containing options for creating the entry.
|
|
107
|
+
* @param data.title - The title of the entry.
|
|
108
|
+
* @param data.context - The context data.
|
|
109
|
+
* @returns A promise that resolves when the context is successfully created.
|
|
110
|
+
*/
|
|
111
|
+
insert(data: {
|
|
112
|
+
title: string;
|
|
113
|
+
context: AiAssistantContext;
|
|
114
|
+
}): Promise<void>;
|
|
115
|
+
/**
|
|
116
|
+
* Updates an existing context entry on the assistant profile. This will result in an error if an entry has not yet
|
|
117
|
+
* been created for the current context id.
|
|
118
|
+
*
|
|
119
|
+
* @param data An object containing options for updated the entry.
|
|
120
|
+
* @param data.title - The title of the entry.
|
|
121
|
+
* @param data.context - The context data.
|
|
122
|
+
* @returns A promise that resolves when the context is successfully updated.
|
|
123
|
+
*/
|
|
124
|
+
update(data: {
|
|
125
|
+
title?: string;
|
|
126
|
+
context?: AiAssistantContext;
|
|
127
|
+
}): Promise<void>;
|
|
128
|
+
/**
|
|
129
|
+
* Deletes an existing context entry on the assistant profile. This will result in an error if an entry has not yet
|
|
130
|
+
* been created for the current context id.
|
|
131
|
+
*
|
|
132
|
+
* @returns A promise that resolves when the context is successfully deleted.
|
|
133
|
+
*/
|
|
134
|
+
delete(): Promise<void>;
|
|
135
|
+
}
|
|
136
|
+
declare class AiAssistantInstructionReference {
|
|
137
|
+
private readonly client;
|
|
138
|
+
private readonly integrationId;
|
|
139
|
+
private readonly profileId;
|
|
140
|
+
private readonly id;
|
|
141
|
+
constructor(client: AiAssistantClient, integrationId: IntegrationId, profileId: string, id?: string);
|
|
142
|
+
/**
|
|
143
|
+
* Adds a new instruction entry to the assistant profile. This will result in an error if an entry already exists with
|
|
144
|
+
* the same id.
|
|
145
|
+
*
|
|
146
|
+
* @param data An object containing options for creating the entry.
|
|
147
|
+
* @param data.instruction - The instruction data.
|
|
148
|
+
* @returns A promise that resolves when the instruction is successfully created.
|
|
149
|
+
*/
|
|
150
|
+
insert(data: {
|
|
151
|
+
instruction: string;
|
|
152
|
+
}): Promise<void>;
|
|
153
|
+
/**
|
|
154
|
+
* Updates an existing instruction entry on the assistant profile. This will result in an error if an entry has not
|
|
155
|
+
* yet been created for the current instruction id.
|
|
156
|
+
*
|
|
157
|
+
* @param data An object containing options for updated the entry.
|
|
158
|
+
* @param data.instruction - The instruction data.
|
|
159
|
+
* @returns A promise that resolves when the instruction is successfully updated.
|
|
160
|
+
*/
|
|
161
|
+
update(data: {
|
|
162
|
+
instruction: string;
|
|
163
|
+
}): Promise<void>;
|
|
164
|
+
/**
|
|
165
|
+
* Deletes an existing instruction entry on the assistant profile. This will result in an error if an entry has not
|
|
166
|
+
* yet been created for the current instruction id.
|
|
167
|
+
*
|
|
168
|
+
* @returns A promise that resolves when the instruction is successfully deleted.
|
|
169
|
+
*/
|
|
170
|
+
delete(): Promise<void>;
|
|
171
|
+
}
|
|
172
|
+
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { IntegrationId } from '@squidcloud/common';
|
|
2
|
-
import { AiAssistantClient } from './ai-assistant-client';
|
|
3
|
-
import { RpcManager } from './rpc.manager';
|
|
4
|
-
import { SocketManager } from './socket.manager';
|
|
5
|
-
export declare class AiClientFactory {
|
|
6
|
-
private readonly rpcManager;
|
|
7
|
-
private readonly socketManager;
|
|
8
|
-
private readonly assistantsMap;
|
|
9
|
-
constructor(rpcManager: RpcManager, socketManager: SocketManager);
|
|
10
|
-
getAssistant(integrationId: IntegrationId): AiAssistantClient;
|
|
11
|
-
}
|
|
1
|
+
import { IntegrationId } from '@squidcloud/common';
|
|
2
|
+
import { AiAssistantClient } from './ai-assistant-client';
|
|
3
|
+
import { RpcManager } from './rpc.manager';
|
|
4
|
+
import { SocketManager } from './socket.manager';
|
|
5
|
+
export declare class AiClientFactory {
|
|
6
|
+
private readonly rpcManager;
|
|
7
|
+
private readonly socketManager;
|
|
8
|
+
private readonly assistantsMap;
|
|
9
|
+
constructor(rpcManager: RpcManager, socketManager: SocketManager);
|
|
10
|
+
getAssistant(integrationId: IntegrationId): AiAssistantClient;
|
|
11
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { ApiEndpointId, IntegrationId } from '@squidcloud/common';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { RpcManager } from './rpc.manager';
|
|
4
|
-
import { SocketManager } from './socket.manager';
|
|
5
|
-
import { ClientIdService } from './client-id.service';
|
|
6
|
-
export declare class ApiManager {
|
|
7
|
-
private readonly clientIdService;
|
|
8
|
-
private readonly rpcManager;
|
|
9
|
-
private readonly socketManager;
|
|
10
|
-
private readonly apiServerUrlOverrideMapping;
|
|
11
|
-
private readonly ongoingApiExecutions;
|
|
12
|
-
constructor(clientIdService: ClientIdService, rpcManager: RpcManager, socketManager: SocketManager, apiServerUrlOverrideMapping?: Record<IntegrationId, string>);
|
|
13
|
-
callApiAndSubscribe<T>(integrationId: IntegrationId, endpointId: ApiEndpointId, request: Record<string, any>): Observable<T>;
|
|
14
|
-
private handleApiResponse;
|
|
15
|
-
}
|
|
1
|
+
import { ApiEndpointId, IntegrationId } from '@squidcloud/common';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RpcManager } from './rpc.manager';
|
|
4
|
+
import { SocketManager } from './socket.manager';
|
|
5
|
+
import { ClientIdService } from './client-id.service';
|
|
6
|
+
export declare class ApiManager {
|
|
7
|
+
private readonly clientIdService;
|
|
8
|
+
private readonly rpcManager;
|
|
9
|
+
private readonly socketManager;
|
|
10
|
+
private readonly apiServerUrlOverrideMapping;
|
|
11
|
+
private readonly ongoingApiExecutions;
|
|
12
|
+
constructor(clientIdService: ClientIdService, rpcManager: RpcManager, socketManager: SocketManager, apiServerUrlOverrideMapping?: Record<IntegrationId, string>);
|
|
13
|
+
callApiAndSubscribe<T>(integrationId: IntegrationId, endpointId: ApiEndpointId, request: Record<string, any>): Observable<T>;
|
|
14
|
+
private handleApiResponse;
|
|
15
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { ApiKey, AuthToken, IntegrationId } from '@squidcloud/common';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { DestructManager } from './destruct.manager';
|
|
4
|
-
type AuthData = {
|
|
5
|
-
token: string | undefined;
|
|
6
|
-
integrationId?: IntegrationId;
|
|
7
|
-
};
|
|
8
|
-
export declare class AuthManager {
|
|
9
|
-
private readonly destructManager;
|
|
10
|
-
private readonly apiKey;
|
|
11
|
-
private readonly authIdTokenSet;
|
|
12
|
-
private readonly authIdTokenObservableSubject;
|
|
13
|
-
private shouldWaitForAuth;
|
|
14
|
-
private idToken;
|
|
15
|
-
private integrationId;
|
|
16
|
-
constructor(destructManager: DestructManager, apiKey: ApiKey | undefined);
|
|
17
|
-
setAuthIdToken(idToken: string | undefined | Promise<string | undefined> | Observable<string | undefined>, integrationId?: IntegrationId): void;
|
|
18
|
-
observeAuthIdToken(): Observable<AuthData>;
|
|
19
|
-
waitForReadyState(): Promise<void>;
|
|
20
|
-
getApiKey(): ApiKey | undefined;
|
|
21
|
-
getAuthToken(): AuthToken | undefined;
|
|
22
|
-
}
|
|
23
|
-
export {};
|
|
1
|
+
import { ApiKey, AuthToken, IntegrationId } from '@squidcloud/common';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { DestructManager } from './destruct.manager';
|
|
4
|
+
type AuthData = {
|
|
5
|
+
token: string | undefined;
|
|
6
|
+
integrationId?: IntegrationId;
|
|
7
|
+
};
|
|
8
|
+
export declare class AuthManager {
|
|
9
|
+
private readonly destructManager;
|
|
10
|
+
private readonly apiKey;
|
|
11
|
+
private readonly authIdTokenSet;
|
|
12
|
+
private readonly authIdTokenObservableSubject;
|
|
13
|
+
private shouldWaitForAuth;
|
|
14
|
+
private idToken;
|
|
15
|
+
private integrationId;
|
|
16
|
+
constructor(destructManager: DestructManager, apiKey: ApiKey | undefined);
|
|
17
|
+
setAuthIdToken(idToken: string | undefined | Promise<string | undefined> | Observable<string | undefined>, integrationId?: IntegrationId): void;
|
|
18
|
+
observeAuthIdToken(): Observable<AuthData>;
|
|
19
|
+
waitForReadyState(): Promise<void>;
|
|
20
|
+
getApiKey(): ApiKey | undefined;
|
|
21
|
+
getAuthToken(): AuthToken | undefined;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { RpcManager } from './rpc.manager';
|
|
3
|
-
import { SocketManager } from './socket.manager';
|
|
4
|
-
import { ClientIdService } from './client-id.service';
|
|
5
|
-
export declare class BackendFunctionManager {
|
|
6
|
-
private readonly clientIdService;
|
|
7
|
-
private readonly rpcManager;
|
|
8
|
-
private readonly socketManager;
|
|
9
|
-
private readonly ongoingFunctionExecutions;
|
|
10
|
-
constructor(clientIdService: ClientIdService, rpcManager: RpcManager, socketManager: SocketManager);
|
|
11
|
-
executeFunctionAndSubscribe<T>(functionName: string, ...params: any[]): Observable<T>;
|
|
12
|
-
private handleFunctionResponse;
|
|
13
|
-
}
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { RpcManager } from './rpc.manager';
|
|
3
|
+
import { SocketManager } from './socket.manager';
|
|
4
|
+
import { ClientIdService } from './client-id.service';
|
|
5
|
+
export declare class BackendFunctionManager {
|
|
6
|
+
private readonly clientIdService;
|
|
7
|
+
private readonly rpcManager;
|
|
8
|
+
private readonly socketManager;
|
|
9
|
+
private readonly ongoingFunctionExecutions;
|
|
10
|
+
constructor(clientIdService: ClientIdService, rpcManager: RpcManager, socketManager: SocketManager);
|
|
11
|
+
executeFunctionAndSubscribe<T>(functionName: string, ...params: any[]): Observable<T>;
|
|
12
|
+
private handleFunctionResponse;
|
|
13
|
+
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { ClientId } from '@squidcloud/common';
|
|
3
|
-
import { DestructManager } from './destruct.manager';
|
|
4
|
-
/**
|
|
5
|
-
* Whenever a squid client is created, it assigns itself a client id.
|
|
6
|
-
* Later on, if the squid client disconnects for a specified time interval, it will generate itself a new client id.
|
|
7
|
-
* The client id is generated before the socket is reconnected, so it is possible that the new client id is generated,
|
|
8
|
-
* but the socket has not connected yet.
|
|
9
|
-
*
|
|
10
|
-
* Short-term disconnects/reconnects of the socket do not cause the client id to be regenerated.
|
|
11
|
-
*/
|
|
12
|
-
export declare class ClientIdService {
|
|
13
|
-
private readonly destructManager;
|
|
14
|
-
private readonly clientTooOldSubject;
|
|
15
|
-
private readonly clientIdSubject;
|
|
16
|
-
private readonly isTenant;
|
|
17
|
-
constructor(destructManager: DestructManager);
|
|
18
|
-
observeClientId(): Observable<ClientId>;
|
|
19
|
-
observeClientTooOld(): Observable<void>;
|
|
20
|
-
/** there was a long-term disconnection of the socket */
|
|
21
|
-
notifyClientTooOld(): void;
|
|
22
|
-
notifyClientReadyToBeRegenerated(): void;
|
|
23
|
-
observeClientReadyToBeRegenerated(): Observable<void>;
|
|
24
|
-
getClientId(): ClientId;
|
|
25
|
-
isClientTooOld(): boolean;
|
|
26
|
-
private generateClientId;
|
|
27
|
-
}
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { ClientId } from '@squidcloud/common';
|
|
3
|
+
import { DestructManager } from './destruct.manager';
|
|
4
|
+
/**
|
|
5
|
+
* Whenever a squid client is created, it assigns itself a client id.
|
|
6
|
+
* Later on, if the squid client disconnects for a specified time interval, it will generate itself a new client id.
|
|
7
|
+
* The client id is generated before the socket is reconnected, so it is possible that the new client id is generated,
|
|
8
|
+
* but the socket has not connected yet.
|
|
9
|
+
*
|
|
10
|
+
* Short-term disconnects/reconnects of the socket do not cause the client id to be regenerated.
|
|
11
|
+
*/
|
|
12
|
+
export declare class ClientIdService {
|
|
13
|
+
private readonly destructManager;
|
|
14
|
+
private readonly clientTooOldSubject;
|
|
15
|
+
private readonly clientIdSubject;
|
|
16
|
+
private readonly isTenant;
|
|
17
|
+
constructor(destructManager: DestructManager);
|
|
18
|
+
observeClientId(): Observable<ClientId>;
|
|
19
|
+
observeClientTooOld(): Observable<void>;
|
|
20
|
+
/** there was a long-term disconnection of the socket */
|
|
21
|
+
notifyClientTooOld(): void;
|
|
22
|
+
notifyClientReadyToBeRegenerated(): void;
|
|
23
|
+
observeClientReadyToBeRegenerated(): Observable<void>;
|
|
24
|
+
getClientId(): ClientId;
|
|
25
|
+
isClientTooOld(): boolean;
|
|
26
|
+
private generateClientId;
|
|
27
|
+
}
|