@squidcloud/client 1.0.64 → 1.0.66
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/common/src/ai-assistant.context.d.ts +12 -11
- package/dist/common/src/ai-assistant.schemas.d.ts +1 -210
- package/dist/common/src/ai-assistant.types.d.ts +2 -81
- package/dist/common/src/api-call.context.d.ts +13 -12
- package/dist/common/src/api.types.d.ts +4 -24
- package/dist/common/src/application.schemas.d.ts +1 -1060
- package/dist/common/src/application.types.d.ts +184 -224
- package/dist/common/src/auth.types.d.ts +1 -4
- package/dist/common/src/backend-function.schemas.d.ts +1 -3
- package/dist/common/src/backend-function.types.d.ts +1 -7
- package/dist/common/src/backend-run.types.d.ts +2 -53
- package/dist/common/src/bundle-api.types.d.ts +36 -68
- package/dist/common/src/bundle-data.types.d.ts +4 -59
- package/dist/common/src/communication.types.d.ts +22 -4
- package/dist/common/src/context.types.d.ts +32 -32
- package/dist/common/src/distributed-lock.context.d.ts +5 -5
- package/dist/common/src/document.types.d.ts +22 -37
- package/dist/common/src/graphql.context.d.ts +7 -6
- package/dist/common/src/graphql.types.d.ts +9 -11
- package/dist/common/src/http-status.enum.d.ts +50 -50
- package/dist/common/src/index.d.ts +54 -54
- 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 +22 -22
- package/dist/common/src/integrations/database.types.d.ts +236 -236
- package/dist/common/src/integrations/index.d.ts +97 -97
- package/dist/common/src/integrations/observability.types.d.ts +22 -22
- package/dist/common/src/logger.types.d.ts +21 -21
- package/dist/common/src/metrics.types.d.ts +1 -58
- package/dist/common/src/mutation.context.d.ts +12 -10
- package/dist/common/src/mutation.schemas.d.ts +1 -5
- package/dist/common/src/mutation.types.d.ts +53 -72
- package/dist/common/src/named-query.context.d.ts +4 -4
- package/dist/common/src/named-query.schemas.d.ts +1 -3
- package/dist/common/src/named-query.types.d.ts +1 -9
- package/dist/common/src/query/index.d.ts +2 -2
- package/dist/common/src/query/query-context.d.ts +37 -37
- package/dist/common/src/query/simple-query-builder.d.ts +137 -137
- package/dist/common/src/query.schemas.d.ts +1 -5
- package/dist/common/src/query.types.d.ts +51 -118
- package/dist/common/src/regions.d.ts +1 -22
- package/dist/common/src/schema/schema.types.d.ts +54 -54
- package/dist/common/src/secret.schemas.d.ts +1 -6
- package/dist/common/src/secret.types.d.ts +8 -49
- package/dist/common/src/security.types.d.ts +1 -3
- package/dist/common/src/socket.schemas.d.ts +1 -3
- package/dist/common/src/socket.types.d.ts +1 -108
- package/dist/common/src/time-units.d.ts +1 -5
- package/dist/common/src/trigger.types.d.ts +1 -15
- package/dist/common/src/types.d.ts +8 -15
- package/dist/common/src/utils/array.d.ts +1 -8
- package/dist/common/src/utils/assert.d.ts +1 -8
- package/dist/common/src/utils/error.d.ts +4 -4
- 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 +1 -1
- package/dist/common/src/utils/object.d.ts +6 -6
- 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 -7
- package/dist/index.js +2 -2
- package/dist/node_modules/json-schema-typed/draft-2020-12.d.ts +1239 -1239
- package/dist/typescript-client/src/ai-assistant-client.d.ts +66 -66
- package/dist/typescript-client/src/ai-client.factory.d.ts +13 -13
- 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 +24 -24
- package/dist/typescript-client/src/collection-reference.d.ts +81 -81
- package/dist/typescript-client/src/collection-reference.factory.d.ts +16 -16
- package/dist/typescript-client/src/data.manager.d.ts +172 -172
- package/dist/typescript-client/src/destruct.manager.d.ts +12 -12
- package/dist/typescript-client/src/distributed-lock.manager.d.ts +19 -19
- package/dist/typescript-client/src/document-identity.service.d.ts +12 -12
- package/dist/typescript-client/src/document-reference.d.ts +134 -134
- package/dist/typescript-client/src/document-reference.factory.d.ts +9 -9
- package/dist/typescript-client/src/document-store.d.ts +11 -11
- package/dist/typescript-client/src/graphql-client.d.ts +12 -12
- package/dist/typescript-client/src/graphql-client.factory.d.ts +9 -9
- package/dist/typescript-client/src/index.d.ts +8 -8
- package/dist/typescript-client/src/mutation/mutation-sender.d.ts +12 -12
- package/dist/typescript-client/src/named-query.manager.d.ts +14 -14
- package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +72 -72
- package/dist/typescript-client/src/query/query-builder.factory.d.ts +83 -83
- package/dist/typescript-client/src/query/query-subscription.manager.d.ts +64 -64
- package/dist/typescript-client/src/query/query.types.d.ts +14 -14
- package/dist/typescript-client/src/rpc.manager.d.ts +28 -28
- package/dist/typescript-client/src/socket.manager.d.ts +32 -32
- package/dist/typescript-client/src/squid.d.ts +196 -188
- 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,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,12 +1,12 @@
|
|
|
1
|
-
import { IntegrationId, LockManager, MutateResponse, Mutation } from '@squidcloud/common';
|
|
2
|
-
import { QuerySubscriptionManager } from '../query/query-subscription.manager';
|
|
3
|
-
import { RpcManager } from '../rpc.manager';
|
|
4
|
-
import { ClientIdService } from '../client-id.service';
|
|
5
|
-
export declare class MutationSender {
|
|
6
|
-
private readonly clientIdService;
|
|
7
|
-
private readonly rpcManager;
|
|
8
|
-
private readonly lockManager;
|
|
9
|
-
private readonly querySubscriptionManager;
|
|
10
|
-
constructor(clientIdService: ClientIdService, rpcManager: RpcManager, lockManager: LockManager, querySubscriptionManager: QuerySubscriptionManager);
|
|
11
|
-
sendMutations(mutations: Array<Mutation>, integrationId: IntegrationId): Promise<MutateResponse>;
|
|
12
|
-
}
|
|
1
|
+
import { IntegrationId, LockManager, MutateResponse, Mutation } from '@squidcloud/common';
|
|
2
|
+
import { QuerySubscriptionManager } from '../query/query-subscription.manager';
|
|
3
|
+
import { RpcManager } from '../rpc.manager';
|
|
4
|
+
import { ClientIdService } from '../client-id.service';
|
|
5
|
+
export declare class MutationSender {
|
|
6
|
+
private readonly clientIdService;
|
|
7
|
+
private readonly rpcManager;
|
|
8
|
+
private readonly lockManager;
|
|
9
|
+
private readonly querySubscriptionManager;
|
|
10
|
+
constructor(clientIdService: ClientIdService, rpcManager: RpcManager, lockManager: LockManager, querySubscriptionManager: QuerySubscriptionManager);
|
|
11
|
+
sendMutations(mutations: Array<Mutation>, integrationId: IntegrationId): Promise<MutateResponse>;
|
|
12
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { IntegrationId, QueryName } 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 NamedQueryManager {
|
|
7
|
-
private readonly clientIdService;
|
|
8
|
-
private readonly rpcManager;
|
|
9
|
-
private readonly socketManager;
|
|
10
|
-
private readonly ongoingNamedQueryExecutions;
|
|
11
|
-
constructor(clientIdService: ClientIdService, rpcManager: RpcManager, socketManager: SocketManager);
|
|
12
|
-
executeNamedQueryAndSubscribe<T>(integrationId: IntegrationId, queryName: QueryName, params: Record<string, any>): Observable<T>;
|
|
13
|
-
private handleNamedQueryResponse;
|
|
14
|
-
}
|
|
1
|
+
import { IntegrationId, QueryName } 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 NamedQueryManager {
|
|
7
|
+
private readonly clientIdService;
|
|
8
|
+
private readonly rpcManager;
|
|
9
|
+
private readonly socketManager;
|
|
10
|
+
private readonly ongoingNamedQueryExecutions;
|
|
11
|
+
constructor(clientIdService: ClientIdService, rpcManager: RpcManager, socketManager: SocketManager);
|
|
12
|
+
executeNamedQueryAndSubscribe<T>(integrationId: IntegrationId, queryName: QueryName, params: Record<string, any>): Observable<T>;
|
|
13
|
+
private handleNamedQueryResponse;
|
|
14
|
+
}
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import { DocumentData, FieldName, Operator, PrimitiveFieldType } from '@squidcloud/common';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { DocumentReference } from '../document-reference';
|
|
4
|
-
import { Alias } from './query.types';
|
|
5
|
-
/**
|
|
6
|
-
* A query builder that can participate in a join.
|
|
7
|
-
* To learn more about join queries, see
|
|
8
|
-
* {@link https://docs.squid.cloud/docs/client-sdk/queries#joining-data-across-collections-and-integrations}.
|
|
9
|
-
*/
|
|
10
|
-
export declare class JoinQueryBuilder<DocumentType extends DocumentData, MyAlias extends Alias, ReturnType extends Record<MyAlias, DocumentReference<DocumentType> | undefined>> {
|
|
11
|
-
private readonly collectionName;
|
|
12
|
-
private readonly integrationId;
|
|
13
|
-
private readonly querySubscriptionManager;
|
|
14
|
-
private readonly documentReferenceFactory;
|
|
15
|
-
private readonly alias;
|
|
16
|
-
private readonly joinQueryBuilderFactory;
|
|
17
|
-
private readonly queryBuilderFactory;
|
|
18
|
-
private readonly simpleQueryBuilder;
|
|
19
|
-
private readonly joins;
|
|
20
|
-
/** Record that maps the right alias to the left condition */
|
|
21
|
-
private readonly joinConditions;
|
|
22
|
-
/**
|
|
23
|
-
* Adds a condition to the query.
|
|
24
|
-
*
|
|
25
|
-
* @param fieldName The name of the field to query
|
|
26
|
-
* @param operator The operator to use
|
|
27
|
-
* @param value The value to compare against
|
|
28
|
-
* @returns The query builder
|
|
29
|
-
*/
|
|
30
|
-
where(fieldName: (keyof DocumentType & FieldName) | string, operator: Operator | 'in' | 'not in', value: PrimitiveFieldType | Array<PrimitiveFieldType>): this;
|
|
31
|
-
/**
|
|
32
|
-
* Sets a limit to the number of results returned by the query. The maximum limit is 20,000 and the default is 1,000
|
|
33
|
-
* if none is provided.
|
|
34
|
-
*
|
|
35
|
-
* @param limit The maximum number of results to return
|
|
36
|
-
* @returns The query builder
|
|
37
|
-
*/
|
|
38
|
-
limit(limit: number): this;
|
|
39
|
-
/**
|
|
40
|
-
* Adds a sort order to the query. You can add multiple sort orders to the query. The order in which you add them
|
|
41
|
-
* determines the order in which they are applied.
|
|
42
|
-
* @param fieldName The name of the field to sort by
|
|
43
|
-
* @param asc Whether to sort in ascending order. Defaults to true.
|
|
44
|
-
* @returns The query builder
|
|
45
|
-
*/
|
|
46
|
-
sortBy(fieldName: keyof DocumentType & FieldName, asc?: boolean): this;
|
|
47
|
-
/**
|
|
48
|
-
* Joins this query with another join query and return a new query builder that can be used to query the joined
|
|
49
|
-
* documents.
|
|
50
|
-
* @param queryBuilder The query builder to join with
|
|
51
|
-
* @param leftFieldName The name of the field on the left side of the join
|
|
52
|
-
* @param rightFieldName The name of the field on the right side of the join
|
|
53
|
-
* @returns A new query builder that can be used to query the joined documents
|
|
54
|
-
*/
|
|
55
|
-
join<J extends DocumentData, RightAlias extends Alias, RightReturnType extends Record<RightAlias, DocumentReference<J> | undefined>>(queryBuilder: JoinQueryBuilder<J, RightAlias, RightReturnType>, leftFieldName: keyof DocumentType & FieldName, rightFieldName: keyof J & FieldName): JoinQueryBuilder<DocumentType, MyAlias, ReturnType & Partial<RightReturnType>>;
|
|
56
|
-
/**
|
|
57
|
-
* Returns a promise that resolves to the query results.
|
|
58
|
-
*
|
|
59
|
-
* @returns A promise that resolves to the query results
|
|
60
|
-
*/
|
|
61
|
-
snapshot(): Promise<Array<ReturnType>>;
|
|
62
|
-
/**
|
|
63
|
-
* Returns an observable that emits the query results and updates whenever the query results change unless
|
|
64
|
-
* `subscribe=false` is provided.
|
|
65
|
-
*
|
|
66
|
-
* Important: Make sure to unsubscribe from the observable when you are done with it.
|
|
67
|
-
*
|
|
68
|
-
* @param subscribe Whether to subscribe to the query. Defaults to true.
|
|
69
|
-
* @returns An observable for the query results
|
|
70
|
-
*/
|
|
71
|
-
snapshots(subscribe?: boolean): Observable<Array<ReturnType>>;
|
|
72
|
-
}
|
|
1
|
+
import { DocumentData, FieldName, Operator, PrimitiveFieldType } from '@squidcloud/common';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { DocumentReference } from '../document-reference';
|
|
4
|
+
import { Alias } from './query.types';
|
|
5
|
+
/**
|
|
6
|
+
* A query builder that can participate in a join.
|
|
7
|
+
* To learn more about join queries, see
|
|
8
|
+
* {@link https://docs.squid.cloud/docs/client-sdk/queries#joining-data-across-collections-and-integrations}.
|
|
9
|
+
*/
|
|
10
|
+
export declare class JoinQueryBuilder<DocumentType extends DocumentData, MyAlias extends Alias, ReturnType extends Record<MyAlias, DocumentReference<DocumentType> | undefined>> {
|
|
11
|
+
private readonly collectionName;
|
|
12
|
+
private readonly integrationId;
|
|
13
|
+
private readonly querySubscriptionManager;
|
|
14
|
+
private readonly documentReferenceFactory;
|
|
15
|
+
private readonly alias;
|
|
16
|
+
private readonly joinQueryBuilderFactory;
|
|
17
|
+
private readonly queryBuilderFactory;
|
|
18
|
+
private readonly simpleQueryBuilder;
|
|
19
|
+
private readonly joins;
|
|
20
|
+
/** Record that maps the right alias to the left condition */
|
|
21
|
+
private readonly joinConditions;
|
|
22
|
+
/**
|
|
23
|
+
* Adds a condition to the query.
|
|
24
|
+
*
|
|
25
|
+
* @param fieldName The name of the field to query
|
|
26
|
+
* @param operator The operator to use
|
|
27
|
+
* @param value The value to compare against
|
|
28
|
+
* @returns The query builder
|
|
29
|
+
*/
|
|
30
|
+
where(fieldName: (keyof DocumentType & FieldName) | string, operator: Operator | 'in' | 'not in', value: PrimitiveFieldType | Array<PrimitiveFieldType>): this;
|
|
31
|
+
/**
|
|
32
|
+
* Sets a limit to the number of results returned by the query. The maximum limit is 20,000 and the default is 1,000
|
|
33
|
+
* if none is provided.
|
|
34
|
+
*
|
|
35
|
+
* @param limit The maximum number of results to return
|
|
36
|
+
* @returns The query builder
|
|
37
|
+
*/
|
|
38
|
+
limit(limit: number): this;
|
|
39
|
+
/**
|
|
40
|
+
* Adds a sort order to the query. You can add multiple sort orders to the query. The order in which you add them
|
|
41
|
+
* determines the order in which they are applied.
|
|
42
|
+
* @param fieldName The name of the field to sort by
|
|
43
|
+
* @param asc Whether to sort in ascending order. Defaults to true.
|
|
44
|
+
* @returns The query builder
|
|
45
|
+
*/
|
|
46
|
+
sortBy(fieldName: keyof DocumentType & FieldName, asc?: boolean): this;
|
|
47
|
+
/**
|
|
48
|
+
* Joins this query with another join query and return a new query builder that can be used to query the joined
|
|
49
|
+
* documents.
|
|
50
|
+
* @param queryBuilder The query builder to join with
|
|
51
|
+
* @param leftFieldName The name of the field on the left side of the join
|
|
52
|
+
* @param rightFieldName The name of the field on the right side of the join
|
|
53
|
+
* @returns A new query builder that can be used to query the joined documents
|
|
54
|
+
*/
|
|
55
|
+
join<J extends DocumentData, RightAlias extends Alias, RightReturnType extends Record<RightAlias, DocumentReference<J> | undefined>>(queryBuilder: JoinQueryBuilder<J, RightAlias, RightReturnType>, leftFieldName: keyof DocumentType & FieldName, rightFieldName: keyof J & FieldName): JoinQueryBuilder<DocumentType, MyAlias, ReturnType & Partial<RightReturnType>>;
|
|
56
|
+
/**
|
|
57
|
+
* Returns a promise that resolves to the query results.
|
|
58
|
+
*
|
|
59
|
+
* @returns A promise that resolves to the query results
|
|
60
|
+
*/
|
|
61
|
+
snapshot(): Promise<Array<ReturnType>>;
|
|
62
|
+
/**
|
|
63
|
+
* Returns an observable that emits the query results and updates whenever the query results change unless
|
|
64
|
+
* `subscribe=false` is provided.
|
|
65
|
+
*
|
|
66
|
+
* Important: Make sure to unsubscribe from the observable when you are done with it.
|
|
67
|
+
*
|
|
68
|
+
* @param subscribe Whether to subscribe to the query. Defaults to true.
|
|
69
|
+
* @returns An observable for the query results
|
|
70
|
+
*/
|
|
71
|
+
snapshots(subscribe?: boolean): Observable<Array<ReturnType>>;
|
|
72
|
+
}
|