@squidcloud/client 1.0.142 → 1.0.144-beta

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 (116) hide show
  1. package/dist/cjs/index.js +15649 -15749
  2. package/dist/common/src/ai-assistant.types.d.ts +25 -23
  3. package/dist/common/src/ai-chatbot.context.d.ts +12 -0
  4. package/dist/common/src/{ai-assistant.schemas.d.ts → ai-chatbot.schemas.d.ts} +1 -1
  5. package/dist/common/src/ai-chatbot.types.d.ts +25 -0
  6. package/dist/common/src/api-call.context.d.ts +13 -13
  7. package/dist/common/src/api.types.d.ts +4 -4
  8. package/dist/common/src/application.schemas.d.ts +66 -66
  9. package/dist/common/src/application.types.d.ts +143 -143
  10. package/dist/common/src/backend-function.schemas.d.ts +1 -1
  11. package/dist/common/src/backend-function.types.d.ts +1 -1
  12. package/dist/common/src/backend-run.types.d.ts +2 -2
  13. package/dist/common/src/bundle-api.types.d.ts +43 -42
  14. package/dist/common/src/bundle-data.types.d.ts +5 -4
  15. package/dist/common/src/communication.types.d.ts +8 -8
  16. package/dist/common/src/context.types.d.ts +40 -40
  17. package/dist/common/src/distributed-lock.context.d.ts +4 -4
  18. package/dist/common/src/document.types.d.ts +22 -22
  19. package/dist/common/src/graphql.context.d.ts +7 -7
  20. package/dist/common/src/graphql.types.d.ts +9 -9
  21. package/dist/common/src/heartbeat.types.d.ts +1 -1
  22. package/dist/common/src/http-status.enum.d.ts +50 -50
  23. package/dist/common/src/index.d.ts +57 -56
  24. package/dist/common/src/integrations/ai_chatbot.types.d.ts +31 -0
  25. package/dist/common/src/integrations/api.types.d.ts +80 -80
  26. package/dist/common/src/integrations/auth.types.d.ts +47 -47
  27. package/dist/common/src/integrations/database.types.d.ts +274 -274
  28. package/dist/common/src/integrations/index.d.ts +134 -134
  29. package/dist/common/src/integrations/observability.types.d.ts +23 -23
  30. package/dist/common/src/logger.types.d.ts +21 -21
  31. package/dist/common/src/metrics.types.d.ts +1 -1
  32. package/dist/common/src/mutation.context.d.ts +14 -14
  33. package/dist/common/src/mutation.schemas.d.ts +1 -1
  34. package/dist/common/src/mutation.types.d.ts +53 -53
  35. package/dist/common/src/named-query.context.d.ts +4 -4
  36. package/dist/common/src/named-query.schemas.d.ts +1 -1
  37. package/dist/common/src/named-query.types.d.ts +1 -1
  38. package/dist/common/src/native-query.context.d.ts +7 -7
  39. package/dist/common/src/native-query.types.d.ts +16 -16
  40. package/dist/common/src/query/base-query-builder.d.ts +147 -147
  41. package/dist/common/src/query/index.d.ts +4 -4
  42. package/dist/common/src/query/pagination.d.ts +62 -62
  43. package/dist/common/src/query/query-context.d.ts +137 -137
  44. package/dist/common/src/query/serialized-query.types.d.ts +24 -24
  45. package/dist/common/src/query.types.d.ts +64 -64
  46. package/dist/common/src/regions.d.ts +1 -1
  47. package/dist/common/src/schema/schema.types.d.ts +54 -54
  48. package/dist/common/src/secret.schemas.d.ts +1 -1
  49. package/dist/common/src/secret.types.d.ts +22 -22
  50. package/dist/common/src/security.types.d.ts +1 -1
  51. package/dist/common/src/socket.schemas.d.ts +1 -1
  52. package/dist/common/src/socket.types.d.ts +5 -5
  53. package/dist/common/src/time-units.d.ts +1 -1
  54. package/dist/common/src/trigger.types.d.ts +1 -1
  55. package/dist/common/src/types.d.ts +14 -14
  56. package/dist/common/src/utils/array.d.ts +1 -1
  57. package/dist/common/src/utils/assert.d.ts +1 -1
  58. package/dist/common/src/utils/error.d.ts +4 -4
  59. package/dist/common/src/utils/global.utils.d.ts +1 -1
  60. package/dist/common/src/utils/http.d.ts +2 -2
  61. package/dist/common/src/utils/id.d.ts +2 -2
  62. package/dist/common/src/utils/lock.manager.d.ts +14 -14
  63. package/dist/common/src/utils/object.d.ts +5 -5
  64. package/dist/common/src/utils/serialization.d.ts +6 -6
  65. package/dist/common/src/utils/transforms.d.ts +18 -18
  66. package/dist/common/src/utils/url.d.ts +1 -1
  67. package/dist/common/src/utils/validation.d.ts +25 -25
  68. package/dist/common/src/webhook-response.d.ts +1 -1
  69. package/dist/common/src/websocket.impl.d.ts +21 -21
  70. package/dist/node_modules/json-schema-typed/draft-2020-12.d.ts +1239 -1239
  71. package/dist/typescript-client/src/ai-assistant-client.d.ts +11 -174
  72. package/dist/typescript-client/src/ai-chatbot-client.d.ts +174 -0
  73. package/dist/typescript-client/src/{ai-client.factory.d.ts → ai-chatbot-client.factory.d.ts} +11 -11
  74. package/dist/typescript-client/src/ai.types.d.ts +47 -10
  75. package/dist/typescript-client/src/api.manager.d.ts +11 -11
  76. package/dist/typescript-client/src/auth.manager.d.ts +33 -33
  77. package/dist/typescript-client/src/backend-function.manager.d.ts +9 -9
  78. package/dist/typescript-client/src/client-id.service.d.ts +27 -27
  79. package/dist/typescript-client/src/collection-reference.d.ts +80 -80
  80. package/dist/typescript-client/src/collection-reference.factory.d.ts +13 -13
  81. package/dist/typescript-client/src/connection-details.d.ts +23 -23
  82. package/dist/typescript-client/src/data.manager.d.ts +173 -173
  83. package/dist/typescript-client/src/destruct.manager.d.ts +12 -12
  84. package/dist/typescript-client/src/distributed-lock.manager.d.ts +16 -16
  85. package/dist/typescript-client/src/document-identity.service.d.ts +12 -12
  86. package/dist/typescript-client/src/document-reference.d.ts +140 -140
  87. package/dist/typescript-client/src/document-reference.factory.d.ts +13 -13
  88. package/dist/typescript-client/src/document-store.d.ts +14 -14
  89. package/dist/typescript-client/src/graphql-client.d.ts +14 -14
  90. package/dist/typescript-client/src/graphql-client.factory.d.ts +11 -11
  91. package/dist/typescript-client/src/index.d.ts +9 -9
  92. package/dist/typescript-client/src/mutation/mutation-sender.d.ts +10 -10
  93. package/dist/typescript-client/src/named-query.manager.d.ts +11 -11
  94. package/dist/typescript-client/src/native-query-manager.d.ts +7 -7
  95. package/dist/typescript-client/src/query/deserializer.d.ts +3 -3
  96. package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +161 -161
  97. package/dist/typescript-client/src/query/local-query-manager.d.ts +9 -9
  98. package/dist/typescript-client/src/query/query-builder.factory.d.ts +77 -77
  99. package/dist/typescript-client/src/query/query-sender.d.ts +33 -33
  100. package/dist/typescript-client/src/query/query-subscription.manager.d.ts +130 -130
  101. package/dist/typescript-client/src/query/query.types.d.ts +49 -49
  102. package/dist/typescript-client/src/rate-limiter.d.ts +32 -32
  103. package/dist/typescript-client/src/rpc.manager.d.ts +29 -29
  104. package/dist/typescript-client/src/secret.client.d.ts +22 -22
  105. package/dist/typescript-client/src/socket.manager.d.ts +43 -43
  106. package/dist/typescript-client/src/squid.d.ts +283 -319
  107. package/dist/typescript-client/src/state/action.applier.d.ts +7 -7
  108. package/dist/typescript-client/src/state/actions.d.ts +29 -29
  109. package/dist/typescript-client/src/state/path_trie.d.ts +27 -27
  110. package/dist/typescript-client/src/state/state.service.d.ts +22 -22
  111. package/dist/typescript-client/src/state/state.service.spec.d.ts +1 -1
  112. package/dist/typescript-client/src/testing/setup-tests.d.ts +1 -1
  113. package/dist/typescript-client/src/types.d.ts +2 -2
  114. package/package.json +2 -2
  115. package/dist/common/src/ai-assistant.context.d.ts +0 -12
  116. package/dist/common/src/integrations/ai_assistant.types.d.ts +0 -31
@@ -1,29 +1,29 @@
1
- import { StateLeafNode } from './action.applier';
2
- export declare enum ActionType {
3
- DELETE_PATH = "DELETE_PATH",
4
- SET_PATH = "SET_PATH",
5
- BATCH_ACTION = "BATCH_ACTION"
6
- }
7
- export declare interface BaseAction {
8
- type: ActionType;
9
- }
10
- export declare interface PathAction extends BaseAction {
11
- path: string[];
12
- }
13
- export type DeletePathAction = PathAction;
14
- export declare interface SetPathAction extends PathAction {
15
- payload?: StateLeafNode;
16
- }
17
- export declare interface BatchAction extends BaseAction {
18
- payload: BaseAction[];
19
- }
20
- export declare interface StateMessage {
21
- type: 'ACTIONS';
22
- payload: BaseAction[];
23
- }
24
- export declare function isPathAction(action: BaseAction): action is PathAction;
25
- export declare function isSetPathAction(action: BaseAction): action is SetPathAction;
26
- export declare function isDeletePathAction(action: BaseAction): action is DeletePathAction;
27
- export declare function isBatchAction(action: BaseAction): action is BatchAction;
28
- export declare function extractAllPathActions(action: BaseAction): PathAction[];
29
- export declare function getSingleAction(actions: BaseAction[]): BaseAction;
1
+ import { StateLeafNode } from './action.applier';
2
+ export declare enum ActionType {
3
+ DELETE_PATH = "DELETE_PATH",
4
+ SET_PATH = "SET_PATH",
5
+ BATCH_ACTION = "BATCH_ACTION"
6
+ }
7
+ export declare interface BaseAction {
8
+ type: ActionType;
9
+ }
10
+ export declare interface PathAction extends BaseAction {
11
+ path: string[];
12
+ }
13
+ export type DeletePathAction = PathAction;
14
+ export declare interface SetPathAction extends PathAction {
15
+ payload?: StateLeafNode;
16
+ }
17
+ export declare interface BatchAction extends BaseAction {
18
+ payload: BaseAction[];
19
+ }
20
+ export declare interface StateMessage {
21
+ type: 'ACTIONS';
22
+ payload: BaseAction[];
23
+ }
24
+ export declare function isPathAction(action: BaseAction): action is PathAction;
25
+ export declare function isSetPathAction(action: BaseAction): action is SetPathAction;
26
+ export declare function isDeletePathAction(action: BaseAction): action is DeletePathAction;
27
+ export declare function isBatchAction(action: BaseAction): action is BatchAction;
28
+ export declare function extractAllPathActions(action: BaseAction): PathAction[];
29
+ export declare function getSingleAction(actions: BaseAction[]): BaseAction;
@@ -1,27 +1,27 @@
1
- import { BaseAction } from './actions';
2
- export declare class PathTrie<T> {
3
- private root;
4
- getOrCreatePathTrieNode(path: string[], nodeData?: T): PathTrieNode<T>;
5
- getPathTrieNode(path: string[]): PathTrieNode<T> | undefined;
6
- getPathTrie(path: string[]): PathTrie<T> | undefined;
7
- /**
8
- * If the callback returns false, it will not iterate into the children of the current node.
9
- */
10
- iterateBfs(callback: (data: T, path: string[]) => void | boolean): void;
11
- removeNode(path: string[]): void;
12
- clearNodeData(path: string[]): void;
13
- getNodeList(path: string[]): Array<PathTrieNode<T>>;
14
- private iterateInternal;
15
- }
16
- export declare class PathTrieNode<T> {
17
- children: Map<string, PathTrieNode<T>>;
18
- nodeData: T | undefined;
19
- }
20
- /**
21
- * Returns a trie which contains all the paths affected by the action. For
22
- * example, if the action contains a path action applied on path [A, B, C], then
23
- * [A], [A, B], [A, B, C] will be in the returned trie. Moreover, if
24
- * subscriptionTree is provided and contains [A, B, C, ...], then [A, B, C, ...]
25
- * will also be included in the returned trie.
26
- */
27
- export declare function getPathTrieFromAction(action: BaseAction, subscriptionTree?: PathTrie<{}>): PathTrie<boolean>;
1
+ import { BaseAction } from './actions';
2
+ export declare class PathTrie<T> {
3
+ private root;
4
+ getOrCreatePathTrieNode(path: string[], nodeData?: T): PathTrieNode<T>;
5
+ getPathTrieNode(path: string[]): PathTrieNode<T> | undefined;
6
+ getPathTrie(path: string[]): PathTrie<T> | undefined;
7
+ /**
8
+ * If the callback returns false, it will not iterate into the children of the current node.
9
+ */
10
+ iterateBfs(callback: (data: T, path: string[]) => void | boolean): void;
11
+ removeNode(path: string[]): void;
12
+ clearNodeData(path: string[]): void;
13
+ getNodeList(path: string[]): Array<PathTrieNode<T>>;
14
+ private iterateInternal;
15
+ }
16
+ export declare class PathTrieNode<T> {
17
+ children: Map<string, PathTrieNode<T>>;
18
+ nodeData: T | undefined;
19
+ }
20
+ /**
21
+ * Returns a trie which contains all the paths affected by the action. For
22
+ * example, if the action contains a path action applied on path [A, B, C], then
23
+ * [A], [A, B], [A, B, C] will be in the returned trie. Moreover, if
24
+ * subscriptionTree is provided and contains [A, B, C, ...], then [A, B, C, ...]
25
+ * will also be included in the returned trie.
26
+ */
27
+ export declare function getPathTrieFromAction(action: BaseAction, subscriptionTree?: PathTrie<{}>): PathTrie<boolean>;
@@ -1,22 +1,22 @@
1
- import { Observable } from 'rxjs';
2
- import { State, StateLeafNode } from './action.applier';
3
- import { BaseAction } from './actions';
4
- export declare class StateService {
5
- private readonly subscriptionsTree;
6
- private state;
7
- private batchCount;
8
- private readonly batchedActions;
9
- dispatch(action: BaseAction): void;
10
- runInBatch(fn: () => unknown): void;
11
- observePath<T>(path: string[], pathsToExcludeFn?: () => Array<string[]>): Observable<T>;
12
- setKeyInPath<T extends State>(path: string[], key: keyof T & string, value: T[keyof T] & StateLeafNode, noopIfSame?: boolean): void;
13
- setPartial<T extends State>(path: string[], partialState: Partial<T>, noopIfSame?: boolean): void;
14
- setInPath(path: string[], payload: StateLeafNode, noopIfSame?: boolean): void;
15
- pushToArray(path: string[], payload: StateLeafNode): void;
16
- deletePath(path: string[]): void;
17
- getState(): State;
18
- getStateInPath<T extends StateLeafNode>(path: string[]): T;
19
- destroy(): void;
20
- private getOrCreateSubjectForPath;
21
- private dispatchSubscriptions;
22
- }
1
+ import { Observable } from 'rxjs';
2
+ import { State, StateLeafNode } from './action.applier';
3
+ import { BaseAction } from './actions';
4
+ export declare class StateService {
5
+ private readonly subscriptionsTree;
6
+ private state;
7
+ private batchCount;
8
+ private readonly batchedActions;
9
+ dispatch(action: BaseAction): void;
10
+ runInBatch(fn: () => unknown): void;
11
+ observePath<T>(path: string[], pathsToExcludeFn?: () => Array<string[]>): Observable<T>;
12
+ setKeyInPath<T extends State>(path: string[], key: keyof T & string, value: T[keyof T] & StateLeafNode, noopIfSame?: boolean): void;
13
+ setPartial<T extends State>(path: string[], partialState: Partial<T>, noopIfSame?: boolean): void;
14
+ setInPath(path: string[], payload: StateLeafNode, noopIfSame?: boolean): void;
15
+ pushToArray(path: string[], payload: StateLeafNode): void;
16
+ deletePath(path: string[]): void;
17
+ getState(): State;
18
+ getStateInPath<T extends StateLeafNode>(path: string[]): T;
19
+ destroy(): void;
20
+ private getOrCreateSubjectForPath;
21
+ private dispatchSubscriptions;
22
+ }
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1 +1 @@
1
- declare const nodeCrypto: any;
1
+ declare const nodeCrypto: any;
@@ -1,2 +1,2 @@
1
- /** A transactionId - alias for string */
2
- export type TransactionId = string;
1
+ /** A transactionId - alias for string */
2
+ export type TransactionId = string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/client",
3
- "version": "1.0.142",
3
+ "version": "1.0.144-beta",
4
4
  "description": "A typescript implementation of the Squid client",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/typescript-client/src/index.d.ts",
@@ -32,7 +32,7 @@
32
32
  "license": "ISC",
33
33
  "dependencies": {
34
34
  "@apollo/client": "^3.7.4",
35
- "@squidcloud/common": "1.0.142",
35
+ "@squidcloud/common": "1.0.144-beta",
36
36
  "@supercharge/promise-pool": "^2.3.2",
37
37
  "cross-fetch": "^3.1.5",
38
38
  "lodash": "^4.17.21",
@@ -1,12 +0,0 @@
1
- import { AiAssistantMutationType, AiAssistantResourceType } from './ai-assistant.types';
2
- export declare class AiAssistantChatContext {
3
- readonly prompt: string;
4
- readonly profileId: string;
5
- }
6
- /** A context provided to the security rules of an AI Assistant mutation. */
7
- export declare class AiAssistantMutationContext {
8
- readonly type: AiAssistantMutationType;
9
- readonly resource: AiAssistantResourceType;
10
- readonly profileId: string;
11
- readonly payload: any;
12
- }
@@ -1,31 +0,0 @@
1
- import { AiModelName } from '../ai-assistant.types';
2
- import { IntegrationId } from '../communication.types';
3
- import { BaseIntegrationConfig, IntegrationType } from './index';
4
- export interface AiAssistantIntegrationConfig extends BaseIntegrationConfig {
5
- type: IntegrationType.ai_assistant;
6
- configuration: AiAssistantConfiguration;
7
- }
8
- export type AiAssistantConfiguration = {
9
- apiKey?: string;
10
- };
11
- export type AiAssistantProfileMetadata = {
12
- modelName: AiModelName;
13
- isPublic: boolean;
14
- strictContext: boolean;
15
- instructions: Record<string, string>;
16
- };
17
- export type AiAssistantContextMetadata = {
18
- title: string;
19
- text: string;
20
- preview: boolean;
21
- sizeBytes?: number;
22
- };
23
- export interface AiAssistantProfile extends AiAssistantProfileMetadata {
24
- contexts: Record<string, AiAssistantContextMetadata>;
25
- }
26
- export interface AiAssistantProfiles {
27
- profiles: Record<string, AiAssistantProfile>;
28
- }
29
- export interface GetAiAssistantProfilesRequest {
30
- integrationId: IntegrationId;
31
- }