@squidcloud/client 1.0.128 → 1.0.129

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist/cjs/index.js +11086 -11001
  2. package/dist/common/src/ai-assistant.context.d.ts +12 -12
  3. package/dist/common/src/ai-assistant.schemas.d.ts +1 -1
  4. package/dist/common/src/ai-assistant.types.d.ts +21 -21
  5. package/dist/common/src/api-call.context.d.ts +13 -13
  6. package/dist/common/src/api.types.d.ts +4 -4
  7. package/dist/common/src/application.schemas.d.ts +66 -66
  8. package/dist/common/src/application.types.d.ts +143 -143
  9. package/dist/common/src/backend-function.schemas.d.ts +1 -1
  10. package/dist/common/src/backend-function.types.d.ts +1 -1
  11. package/dist/common/src/backend-run.types.d.ts +2 -2
  12. package/dist/common/src/bundle-api.types.d.ts +39 -39
  13. package/dist/common/src/bundle-data.types.d.ts +4 -4
  14. package/dist/common/src/communication.types.d.ts +8 -8
  15. package/dist/common/src/context.types.d.ts +40 -40
  16. package/dist/common/src/distributed-lock.context.d.ts +5 -5
  17. package/dist/common/src/document.types.d.ts +22 -22
  18. package/dist/common/src/graphql.context.d.ts +7 -7
  19. package/dist/common/src/graphql.types.d.ts +9 -9
  20. package/dist/common/src/heartbeat.types.d.ts +1 -1
  21. package/dist/common/src/http-status.enum.d.ts +50 -50
  22. package/dist/common/src/index.d.ts +54 -54
  23. package/dist/common/src/integrations/ai_assistant.types.d.ts +30 -30
  24. package/dist/common/src/integrations/api.types.d.ts +80 -80
  25. package/dist/common/src/integrations/auth.types.d.ts +39 -39
  26. package/dist/common/src/integrations/database.types.d.ts +274 -248
  27. package/dist/common/src/integrations/index.d.ts +134 -132
  28. package/dist/common/src/integrations/observability.types.d.ts +23 -23
  29. package/dist/common/src/logger.types.d.ts +21 -21
  30. package/dist/common/src/metrics.types.d.ts +1 -1
  31. package/dist/common/src/mutation.context.d.ts +14 -14
  32. package/dist/common/src/mutation.schemas.d.ts +1 -1
  33. package/dist/common/src/mutation.types.d.ts +53 -53
  34. package/dist/common/src/named-query.context.d.ts +4 -4
  35. package/dist/common/src/named-query.schemas.d.ts +1 -1
  36. package/dist/common/src/named-query.types.d.ts +1 -1
  37. package/dist/common/src/query/base-query-builder.d.ts +147 -147
  38. package/dist/common/src/query/index.d.ts +4 -4
  39. package/dist/common/src/query/pagination.d.ts +62 -62
  40. package/dist/common/src/query/query-context.d.ts +137 -137
  41. package/dist/common/src/query/serialized-query.types.d.ts +24 -24
  42. package/dist/common/src/query.types.d.ts +64 -64
  43. package/dist/common/src/regions.d.ts +1 -1
  44. package/dist/common/src/schema/schema.types.d.ts +54 -54
  45. package/dist/common/src/secret.schemas.d.ts +1 -1
  46. package/dist/common/src/secret.types.d.ts +22 -22
  47. package/dist/common/src/security.types.d.ts +1 -1
  48. package/dist/common/src/socket.schemas.d.ts +1 -1
  49. package/dist/common/src/socket.types.d.ts +5 -5
  50. package/dist/common/src/time-units.d.ts +1 -1
  51. package/dist/common/src/trigger.types.d.ts +1 -1
  52. package/dist/common/src/types.d.ts +14 -14
  53. package/dist/common/src/utils/array.d.ts +1 -1
  54. package/dist/common/src/utils/assert.d.ts +1 -1
  55. package/dist/common/src/utils/error.d.ts +4 -4
  56. package/dist/common/src/utils/global.utils.d.ts +1 -1
  57. package/dist/common/src/utils/http.d.ts +2 -2
  58. package/dist/common/src/utils/id.d.ts +2 -2
  59. package/dist/common/src/utils/lock.manager.d.ts +14 -14
  60. package/dist/common/src/utils/object.d.ts +5 -5
  61. package/dist/common/src/utils/serialization.d.ts +6 -6
  62. package/dist/common/src/utils/transforms.d.ts +18 -18
  63. package/dist/common/src/utils/url.d.ts +1 -1
  64. package/dist/common/src/utils/validation.d.ts +25 -25
  65. package/dist/common/src/webhook-response.d.ts +1 -1
  66. package/dist/common/src/websocket.impl.d.ts +21 -21
  67. package/dist/node_modules/json-schema-typed/draft-2020-12.d.ts +1239 -1239
  68. package/dist/typescript-client/src/ai-assistant-client.d.ts +174 -174
  69. package/dist/typescript-client/src/ai-client.factory.d.ts +11 -11
  70. package/dist/typescript-client/src/api.manager.d.ts +11 -11
  71. package/dist/typescript-client/src/auth.manager.d.ts +23 -23
  72. package/dist/typescript-client/src/backend-function.manager.d.ts +9 -9
  73. package/dist/typescript-client/src/client-id.service.d.ts +27 -27
  74. package/dist/typescript-client/src/collection-reference.d.ts +80 -80
  75. package/dist/typescript-client/src/collection-reference.factory.d.ts +13 -13
  76. package/dist/typescript-client/src/connection-details.d.ts +23 -23
  77. package/dist/typescript-client/src/data.manager.d.ts +173 -173
  78. package/dist/typescript-client/src/destruct.manager.d.ts +12 -12
  79. package/dist/typescript-client/src/distributed-lock.manager.d.ts +16 -16
  80. package/dist/typescript-client/src/document-identity.service.d.ts +12 -12
  81. package/dist/typescript-client/src/document-reference.d.ts +140 -140
  82. package/dist/typescript-client/src/document-reference.factory.d.ts +13 -13
  83. package/dist/typescript-client/src/document-store.d.ts +14 -14
  84. package/dist/typescript-client/src/graphql-client.d.ts +14 -14
  85. package/dist/typescript-client/src/graphql-client.factory.d.ts +11 -11
  86. package/dist/typescript-client/src/index.d.ts +9 -9
  87. package/dist/typescript-client/src/mutation/mutation-sender.d.ts +10 -10
  88. package/dist/typescript-client/src/named-query.manager.d.ts +12 -12
  89. package/dist/typescript-client/src/query/deserializer.d.ts +3 -3
  90. package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +161 -161
  91. package/dist/typescript-client/src/query/local-query-manager.d.ts +9 -9
  92. package/dist/typescript-client/src/query/query-builder.factory.d.ts +77 -77
  93. package/dist/typescript-client/src/query/query-sender.d.ts +33 -33
  94. package/dist/typescript-client/src/query/query-subscription.manager.d.ts +130 -130
  95. package/dist/typescript-client/src/query/query.types.d.ts +49 -49
  96. package/dist/typescript-client/src/rate-limiter.d.ts +32 -32
  97. package/dist/typescript-client/src/rpc.manager.d.ts +29 -29
  98. package/dist/typescript-client/src/secret.client.d.ts +22 -22
  99. package/dist/typescript-client/src/socket.manager.d.ts +39 -35
  100. package/dist/typescript-client/src/squid.d.ts +222 -222
  101. package/dist/typescript-client/src/state/action.applier.d.ts +7 -7
  102. package/dist/typescript-client/src/state/actions.d.ts +29 -29
  103. package/dist/typescript-client/src/state/path_trie.d.ts +27 -27
  104. package/dist/typescript-client/src/state/state.service.d.ts +22 -22
  105. package/dist/typescript-client/src/state/state.service.spec.d.ts +1 -1
  106. package/dist/typescript-client/src/testing/setup-tests.d.ts +1 -1
  107. package/dist/typescript-client/src/types.d.ts +2 -2
  108. package/package.json +1 -1
@@ -1,174 +1,174 @@
1
- import { AiAssistantChatOptions, AiAssistantContext, AiModelName, IntegrationId } 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 ongoingChatSequences;
10
- constructor(rpcManager: RpcManager, socketManager: SocketManager, integrationId: IntegrationId);
11
- /**
12
- * Retrieves a profile reference for the provided id. A profile reference
13
- * can be used to create and update profiles, add instructions and context
14
- * and start chats.
15
- *
16
- * @param id - The id of the profile.
17
- * @returns The profile reference.
18
- */
19
- profile(id: string): AiAssistantProfileReference;
20
- /**
21
- * Sends a prompt to the specified profile id.
22
- *
23
- * @param profileId - The profile id.
24
- * @param prompt - The prompt.
25
- * @param options - The options to send to the chat model.
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, options?: AiAssistantChatOptions): Observable<string>;
30
- private handleChatResponse;
31
- }
32
- export 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
- * @param options - The chat options.
42
- * @returns An observable that emits when a new response token is received. The emitted value is the entire response
43
- * that has been received so far.
44
- */
45
- chat(prompt: string, options?: AiAssistantChatOptions): Observable<string>;
46
- /**
47
- * Retrieves a context reference for the current profile. A context reference can be used to add a new context entry
48
- * to the profile, or update/delete an existing entry context.
49
- *
50
- * @param id - The id of the context entry. If no id is passed, an id will be
51
- * generated and the reference will point to a new context entry.
52
- * @returns The context reference.
53
- */
54
- context(id?: string): AiAssistantContextReference;
55
- /**
56
- * Retrieves an instruction reference for the current profile. An instruction reference can be used to add a new
57
- * instruction entry to the profile, or update/delete an existing instruction entry.
58
- *
59
- * @param id - The id of the instruction entry. If no id is passed, an id will be
60
- * generated and the reference will point to a new instruction entry.
61
- * @returns The instruction reference.
62
- */
63
- instruction(id?: string): AiAssistantInstructionReference;
64
- /**
65
- * Adds a new profile to the assistant. This will result in an error if a profile already exists with the same id.
66
- *
67
- * @param data An object containing options for creating the profile.
68
- * @param data.modelName - The name of the OpenAI model (`gpt-3.5, `gpt-4` or `claude-2`).
69
- * @param data.isPublic - Whether the chat functionality of the profile can be accessed without security rules.
70
- * @returns A promise that resolves when the profile is successfully created.
71
- */
72
- insert(data: {
73
- modelName: AiModelName;
74
- isPublic: boolean;
75
- }): Promise<void>;
76
- /**
77
- * Updates an existing assistant profile. This will result in an error if a profile has not yet been created for the
78
- * current profile id.
79
- *
80
- * @param data An object containing options for updating the profile.
81
- * @param data.modelName - The name of the OpenAI model (`gpt-3.5, `gpt-4` or `claude-2`).
82
- * @param data.isPublic - Whether the chat functionality of the profile can be accessed without security rules.
83
- * @returns A promise that resolves when the profile is successfully updated.
84
- */
85
- update(data: {
86
- modelName?: AiModelName;
87
- isPublic?: boolean;
88
- }): Promise<void>;
89
- /**
90
- * Deletes an existing assistant profile. This will result in an error if a profile has not yet been created for the
91
- * current profile id.
92
- *
93
- * @returns A promise that resolves when the profile is successfully deleted.
94
- */
95
- delete(): Promise<void>;
96
- }
97
- declare class AiAssistantContextReference {
98
- private readonly client;
99
- private readonly integrationId;
100
- private readonly profileId;
101
- private readonly id;
102
- constructor(client: AiAssistantClient, integrationId: IntegrationId, profileId: string, id?: string);
103
- /**
104
- * Adds a new context entry to the assistant profile. This will result in an error if an entry already exists with
105
- * the same id.
106
- *
107
- * @param data An object containing options for creating the entry.
108
- * @param data.title - The title of the entry.
109
- * @param data.context - The context data.
110
- * @param file - The file to insert.
111
- * @returns A promise that resolves when the context is successfully created.
112
- */
113
- insert(data: {
114
- title: string;
115
- context: AiAssistantContext;
116
- }, file?: File): Promise<void>;
117
- /**
118
- * Updates an existing context entry on the assistant profile. This will result in an error if an entry has not yet
119
- * been created for the current context id.
120
- *
121
- * @param data An object containing options for updated the entry.
122
- * @param data.title - The title of the entry.
123
- * @param data.context - The context data.
124
- * @returns A promise that resolves when the context is successfully updated.
125
- */
126
- update(data: {
127
- title?: string;
128
- context?: AiAssistantContext;
129
- }): Promise<void>;
130
- /**
131
- * Deletes an existing context entry on the assistant profile. This will result in an error if an entry has not yet
132
- * been created for the current context id.
133
- *
134
- * @returns A promise that resolves when the context is successfully deleted.
135
- */
136
- delete(): Promise<void>;
137
- }
138
- declare class AiAssistantInstructionReference {
139
- private readonly client;
140
- private readonly integrationId;
141
- private readonly profileId;
142
- private readonly id;
143
- constructor(client: AiAssistantClient, integrationId: IntegrationId, profileId: string, id?: string);
144
- /**
145
- * Adds a new instruction entry to the assistant profile. This will result in an error if an entry already exists with
146
- * the same id.
147
- *
148
- * @param data An object containing options for creating the entry.
149
- * @param data.instruction - The instruction data.
150
- * @returns A promise that resolves when the instruction is successfully created.
151
- */
152
- insert(data: {
153
- instruction: string;
154
- }): Promise<void>;
155
- /**
156
- * Updates an existing instruction entry on the assistant profile. This will result in an error if an entry has not
157
- * yet been created for the current instruction id.
158
- *
159
- * @param data An object containing options for updated the entry.
160
- * @param data.instruction - The instruction data.
161
- * @returns A promise that resolves when the instruction is successfully updated.
162
- */
163
- update(data: {
164
- instruction: string;
165
- }): Promise<void>;
166
- /**
167
- * Deletes an existing instruction entry on the assistant profile. This will result in an error if an entry has not
168
- * yet been created for the current instruction id.
169
- *
170
- * @returns A promise that resolves when the instruction is successfully deleted.
171
- */
172
- delete(): Promise<void>;
173
- }
174
- export {};
1
+ import { AiAssistantChatOptions, AiAssistantContext, AiModelName, IntegrationId } 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 ongoingChatSequences;
10
+ constructor(rpcManager: RpcManager, socketManager: SocketManager, integrationId: IntegrationId);
11
+ /**
12
+ * Retrieves a profile reference for the provided id. A profile reference
13
+ * can be used to create and update profiles, add instructions and context
14
+ * and start chats.
15
+ *
16
+ * @param id - The id of the profile.
17
+ * @returns The profile reference.
18
+ */
19
+ profile(id: string): AiAssistantProfileReference;
20
+ /**
21
+ * Sends a prompt to the specified profile id.
22
+ *
23
+ * @param profileId - The profile id.
24
+ * @param prompt - The prompt.
25
+ * @param options - The options to send to the chat model.
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, options?: AiAssistantChatOptions): Observable<string>;
30
+ private handleChatResponse;
31
+ }
32
+ export 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
+ * @param options - The chat options.
42
+ * @returns An observable that emits when a new response token is received. The emitted value is the entire response
43
+ * that has been received so far.
44
+ */
45
+ chat(prompt: string, options?: AiAssistantChatOptions): Observable<string>;
46
+ /**
47
+ * Retrieves a context reference for the current profile. A context reference can be used to add a new context entry
48
+ * to the profile, or update/delete an existing entry context.
49
+ *
50
+ * @param id - The id of the context entry. If no id is passed, an id will be
51
+ * generated and the reference will point to a new context entry.
52
+ * @returns The context reference.
53
+ */
54
+ context(id?: string): AiAssistantContextReference;
55
+ /**
56
+ * Retrieves an instruction reference for the current profile. An instruction reference can be used to add a new
57
+ * instruction entry to the profile, or update/delete an existing instruction entry.
58
+ *
59
+ * @param id - The id of the instruction entry. If no id is passed, an id will be
60
+ * generated and the reference will point to a new instruction entry.
61
+ * @returns The instruction reference.
62
+ */
63
+ instruction(id?: string): AiAssistantInstructionReference;
64
+ /**
65
+ * Adds a new profile to the assistant. This will result in an error if a profile already exists with the same id.
66
+ *
67
+ * @param data An object containing options for creating the profile.
68
+ * @param data.modelName - The name of the OpenAI model (`gpt-3.5, `gpt-4` or `claude-2`).
69
+ * @param data.isPublic - Whether the chat functionality of the profile can be accessed without security rules.
70
+ * @returns A promise that resolves when the profile is successfully created.
71
+ */
72
+ insert(data: {
73
+ modelName: AiModelName;
74
+ isPublic: boolean;
75
+ }): Promise<void>;
76
+ /**
77
+ * Updates an existing assistant profile. This will result in an error if a profile has not yet been created for the
78
+ * current profile id.
79
+ *
80
+ * @param data An object containing options for updating the profile.
81
+ * @param data.modelName - The name of the OpenAI model (`gpt-3.5, `gpt-4` or `claude-2`).
82
+ * @param data.isPublic - Whether the chat functionality of the profile can be accessed without security rules.
83
+ * @returns A promise that resolves when the profile is successfully updated.
84
+ */
85
+ update(data: {
86
+ modelName?: AiModelName;
87
+ isPublic?: boolean;
88
+ }): Promise<void>;
89
+ /**
90
+ * Deletes an existing assistant profile. This will result in an error if a profile has not yet been created for the
91
+ * current profile id.
92
+ *
93
+ * @returns A promise that resolves when the profile is successfully deleted.
94
+ */
95
+ delete(): Promise<void>;
96
+ }
97
+ declare class AiAssistantContextReference {
98
+ private readonly client;
99
+ private readonly integrationId;
100
+ private readonly profileId;
101
+ private readonly id;
102
+ constructor(client: AiAssistantClient, integrationId: IntegrationId, profileId: string, id?: string);
103
+ /**
104
+ * Adds a new context entry to the assistant profile. This will result in an error if an entry already exists with
105
+ * the same id.
106
+ *
107
+ * @param data An object containing options for creating the entry.
108
+ * @param data.title - The title of the entry.
109
+ * @param data.context - The context data.
110
+ * @param file - The file to insert.
111
+ * @returns A promise that resolves when the context is successfully created.
112
+ */
113
+ insert(data: {
114
+ title: string;
115
+ context: AiAssistantContext;
116
+ }, file?: File): Promise<void>;
117
+ /**
118
+ * Updates an existing context entry on the assistant profile. This will result in an error if an entry has not yet
119
+ * been created for the current context id.
120
+ *
121
+ * @param data An object containing options for updated the entry.
122
+ * @param data.title - The title of the entry.
123
+ * @param data.context - The context data.
124
+ * @returns A promise that resolves when the context is successfully updated.
125
+ */
126
+ update(data: {
127
+ title?: string;
128
+ context?: AiAssistantContext;
129
+ }): Promise<void>;
130
+ /**
131
+ * Deletes an existing context entry on the assistant profile. This will result in an error if an entry has not yet
132
+ * been created for the current context id.
133
+ *
134
+ * @returns A promise that resolves when the context is successfully deleted.
135
+ */
136
+ delete(): Promise<void>;
137
+ }
138
+ declare class AiAssistantInstructionReference {
139
+ private readonly client;
140
+ private readonly integrationId;
141
+ private readonly profileId;
142
+ private readonly id;
143
+ constructor(client: AiAssistantClient, integrationId: IntegrationId, profileId: string, id?: string);
144
+ /**
145
+ * Adds a new instruction entry to the assistant profile. This will result in an error if an entry already exists with
146
+ * the same id.
147
+ *
148
+ * @param data An object containing options for creating the entry.
149
+ * @param data.instruction - The instruction data.
150
+ * @returns A promise that resolves when the instruction is successfully created.
151
+ */
152
+ insert(data: {
153
+ instruction: string;
154
+ }): Promise<void>;
155
+ /**
156
+ * Updates an existing instruction entry on the assistant profile. This will result in an error if an entry has not
157
+ * yet been created for the current instruction id.
158
+ *
159
+ * @param data An object containing options for updated the entry.
160
+ * @param data.instruction - The instruction data.
161
+ * @returns A promise that resolves when the instruction is successfully updated.
162
+ */
163
+ update(data: {
164
+ instruction: string;
165
+ }): Promise<void>;
166
+ /**
167
+ * Deletes an existing instruction entry on the assistant profile. This will result in an error if an entry has not
168
+ * yet been created for the current instruction id.
169
+ *
170
+ * @returns A promise that resolves when the instruction is successfully deleted.
171
+ */
172
+ delete(): Promise<void>;
173
+ }
174
+ 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,11 +1,11 @@
1
- import { ApiEndpointId, IntegrationId } from '@squidcloud/common';
2
- import { Observable } from 'rxjs';
3
- import { RpcManager } from './rpc.manager';
4
- import { ClientIdService } from './client-id.service';
5
- export declare class ApiManager {
6
- private readonly clientIdService;
7
- private readonly rpcManager;
8
- private readonly apiServerUrlOverrideMapping;
9
- constructor(clientIdService: ClientIdService, rpcManager: RpcManager, apiServerUrlOverrideMapping?: Record<IntegrationId, string>);
10
- callApiAndSubscribe<T>(integrationId: IntegrationId, endpointId: ApiEndpointId, request: Record<string, any>): Observable<T>;
11
- }
1
+ import { ApiEndpointId, IntegrationId } from '@squidcloud/common';
2
+ import { Observable } from 'rxjs';
3
+ import { RpcManager } from './rpc.manager';
4
+ import { ClientIdService } from './client-id.service';
5
+ export declare class ApiManager {
6
+ private readonly clientIdService;
7
+ private readonly rpcManager;
8
+ private readonly apiServerUrlOverrideMapping;
9
+ constructor(clientIdService: ClientIdService, rpcManager: RpcManager, apiServerUrlOverrideMapping?: Record<IntegrationId, string>);
10
+ callApiAndSubscribe<T>(integrationId: IntegrationId, endpointId: ApiEndpointId, request: Record<string, any>): Observable<T>;
11
+ }
@@ -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,9 +1,9 @@
1
- import { Observable } from 'rxjs';
2
- import { RpcManager } from './rpc.manager';
3
- import { ClientIdService } from './client-id.service';
4
- export declare class BackendFunctionManager {
5
- private readonly clientIdService;
6
- private readonly rpcManager;
7
- constructor(clientIdService: ClientIdService, rpcManager: RpcManager);
8
- executeFunctionAndSubscribe<T>(functionName: string, ...params: any[]): Observable<T>;
9
- }
1
+ import { Observable } from 'rxjs';
2
+ import { RpcManager } from './rpc.manager';
3
+ import { ClientIdService } from './client-id.service';
4
+ export declare class BackendFunctionManager {
5
+ private readonly clientIdService;
6
+ private readonly rpcManager;
7
+ constructor(clientIdService: ClientIdService, rpcManager: RpcManager);
8
+ executeFunctionAndSubscribe<T>(functionName: string, ...params: any[]): Observable<T>;
9
+ }
@@ -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
+ }