@squidcloud/client 1.0.4 → 1.0.6
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/index.d.ts +2 -1
- package/dist/common/src/mutation.types.d.ts +6 -2
- package/dist/common/src/schema/schema.types.d.ts +10 -0
- package/dist/common/src/utils/isDefined.d.ts +1 -0
- package/dist/common/src/utils/object.d.ts +2 -0
- package/dist/index.js +4 -4
- package/dist/index.js.LICENSE.txt +9 -0
- package/dist/package.json +7 -2
- package/dist/typescript-client/src/collection-reference.d.ts +3 -2
- package/dist/typescript-client/src/collection-reference.factory.d.ts +4 -1
- package/dist/typescript-client/src/data.manager.d.ts +9 -2
- package/dist/typescript-client/src/db.dao.d.ts +1 -0
- package/dist/typescript-client/src/document-identity.service.d.ts +12 -0
- package/dist/typescript-client/src/document-reference.d.ts +5 -3
- package/dist/typescript-client/src/mutation/mutation-sender.d.ts +3 -3
- package/dist/typescript-client/src/query/query-builder.factory.d.ts +5 -2
- package/dist/typescript-client/src/query/query-subscription.manager.d.ts +4 -1
- package/dist/typescript-client/src/squid.d.ts +2 -1
- package/dist/typescript-client/src/testing/squid-env-setup.d.ts +2 -0
- package/package.json +13 -3
|
@@ -32,9 +32,10 @@ export * from './trigger.types';
|
|
|
32
32
|
export * from './types';
|
|
33
33
|
export * from './utils/array';
|
|
34
34
|
export * from './utils/assert';
|
|
35
|
+
export * from './utils/error';
|
|
36
|
+
export * from './utils/isDefined';
|
|
35
37
|
export * from './utils/lock.manager';
|
|
36
38
|
export * from './utils/object';
|
|
37
39
|
export * from './utils/serialization';
|
|
38
40
|
export * from './utils/validation';
|
|
39
|
-
export * from './utils/error';
|
|
40
41
|
export * from './utils/url';
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { ClientId, IntegrationId } from './communication.types';
|
|
2
|
-
import { DocTimestamp, DocType, FieldName, FullDocId } from './document.types';
|
|
2
|
+
import { DocTimestamp, DocType, FieldName, FullDocId, FullDocIdStr } from './document.types';
|
|
3
3
|
export interface MutateRequest<T = any> {
|
|
4
4
|
clientId: ClientId;
|
|
5
5
|
integrationId: IntegrationId;
|
|
6
6
|
mutations: Array<Mutation<T>>;
|
|
7
7
|
}
|
|
8
|
-
export interface
|
|
8
|
+
export interface ExecuteMutationsResponse {
|
|
9
9
|
timestamp: DocTimestamp;
|
|
10
|
+
idResolutionMap?: IdResolutionMap;
|
|
11
|
+
afterDocs: Record<FullDocIdStr, DocType>;
|
|
10
12
|
}
|
|
13
|
+
export type MutateResponse = Omit<ExecuteMutationsResponse, 'afterDocs'>;
|
|
14
|
+
export type IdResolutionMap = Record<FullDocIdStr, FullDocIdStr>;
|
|
11
15
|
export type Mutation<T = any> = UpdateMutation<T> | InsertMutation<T> | DeleteMutation;
|
|
12
16
|
export type MutationType = 'insert' | 'update' | 'delete';
|
|
13
17
|
interface BaseMutation {
|
|
@@ -24,6 +24,16 @@ type ConvertDeep<T extends JSONSchema> = Exclude<T, boolean> & {
|
|
|
24
24
|
export type PropertySchema = ConvertDeep<JSONSchema>;
|
|
25
25
|
export type TopLevelPropertySchema = PropertySchema & {
|
|
26
26
|
primaryKey?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the property is computed based on other properties or some formula.
|
|
29
|
+
* If true, readonly also needs to be true and this field should not be part of an insert statement.
|
|
30
|
+
*/
|
|
31
|
+
isComputed?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the default value generated by the database. CURRENT_DATE is something generated by the database vs
|
|
34
|
+
* 'Hello' which is a constant.
|
|
35
|
+
*/
|
|
36
|
+
isDefaultComputed?: boolean;
|
|
27
37
|
};
|
|
28
38
|
export type CollectionSchema = ConvertDeep<JSONSchema> & {
|
|
29
39
|
properties?: Record<string, TopLevelPropertySchema>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isDefined<T>(t: T | undefined | null): t is T;
|
|
@@ -2,3 +2,5 @@ export declare function getInPath(obj: any, path: string): any;
|
|
|
2
2
|
export declare function setInPath(obj: any, path: string, value: any): void;
|
|
3
3
|
export declare function deleteInPath(obj: any, path: string): void;
|
|
4
4
|
export declare function deepReplace(obj: any, keyName: string, replacer: (from: any) => any): void;
|
|
5
|
+
export declare function replaceKeyInMap<K, T>(map: Map<K, T | undefined>, a: K, b: K): void;
|
|
6
|
+
export declare function replaceKeyInRecord<K extends keyof any, T>(record: Record<K, T>, a: K, b: K): void;
|