@squidcloud/client 1.0.57 → 1.0.59

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 (89) hide show
  1. package/dist/common/src/api-call.context.d.ts +12 -12
  2. package/dist/common/src/api.types.d.ts +24 -24
  3. package/dist/common/src/application.schemas.d.ts +1029 -883
  4. package/dist/common/src/application.types.d.ts +212 -206
  5. package/dist/common/src/auth.types.d.ts +4 -0
  6. package/dist/common/src/backend-function.schemas.d.ts +3 -3
  7. package/dist/common/src/backend-function.types.d.ts +7 -7
  8. package/dist/common/src/backend-run.types.d.ts +53 -53
  9. package/dist/common/src/bundle-api.types.d.ts +66 -66
  10. package/dist/common/src/bundle-data.types.d.ts +52 -52
  11. package/dist/common/src/communication.types.d.ts +4 -4
  12. package/dist/common/src/context.types.d.ts +32 -31
  13. package/dist/common/src/distributed-lock.context.d.ts +5 -5
  14. package/dist/common/src/document.types.d.ts +37 -35
  15. package/dist/common/src/graphql.context.d.ts +6 -6
  16. package/dist/common/src/graphql.types.d.ts +11 -11
  17. package/dist/common/src/http-status.enum.d.ts +50 -50
  18. package/dist/common/src/index.d.ts +52 -51
  19. package/dist/common/src/integration.types.d.ts +404 -351
  20. package/dist/common/src/logger.types.d.ts +21 -21
  21. package/dist/common/src/metrics.types.d.ts +58 -58
  22. package/dist/common/src/mutation.context.d.ts +10 -10
  23. package/dist/common/src/mutation.schemas.d.ts +5 -5
  24. package/dist/common/src/mutation.types.d.ts +72 -72
  25. package/dist/common/src/named-query.context.d.ts +4 -4
  26. package/dist/common/src/named-query.schemas.d.ts +3 -3
  27. package/dist/common/src/named-query.types.d.ts +9 -9
  28. package/dist/common/src/query/index.d.ts +2 -2
  29. package/dist/common/src/query/query-context.d.ts +37 -37
  30. package/dist/common/src/query/simple-query-builder.d.ts +137 -137
  31. package/dist/common/src/query.schemas.d.ts +5 -5
  32. package/dist/common/src/query.types.d.ts +118 -118
  33. package/dist/common/src/regions.d.ts +22 -22
  34. package/dist/common/src/schema/schema.types.d.ts +54 -54
  35. package/dist/common/src/secret.schemas.d.ts +6 -6
  36. package/dist/common/src/secret.types.d.ts +40 -40
  37. package/dist/common/src/security.types.d.ts +3 -3
  38. package/dist/common/src/socket.schemas.d.ts +3 -3
  39. package/dist/common/src/socket.types.d.ts +100 -100
  40. package/dist/common/src/time-units.d.ts +5 -5
  41. package/dist/common/src/trigger.types.d.ts +15 -15
  42. package/dist/common/src/types.d.ts +15 -15
  43. package/dist/common/src/utils/array.d.ts +8 -8
  44. package/dist/common/src/utils/assert.d.ts +8 -8
  45. package/dist/common/src/utils/error.d.ts +4 -4
  46. package/dist/common/src/utils/http.d.ts +2 -2
  47. package/dist/common/src/utils/id.d.ts +2 -2
  48. package/dist/common/src/utils/lock.manager.d.ts +14 -14
  49. package/dist/common/src/utils/nullish.d.ts +1 -1
  50. package/dist/common/src/utils/object.d.ts +6 -6
  51. package/dist/common/src/utils/serialization.d.ts +6 -6
  52. package/dist/common/src/utils/transforms.d.ts +18 -18
  53. package/dist/common/src/utils/url.d.ts +1 -1
  54. package/dist/common/src/utils/validation.d.ts +30 -30
  55. package/dist/common/src/webhook-response.d.ts +7 -7
  56. package/dist/index.js +6 -6
  57. package/dist/node_modules/json-schema-typed/draft-2020-12.d.ts +1239 -1239
  58. package/dist/typescript-client/src/api.manager.d.ts +14 -14
  59. package/dist/typescript-client/src/auth.manager.d.ts +23 -17
  60. package/dist/typescript-client/src/backend-function.manager.d.ts +13 -13
  61. package/dist/typescript-client/src/collection-reference.d.ts +65 -65
  62. package/dist/typescript-client/src/collection-reference.factory.d.ts +16 -16
  63. package/dist/typescript-client/src/data.manager.d.ts +172 -172
  64. package/dist/typescript-client/src/destruct.manager.d.ts +12 -12
  65. package/dist/typescript-client/src/distributed-lock.manager.d.ts +19 -19
  66. package/dist/typescript-client/src/document-identity.service.d.ts +12 -12
  67. package/dist/typescript-client/src/document-reference.d.ts +134 -134
  68. package/dist/typescript-client/src/document-reference.factory.d.ts +9 -9
  69. package/dist/typescript-client/src/document-store.d.ts +11 -11
  70. package/dist/typescript-client/src/graphql-client.d.ts +12 -12
  71. package/dist/typescript-client/src/graphql-client.factory.d.ts +9 -9
  72. package/dist/typescript-client/src/index.d.ts +8 -8
  73. package/dist/typescript-client/src/mutation/mutation-sender.d.ts +11 -11
  74. package/dist/typescript-client/src/named-query.manager.d.ts +13 -13
  75. package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +72 -72
  76. package/dist/typescript-client/src/query/query-builder.factory.d.ts +83 -83
  77. package/dist/typescript-client/src/query/query-subscription.manager.d.ts +59 -59
  78. package/dist/typescript-client/src/query/query.types.d.ts +14 -14
  79. package/dist/typescript-client/src/rpc.manager.d.ts +27 -27
  80. package/dist/typescript-client/src/socket.manager.d.ts +24 -24
  81. package/dist/typescript-client/src/squid.d.ts +187 -186
  82. package/dist/typescript-client/src/state/action.applier.d.ts +7 -7
  83. package/dist/typescript-client/src/state/actions.d.ts +29 -29
  84. package/dist/typescript-client/src/state/path_trie.d.ts +27 -27
  85. package/dist/typescript-client/src/state/state.service.d.ts +22 -22
  86. package/dist/typescript-client/src/state/state.service.spec.d.ts +1 -1
  87. package/dist/typescript-client/src/testing/setup-tests.d.ts +1 -1
  88. package/dist/typescript-client/src/types.d.ts +2 -2
  89. package/package.json +1 -1
@@ -1,19 +1,19 @@
1
- import { Observable } from 'rxjs';
2
- /** A handler for a distributed lock that can be released. */
3
- export interface DistributedLock {
4
- /**
5
- * Releases the lock.
6
- * @returns A promise that resolves when the lock is released.
7
- */
8
- release(): Promise<void>;
9
- /**
10
- * Whether the lock has been released.
11
- * @returns True if the lock has been released.
12
- */
13
- isReleased(): boolean;
14
- /**
15
- * Observes when the lock is released (It may be released due to a connection issue)
16
- * @returns An observable that emits when the lock is released.
17
- */
18
- observeRelease(): Observable<void>;
19
- }
1
+ import { Observable } from 'rxjs';
2
+ /** A handler for a distributed lock that can be released. */
3
+ export interface DistributedLock {
4
+ /**
5
+ * Releases the lock.
6
+ * @returns A promise that resolves when the lock is released.
7
+ */
8
+ release(): Promise<void>;
9
+ /**
10
+ * Whether the lock has been released.
11
+ * @returns True if the lock has been released.
12
+ */
13
+ isReleased(): boolean;
14
+ /**
15
+ * Observes when the lock is released (It may be released due to a connection issue)
16
+ * @returns An observable that emits when the lock is released.
17
+ */
18
+ observeRelease(): Observable<void>;
19
+ }
@@ -1,12 +1,12 @@
1
- import { IdResolutionMap } from '@squidcloud/common';
2
- import { Observable } from 'rxjs';
3
- import { DestructManager } from './destruct.manager';
4
- import { DocumentStore } from './document-store';
5
- export default class DocumentIdentityService {
6
- private readonly documentStore;
7
- private readonly destructManager;
8
- private readonly changeNotifier;
9
- constructor(documentStore: DocumentStore, destructManager: DestructManager);
10
- migrate(idResolutionMap: IdResolutionMap): void;
11
- observeChanges(): Observable<IdResolutionMap>;
12
- }
1
+ import { IdResolutionMap } from '@squidcloud/common';
2
+ import { Observable } from 'rxjs';
3
+ import { DestructManager } from './destruct.manager';
4
+ import { DocumentStore } from './document-store';
5
+ export default class DocumentIdentityService {
6
+ private readonly documentStore;
7
+ private readonly destructManager;
8
+ private readonly changeNotifier;
9
+ constructor(documentStore: DocumentStore, destructManager: DestructManager);
10
+ migrate(idResolutionMap: IdResolutionMap): void;
11
+ observeChanges(): Observable<IdResolutionMap>;
12
+ }
@@ -1,134 +1,134 @@
1
- import { DocumentData, Paths } from '@squidcloud/common';
2
- import { Observable } from 'rxjs';
3
- import { TransactionId } from './types';
4
- /**
5
- * Holds a reference to a document. A document reference is a reference to a specific record in a collection. You can
6
- * use it to read or write data to the document. A document can refer to a row in a table in a relational database or a
7
- * document in a NoSQL database. Additionally, a document reference can refer to a non-existent document, which you can
8
- * use to create a new document.
9
- *
10
- * Read more about document references in the
11
- * [documentation]{@link https://docs.squid.cloud/docs/client-sdk/document-reference}.
12
- * @typeParam T The type of the document data.
13
- */
14
- export declare class DocumentReference<T extends DocumentData = any> {
15
- private _squidDocId;
16
- private readonly dataManager;
17
- private readonly queryBuilderFactory;
18
- /** A string that uniquely identifies this document reference. */
19
- refId: string;
20
- /**
21
- * Returns the document data. Throws an error if the document does not exist.
22
- *
23
- * @returns The document data.
24
- * @throws Error if the document does not exist.
25
- */
26
- get data(): T;
27
- /**
28
- * Returns whether data has been populated for this document reference. Data
29
- * will not present if a document has not been queried, does not exist, or
30
- * has been deleted.
31
- *
32
- * @returns Whether the document has data.
33
- */
34
- get hasData(): boolean;
35
- /**
36
- * Returns a document reference with the latest data from the server or undefined if the document does not exist on
37
- * the server.
38
- *
39
- * @returns A document reference with the latest data from the server or undefined if the document does not exist on
40
- * the server.
41
- */
42
- snapshot(): Promise<DocumentReference<T> | undefined>;
43
- /**
44
- * Returns an observable that emits a document reference with the latest data from the server or undefined if the
45
- * document is deleted or does not exist on the server.
46
- *
47
- * @returns An observable that emits a document reference with the latest data from the server or undefined if the
48
- * document is deleted or does not exist on the server.
49
- */
50
- snapshots(): Observable<DocumentReference<T> | undefined>;
51
- /**
52
- * Returns whether the locally available version of the document may not be the latest version on the server.
53
- *
54
- * @returns Whether the locally available version of the document may not be the latest version on the server.
55
- */
56
- isDirty(): boolean;
57
- private isTracked;
58
- /**
59
- * Updates the document with the given data.
60
- * The `update` will be reflected optimistically locally and will be applied to the server later.
61
- * If a transactionId is provided, the `update` will be applied to the server as an atomic operation together with
62
- * the rest of the operations in the transaction and the `update` will not reflect locally until the transaction is
63
- * completed locally.
64
- *
65
- * The returned promise will resolve once the `update` has been applied to the server or immediately if the `update`
66
- * is part of a transaction.
67
- *
68
- * @param data The data to update - can be partial.
69
- * @param transactionId The transaction to use for this operation. If not provided, the operation will be applied
70
- * immediately.
71
- */
72
- update(data: Partial<Record<Paths<T>, any>>, transactionId?: TransactionId): Promise<void>;
73
- /**
74
- * Similar to {@link update}, but only updates the given path.
75
- * @param path The path to update.
76
- * @param value The value to set at the given path.
77
- * @param transactionId The transaction to use for this operation. If not provided, the operation will be applied
78
- * immediately.
79
- */
80
- setInPath(path: Paths<T>, value: any, transactionId?: TransactionId): Promise<void>;
81
- /**
82
- * Similar to `update`, but only deletes the given path.
83
- * @param path The path to delete.
84
- * @param transactionId The transaction to use for this operation. If not provided, the operation will be applied
85
- * immediately.
86
- */
87
- deleteInPath(path: Paths<T>, transactionId?: TransactionId): Promise<void>;
88
- /**
89
- * Increments the value at the given path by the given value. The value may be both positive and negative.
90
- * @param path The path to the value to increment.
91
- * @param value The value to increment by.
92
- * @param transactionId The transaction to use for this operation. If not provided, the operation will be applied
93
- * immediately.
94
- */
95
- incrementInPath(path: Paths<T>, value: number, transactionId?: TransactionId): Promise<void>;
96
- /**
97
- * Decrements the value at the given path by the given value. The value may be both positive and negative.
98
- * @param path The path to the value to decrement.
99
- * @param value The value to decrement by.
100
- * @param transactionId The transaction to use for this operation. If not provided, the operation will be applied
101
- * immediately.
102
- */
103
- decrementInPath(path: Paths<T>, value: number, transactionId?: TransactionId): Promise<void>;
104
- /**
105
- * Inserts the document with the given data. If the document already exists, the operation will be treated as
106
- * `upsert`. The `insert` will be reflected optimistically locally and will be applied to the server later. If a
107
- * transactionId is provided, the `insert` will be applied to the server as an atomic operation together with the
108
- * rest
109
- * of the operations in the transaction and the `insert` will not reflect locally until the transaction is completed
110
- * locally.
111
- *
112
- * The returned promise will resolve once the `insert` has been applied to the server or immediately if the `insert`
113
- * is part of a transaction.
114
- *
115
- * @param data The data to insert.
116
- * @param transactionId The transaction to use for this operation. If not provided, the operation will be applied
117
- * immediately.
118
- */
119
- insert(data: T, transactionId?: TransactionId): Promise<void>;
120
- /**
121
- * Deletes the document.
122
- * The `delete` will be reflected optimistically locally and will be applied to the server later.
123
- * If a transactionId is provided, the `delete` will be applied to the server as an atomic operation together with
124
- * the rest of the operations in the transaction and the `delete` will not reflect locally until the transaction is
125
- * completed locally.
126
- *
127
- * The returned promise will resolve once the `delete` has been applied to the server or immediately if the `delete`
128
- * is part of a transaction.
129
- *
130
- * @param transactionId The transaction to use for this operation. If not provided, the operation will be applied
131
- * immediately.
132
- */
133
- delete(transactionId?: TransactionId): Promise<void>;
134
- }
1
+ import { DocumentData, Paths } from '@squidcloud/common';
2
+ import { Observable } from 'rxjs';
3
+ import { TransactionId } from './types';
4
+ /**
5
+ * Holds a reference to a document. A document reference is a reference to a specific record in a collection. You can
6
+ * use it to read or write data to the document. A document can refer to a row in a table in a relational database or a
7
+ * document in a NoSQL database. Additionally, a document reference can refer to a non-existent document, which you can
8
+ * use to create a new document.
9
+ *
10
+ * Read more about document references in the
11
+ * [documentation]{@link https://docs.squid.cloud/docs/client-sdk/document-reference}.
12
+ * @typeParam T The type of the document data.
13
+ */
14
+ export declare class DocumentReference<T extends DocumentData = any> {
15
+ private _squidDocId;
16
+ private readonly dataManager;
17
+ private readonly queryBuilderFactory;
18
+ /** A string that uniquely identifies this document reference. */
19
+ refId: string;
20
+ /**
21
+ * Returns the document data. Throws an error if the document does not exist.
22
+ *
23
+ * @returns The document data.
24
+ * @throws Error if the document does not exist.
25
+ */
26
+ get data(): T;
27
+ /**
28
+ * Returns whether data has been populated for this document reference. Data
29
+ * will not present if a document has not been queried, does not exist, or
30
+ * has been deleted.
31
+ *
32
+ * @returns Whether the document has data.
33
+ */
34
+ get hasData(): boolean;
35
+ /**
36
+ * Returns a document reference with the latest data from the server or undefined if the document does not exist on
37
+ * the server.
38
+ *
39
+ * @returns A document reference with the latest data from the server or undefined if the document does not exist on
40
+ * the server.
41
+ */
42
+ snapshot(): Promise<DocumentReference<T> | undefined>;
43
+ /**
44
+ * Returns an observable that emits a document reference with the latest data from the server or undefined if the
45
+ * document is deleted or does not exist on the server.
46
+ *
47
+ * @returns An observable that emits a document reference with the latest data from the server or undefined if the
48
+ * document is deleted or does not exist on the server.
49
+ */
50
+ snapshots(): Observable<DocumentReference<T> | undefined>;
51
+ /**
52
+ * Returns whether the locally available version of the document may not be the latest version on the server.
53
+ *
54
+ * @returns Whether the locally available version of the document may not be the latest version on the server.
55
+ */
56
+ isDirty(): boolean;
57
+ private isTracked;
58
+ /**
59
+ * Updates the document with the given data.
60
+ * The `update` will be reflected optimistically locally and will be applied to the server later.
61
+ * If a transactionId is provided, the `update` will be applied to the server as an atomic operation together with
62
+ * the rest of the operations in the transaction and the `update` will not reflect locally until the transaction is
63
+ * completed locally.
64
+ *
65
+ * The returned promise will resolve once the `update` has been applied to the server or immediately if the `update`
66
+ * is part of a transaction.
67
+ *
68
+ * @param data The data to update - can be partial.
69
+ * @param transactionId The transaction to use for this operation. If not provided, the operation will be applied
70
+ * immediately.
71
+ */
72
+ update(data: Partial<Record<Paths<T>, any>>, transactionId?: TransactionId): Promise<void>;
73
+ /**
74
+ * Similar to {@link update}, but only updates the given path.
75
+ * @param path The path to update.
76
+ * @param value The value to set at the given path.
77
+ * @param transactionId The transaction to use for this operation. If not provided, the operation will be applied
78
+ * immediately.
79
+ */
80
+ setInPath(path: Paths<T>, value: any, transactionId?: TransactionId): Promise<void>;
81
+ /**
82
+ * Similar to `update`, but only deletes the given path.
83
+ * @param path The path to delete.
84
+ * @param transactionId The transaction to use for this operation. If not provided, the operation will be applied
85
+ * immediately.
86
+ */
87
+ deleteInPath(path: Paths<T>, transactionId?: TransactionId): Promise<void>;
88
+ /**
89
+ * Increments the value at the given path by the given value. The value may be both positive and negative.
90
+ * @param path The path to the value to increment.
91
+ * @param value The value to increment by.
92
+ * @param transactionId The transaction to use for this operation. If not provided, the operation will be applied
93
+ * immediately.
94
+ */
95
+ incrementInPath(path: Paths<T>, value: number, transactionId?: TransactionId): Promise<void>;
96
+ /**
97
+ * Decrements the value at the given path by the given value. The value may be both positive and negative.
98
+ * @param path The path to the value to decrement.
99
+ * @param value The value to decrement by.
100
+ * @param transactionId The transaction to use for this operation. If not provided, the operation will be applied
101
+ * immediately.
102
+ */
103
+ decrementInPath(path: Paths<T>, value: number, transactionId?: TransactionId): Promise<void>;
104
+ /**
105
+ * Inserts the document with the given data. If the document already exists, the operation will be treated as
106
+ * `upsert`. The `insert` will be reflected optimistically locally and will be applied to the server later. If a
107
+ * transactionId is provided, the `insert` will be applied to the server as an atomic operation together with the
108
+ * rest
109
+ * of the operations in the transaction and the `insert` will not reflect locally until the transaction is completed
110
+ * locally.
111
+ *
112
+ * The returned promise will resolve once the `insert` has been applied to the server or immediately if the `insert`
113
+ * is part of a transaction.
114
+ *
115
+ * @param data The data to insert.
116
+ * @param transactionId The transaction to use for this operation. If not provided, the operation will be applied
117
+ * immediately.
118
+ */
119
+ insert(data: T, transactionId?: TransactionId): Promise<void>;
120
+ /**
121
+ * Deletes the document.
122
+ * The `delete` will be reflected optimistically locally and will be applied to the server later.
123
+ * If a transactionId is provided, the `delete` will be applied to the server as an atomic operation together with
124
+ * the rest of the operations in the transaction and the `delete` will not reflect locally until the transaction is
125
+ * completed locally.
126
+ *
127
+ * The returned promise will resolve once the `delete` has been applied to the server or immediately if the `delete`
128
+ * is part of a transaction.
129
+ *
130
+ * @param transactionId The transaction to use for this operation. If not provided, the operation will be applied
131
+ * immediately.
132
+ */
133
+ delete(transactionId?: TransactionId): Promise<void>;
134
+ }
@@ -1,9 +1,9 @@
1
- import { SquidDocId } from '@squidcloud/common';
2
- import { DataManager } from './data.manager';
3
- import { DocumentReference } from './document-reference';
4
- import { QueryBuilderFactory } from './query/query-builder.factory';
5
- export declare class DocumentReferenceFactory {
6
- private dataManager;
7
- create(squidDocId: SquidDocId, queryBuilderFactory: QueryBuilderFactory): DocumentReference;
8
- setDataManager(dataManager: DataManager): void;
9
- }
1
+ import { SquidDocId } from '@squidcloud/common';
2
+ import { DataManager } from './data.manager';
3
+ import { DocumentReference } from './document-reference';
4
+ import { QueryBuilderFactory } from './query/query-builder.factory';
5
+ export declare class DocumentReferenceFactory {
6
+ private dataManager;
7
+ create(squidDocId: SquidDocId, queryBuilderFactory: QueryBuilderFactory): DocumentReference;
8
+ setDataManager(dataManager: DataManager): void;
9
+ }
@@ -1,11 +1,11 @@
1
- import { Query, SquidDocId, SquidDocument } from '@squidcloud/common';
2
- export declare class DocumentStore {
3
- private readonly squidDocIdToDoc;
4
- saveDocument(squidDocId: SquidDocId, properties: SquidDocument | undefined): SquidDocument | undefined;
5
- hasData(squidDocId: SquidDocId): boolean;
6
- getDocument(squidDocId: SquidDocId): SquidDocument;
7
- getDocumentOrUndefined(squidDocId: SquidDocId): SquidDocument | undefined;
8
- sortAndLimitDocs(docIdSet: Set<SquidDocId> | undefined, query: Query): Array<SquidDocument>;
9
- private removeInternalProperties;
10
- migrateDocId(squidDocId: SquidDocId, newSquidDocId: SquidDocId): void;
11
- }
1
+ import { Query, SquidDocId, SquidDocument } from '@squidcloud/common';
2
+ export declare class DocumentStore {
3
+ private readonly squidDocIdToDoc;
4
+ saveDocument(squidDocId: SquidDocId, properties: SquidDocument | undefined): SquidDocument | undefined;
5
+ hasData(squidDocId: SquidDocId): boolean;
6
+ getDocument(squidDocId: SquidDocId): SquidDocument;
7
+ getDocumentOrUndefined(squidDocId: SquidDocId): SquidDocument | undefined;
8
+ sortAndLimitDocs(docIdSet: Set<SquidDocId> | undefined, query: Query): Array<SquidDocument>;
9
+ private removeInternalProperties;
10
+ migrateDocId(squidDocId: SquidDocId, newSquidDocId: SquidDocId): void;
11
+ }
@@ -1,12 +1,12 @@
1
- import { GraphQLRequest, IntegrationId } from '@squidcloud/common';
2
- import { RpcManager } from './rpc.manager';
3
- /** A GraphQL client that can be used to query and mutate data. */
4
- export declare class GraphQLClient {
5
- private readonly rpcManager;
6
- private readonly client;
7
- constructor(rpcManager: RpcManager, integrationId: IntegrationId);
8
- /** Executes a GraphQL query and returns a promise with the result. */
9
- query<T = any>(request: GraphQLRequest): Promise<T>;
10
- /** Executes a GraphQL mutation and returns a promise with the result. */
11
- mutate<T = Record<string, any>>(request: GraphQLRequest): Promise<T | null | undefined>;
12
- }
1
+ import { GraphQLRequest, IntegrationId } from '@squidcloud/common';
2
+ import { RpcManager } from './rpc.manager';
3
+ /** A GraphQL client that can be used to query and mutate data. */
4
+ export declare class GraphQLClient {
5
+ private readonly rpcManager;
6
+ private readonly client;
7
+ constructor(rpcManager: RpcManager, integrationId: IntegrationId);
8
+ /** Executes a GraphQL query and returns a promise with the result. */
9
+ query<T = any>(request: GraphQLRequest): Promise<T>;
10
+ /** Executes a GraphQL mutation and returns a promise with the result. */
11
+ mutate<T = Record<string, any>>(request: GraphQLRequest): Promise<T | null | undefined>;
12
+ }
@@ -1,9 +1,9 @@
1
- import { IntegrationId } from '@squidcloud/common';
2
- import { GraphQLClient } from './graphql-client';
3
- import { RpcManager } from './rpc.manager';
4
- export declare class GraphQLClientFactory {
5
- private readonly rpcManager;
6
- private readonly clientsMap;
7
- constructor(rpcManager: RpcManager);
8
- get(integrationId: IntegrationId): GraphQLClient;
9
- }
1
+ import { IntegrationId } from '@squidcloud/common';
2
+ import { GraphQLClient } from './graphql-client';
3
+ import { RpcManager } from './rpc.manager';
4
+ export declare class GraphQLClientFactory {
5
+ private readonly rpcManager;
6
+ private readonly clientsMap;
7
+ constructor(rpcManager: RpcManager);
8
+ get(integrationId: IntegrationId): GraphQLClient;
9
+ }
@@ -1,8 +1,8 @@
1
- export { CollectionReference } from './collection-reference';
2
- export { DocumentReference } from './document-reference';
3
- export { JoinQueryBuilder } from './query/join-query-builder.factory';
4
- export { Changes, QueryBuilder } from './query/query-builder.factory';
5
- export { Alias, JoinCondition } from './query/query.types';
6
- export { Squid, SquidOptions } from './squid';
7
- export { TransactionId } from './types';
8
- export { GraphQLClient } from './graphql-client';
1
+ export { CollectionReference } from './collection-reference';
2
+ export { DocumentReference } from './document-reference';
3
+ export { JoinQueryBuilder } from './query/join-query-builder.factory';
4
+ export { Changes, QueryBuilder } from './query/query-builder.factory';
5
+ export { Alias, JoinCondition } from './query/query.types';
6
+ export { Squid, SquidOptions } from './squid';
7
+ export { TransactionId } from './types';
8
+ export { GraphQLClient } from './graphql-client';
@@ -1,11 +1,11 @@
1
- import { ClientId, IntegrationId, LockManager, MutateResponse, Mutation } from '@squidcloud/common';
2
- import { QuerySubscriptionManager } from '../query/query-subscription.manager';
3
- import { RpcManager } from '../rpc.manager';
4
- export declare class MutationSender {
5
- private readonly clientId;
6
- private readonly rpcManager;
7
- private readonly lockManager;
8
- private readonly querySubscriptionManager;
9
- constructor(clientId: ClientId, rpcManager: RpcManager, lockManager: LockManager, querySubscriptionManager: QuerySubscriptionManager);
10
- sendMutations(mutations: Array<Mutation>, integrationId: IntegrationId): Promise<MutateResponse>;
11
- }
1
+ import { ClientId, IntegrationId, LockManager, MutateResponse, Mutation } from '@squidcloud/common';
2
+ import { QuerySubscriptionManager } from '../query/query-subscription.manager';
3
+ import { RpcManager } from '../rpc.manager';
4
+ export declare class MutationSender {
5
+ private readonly clientId;
6
+ private readonly rpcManager;
7
+ private readonly lockManager;
8
+ private readonly querySubscriptionManager;
9
+ constructor(clientId: ClientId, rpcManager: RpcManager, lockManager: LockManager, querySubscriptionManager: QuerySubscriptionManager);
10
+ sendMutations(mutations: Array<Mutation>, integrationId: IntegrationId): Promise<MutateResponse>;
11
+ }
@@ -1,13 +1,13 @@
1
- import { ClientId, IntegrationId, QueryName } from '@squidcloud/common';
2
- import { Observable } from 'rxjs';
3
- import { RpcManager } from './rpc.manager';
4
- import { SocketManager } from './socket.manager';
5
- export declare class NamedQueryManager {
6
- private readonly clientId;
7
- private readonly rpcManager;
8
- private readonly socketManager;
9
- private readonly ongoingNamedQueryExecutions;
10
- constructor(clientId: ClientId, rpcManager: RpcManager, socketManager: SocketManager);
11
- executeNamedQueryAndSubscribe<T>(integrationId: IntegrationId, queryName: QueryName, params: Record<string, any>): Observable<T>;
12
- private handleNamedQueryResponse;
13
- }
1
+ import { ClientId, IntegrationId, QueryName } from '@squidcloud/common';
2
+ import { Observable } from 'rxjs';
3
+ import { RpcManager } from './rpc.manager';
4
+ import { SocketManager } from './socket.manager';
5
+ export declare class NamedQueryManager {
6
+ private readonly clientId;
7
+ private readonly rpcManager;
8
+ private readonly socketManager;
9
+ private readonly ongoingNamedQueryExecutions;
10
+ constructor(clientId: ClientId, rpcManager: RpcManager, socketManager: SocketManager);
11
+ executeNamedQueryAndSubscribe<T>(integrationId: IntegrationId, queryName: QueryName, params: Record<string, any>): Observable<T>;
12
+ private handleNamedQueryResponse;
13
+ }