@squidcloud/client 1.0.32 → 1.0.34
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/api-call.context.d.ts +12 -12
- package/dist/common/src/api.types.d.ts +23 -23
- package/dist/common/src/application.schemas.d.ts +883 -896
- package/dist/common/src/application.types.d.ts +205 -202
- package/dist/common/src/backend-function.schemas.d.ts +3 -3
- package/dist/common/src/backend-function.types.d.ts +7 -7
- package/dist/common/src/backend-run.types.d.ts +66 -66
- package/dist/common/src/bundle-api.types.d.ts +64 -64
- package/dist/common/src/bundle-data.types.d.ts +46 -46
- package/dist/common/src/communication.types.d.ts +4 -4
- package/dist/common/src/context.types.d.ts +31 -31
- package/dist/common/src/document.types.d.ts +35 -35
- package/dist/common/src/graphql.context.d.ts +6 -6
- package/dist/common/src/graphql.types.d.ts +16 -16
- package/dist/common/src/http-status.enum.d.ts +50 -50
- package/dist/common/src/index.d.ts +49 -49
- package/dist/common/src/integration.types.d.ts +319 -328
- package/dist/common/src/logger.types.d.ts +21 -21
- package/dist/common/src/metrics.types.d.ts +58 -58
- package/dist/common/src/mutation.context.d.ts +10 -10
- package/dist/common/src/mutation.schemas.d.ts +5 -5
- package/dist/common/src/mutation.types.d.ts +72 -72
- package/dist/common/src/named-query.context.d.ts +4 -4
- package/dist/common/src/named-query.schemas.d.ts +3 -3
- package/dist/common/src/named-query.types.d.ts +9 -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 +90 -90
- package/dist/common/src/query.schemas.d.ts +5 -5
- package/dist/common/src/query.types.d.ts +118 -118
- package/dist/common/src/regions.d.ts +22 -23
- package/dist/common/src/schema/schema.types.d.ts +54 -54
- package/dist/common/src/secret.schemas.d.ts +6 -6
- package/dist/common/src/secret.types.d.ts +40 -40
- package/dist/common/src/security.types.d.ts +3 -3
- package/dist/common/src/socket.schemas.d.ts +3 -3
- package/dist/common/src/socket.types.d.ts +68 -68
- package/dist/common/src/time-units.d.ts +5 -5
- package/dist/common/src/trigger.types.d.ts +15 -15
- package/dist/common/src/types.d.ts +15 -15
- package/dist/common/src/utils/array.d.ts +8 -8
- package/dist/common/src/utils/assert.d.ts +8 -8
- package/dist/common/src/utils/error.d.ts +4 -4
- package/dist/common/src/utils/http.d.ts +2 -0
- 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/validation.d.ts +30 -30
- package/dist/common/src/webhook-response.d.ts +7 -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/api.manager.d.ts +14 -14
- package/dist/typescript-client/src/backend-function.manager.d.ts +13 -13
- package/dist/typescript-client/src/collection-reference.d.ts +53 -51
- package/dist/typescript-client/src/collection-reference.factory.d.ts +16 -16
- package/dist/typescript-client/src/data.manager.d.ts +166 -166
- package/dist/typescript-client/src/destruct.manager.d.ts +12 -9
- package/dist/typescript-client/src/document-identity.service.d.ts +12 -12
- package/dist/typescript-client/src/document-reference.d.ts +100 -90
- 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 +7 -7
- package/dist/typescript-client/src/mutation/mutation-sender.d.ts +11 -11
- package/dist/typescript-client/src/mutation/mutation.spec.d.ts +1 -1
- package/dist/typescript-client/src/named-query.manager.d.ts +13 -13
- package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +71 -71
- package/dist/typescript-client/src/query/query-builder.factory.d.ts +60 -53
- package/dist/typescript-client/src/query/query-subscription.manager.d.ts +59 -59
- package/dist/typescript-client/src/query/query-subscription.manager.spec.d.ts +1 -1
- package/dist/typescript-client/src/query/query.spec.d.ts +1 -1
- package/dist/typescript-client/src/query/query.types.d.ts +14 -14
- package/dist/typescript-client/src/rpc.manager.d.ts +30 -24
- package/dist/typescript-client/src/socket.manager.d.ts +27 -27
- package/dist/typescript-client/src/squid.d.ts +173 -171
- 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/fake-rpc.manager.d.ts +20 -20
- package/dist/typescript-client/src/testing/fake-socket.manager.d.ts +9 -9
- package/dist/typescript-client/src/testing/setup-tests.d.ts +1 -1
- package/dist/typescript-client/src/testing/squid-env-setup.d.ts +79 -79
- package/dist/typescript-client/src/types.d.ts +2 -2
- package/package.json +2 -4
- package/dist/common/src/utils/url.d.ts +0 -1
- package/dist/package.json +0 -63
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { BaseAction } from './actions';
|
|
2
|
-
export type StateLeafNode = string | boolean | number | null | undefined | object | Array<StateLeafNode> | State;
|
|
3
|
-
export type State = {
|
|
4
|
-
[key: string]: StateLeafNode;
|
|
5
|
-
};
|
|
6
|
-
export declare function apply(state: State, action: BaseAction): State;
|
|
7
|
-
export declare function isStateObject(state: StateLeafNode): state is State;
|
|
1
|
+
import { BaseAction } from './actions';
|
|
2
|
+
export type StateLeafNode = string | boolean | number | null | undefined | object | Array<StateLeafNode> | State;
|
|
3
|
+
export type State = {
|
|
4
|
+
[key: string]: StateLeafNode;
|
|
5
|
+
};
|
|
6
|
+
export declare function apply(state: State, action: BaseAction): State;
|
|
7
|
+
export declare function isStateObject(state: StateLeafNode): state is State;
|
|
@@ -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,20 +1,20 @@
|
|
|
1
|
-
import { ClientRequestId } from '@squidcloud/common';
|
|
2
|
-
import { DestructManager } from '../destruct.manager';
|
|
3
|
-
import { RpcManager } from '../rpc.manager';
|
|
4
|
-
import { FakeSocketManager } from './fake-socket.manager';
|
|
5
|
-
export declare class FakeRpcManager extends RpcManager {
|
|
6
|
-
lastQueryClientRequestId: ClientRequestId | undefined;
|
|
7
|
-
lastPostRequest?: {
|
|
8
|
-
path: string;
|
|
9
|
-
message: any;
|
|
10
|
-
};
|
|
11
|
-
allPostRequests: Array<{
|
|
12
|
-
path: string;
|
|
13
|
-
message: any;
|
|
14
|
-
}>;
|
|
15
|
-
errorResponses: Array<any>;
|
|
16
|
-
constructor(socketManager: FakeSocketManager, destructManager: DestructManager);
|
|
17
|
-
setStaticHeader(key: string, value: string): void;
|
|
18
|
-
deleteStaticHeader(key: string): void;
|
|
19
|
-
post<T>(path: string, message: any): Promise<T>;
|
|
20
|
-
}
|
|
1
|
+
import { ClientRequestId } from '@squidcloud/common';
|
|
2
|
+
import { DestructManager } from '../destruct.manager';
|
|
3
|
+
import { RpcManager } from '../rpc.manager';
|
|
4
|
+
import { FakeSocketManager } from './fake-socket.manager';
|
|
5
|
+
export declare class FakeRpcManager extends RpcManager {
|
|
6
|
+
lastQueryClientRequestId: ClientRequestId | undefined;
|
|
7
|
+
lastPostRequest?: {
|
|
8
|
+
path: string;
|
|
9
|
+
message: any;
|
|
10
|
+
};
|
|
11
|
+
allPostRequests: Array<{
|
|
12
|
+
path: string;
|
|
13
|
+
message: any;
|
|
14
|
+
}>;
|
|
15
|
+
errorResponses: Array<any>;
|
|
16
|
+
constructor(socketManager: FakeSocketManager, destructManager: DestructManager);
|
|
17
|
+
setStaticHeader(key: string, value: string): void;
|
|
18
|
+
deleteStaticHeader(key: string): void;
|
|
19
|
+
post<T>(path: string, message: any): Promise<T>;
|
|
20
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { MessageFromClient, MessageToClient } from '@squidcloud/common';
|
|
2
|
-
import { Observable, Subject } from 'rxjs';
|
|
3
|
-
import { SocketManagerInterface } from '../socket.manager';
|
|
4
|
-
export declare class FakeSocketManager implements SocketManagerInterface {
|
|
5
|
-
messagesToClient: Subject<MessageToClient>;
|
|
6
|
-
observeConnectionReady(): Observable<boolean>;
|
|
7
|
-
observeNotifications(): Observable<MessageToClient>;
|
|
8
|
-
sendMessage(message: MessageFromClient): void;
|
|
9
|
-
}
|
|
1
|
+
import { MessageFromClient, MessageToClient } from '@squidcloud/common';
|
|
2
|
+
import { Observable, Subject } from 'rxjs';
|
|
3
|
+
import { SocketManagerInterface } from '../socket.manager';
|
|
4
|
+
export declare class FakeSocketManager implements SocketManagerInterface {
|
|
5
|
+
messagesToClient: Subject<MessageToClient>;
|
|
6
|
+
observeConnectionReady(): Observable<boolean>;
|
|
7
|
+
observeNotifications(): Observable<MessageToClient>;
|
|
8
|
+
sendMessage(message: MessageFromClient): void;
|
|
9
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
declare const nodeCrypto: any;
|
|
1
|
+
declare const nodeCrypto: any;
|
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
import { ClientRequestId, CollectionName, DocId, IntegrationId, LockManager, MutationType, SquidDocument } from '@squidcloud/common';
|
|
2
|
-
import { Subject, Subscription } from 'rxjs';
|
|
3
|
-
import { CollectionReference } from '../collection-reference';
|
|
4
|
-
import { CollectionReferenceFactory } from '../collection-reference.factory';
|
|
5
|
-
import { DataManager } from '../data.manager';
|
|
6
|
-
import { DestructManager } from '../destruct.manager';
|
|
7
|
-
import DocumentIdentityService from '../document-identity.service';
|
|
8
|
-
import { DocumentReferenceFactory } from '../document-reference.factory';
|
|
9
|
-
import { DocumentStore } from '../document-store';
|
|
10
|
-
import { MutationSender } from '../mutation/mutation-sender';
|
|
11
|
-
import { JoinQueryBuilderFactory } from '../query/join-query-builder.factory';
|
|
12
|
-
import { QueryBuilderFactory } from '../query/query-builder.factory';
|
|
13
|
-
import { QuerySubscriptionManager } from '../query/query-subscription.manager';
|
|
14
|
-
import { FakeRpcManager } from './fake-rpc.manager';
|
|
15
|
-
import { FakeSocketManager } from './fake-socket.manager';
|
|
16
|
-
export type TestDocTypeA = {
|
|
17
|
-
a: number;
|
|
18
|
-
b?: {
|
|
19
|
-
c: number;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export type TestDocTypeB = {
|
|
23
|
-
b: number;
|
|
24
|
-
c?: {
|
|
25
|
-
d: number;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
export type QueryResponse = {
|
|
29
|
-
resCount: number;
|
|
30
|
-
results: Array<TestDocTypeA> | undefined;
|
|
31
|
-
receivedSubject: Subject<void>;
|
|
32
|
-
};
|
|
33
|
-
export type JoinQueryResponse = {
|
|
34
|
-
resCount: number;
|
|
35
|
-
results: Array<{
|
|
36
|
-
a: TestDocTypeA;
|
|
37
|
-
b: TestDocTypeB | undefined;
|
|
38
|
-
}> | undefined;
|
|
39
|
-
receivedSubject: Subject<void>;
|
|
40
|
-
subscription: Subscription;
|
|
41
|
-
};
|
|
42
|
-
export declare class SquidEnvSetup {
|
|
43
|
-
readonly querySubscriptionManager: QuerySubscriptionManager;
|
|
44
|
-
readonly socketManager: FakeSocketManager;
|
|
45
|
-
readonly rpcManager: FakeRpcManager;
|
|
46
|
-
readonly documentStore: DocumentStore;
|
|
47
|
-
readonly documentReferenceFactory: DocumentReferenceFactory;
|
|
48
|
-
readonly collectionReferenceFactory: CollectionReferenceFactory;
|
|
49
|
-
readonly queryBuilderFactory: QueryBuilderFactory;
|
|
50
|
-
readonly joinQueryBuilderFactory: JoinQueryBuilderFactory;
|
|
51
|
-
readonly lockManager: LockManager;
|
|
52
|
-
readonly mutationSender: MutationSender;
|
|
53
|
-
readonly dataManager: DataManager;
|
|
54
|
-
readonly clientId = "fakeClientId";
|
|
55
|
-
readonly destructManager: DestructManager;
|
|
56
|
-
readonly documentIdentityService: DocumentIdentityService;
|
|
57
|
-
readonly collectionA: CollectionReference<TestDocTypeA>;
|
|
58
|
-
readonly collectionB: CollectionReference<TestDocTypeB>;
|
|
59
|
-
constructor();
|
|
60
|
-
simulateQueryResponse(docs: Array<Partial<SquidDocument>>, collectionName: CollectionName, integrationId?: IntegrationId, clientRequestId?: ClientRequestId): void;
|
|
61
|
-
simulateMutationsResponse(updates: Array<{
|
|
62
|
-
mutationType: MutationType;
|
|
63
|
-
collectionName: CollectionName;
|
|
64
|
-
integrationId?: IntegrationId;
|
|
65
|
-
clientRequestId?: ClientRequestId;
|
|
66
|
-
doc: Partial<SquidDocument> & {
|
|
67
|
-
__docId__: DocId;
|
|
68
|
-
};
|
|
69
|
-
}>, mutationsTimestamp?: number): Promise<void>;
|
|
70
|
-
simulateErrorResponse(message: string): void;
|
|
71
|
-
runAsync(fn: () => any): Promise<void>;
|
|
72
|
-
getBuiltInDocId(idValue: string): string;
|
|
73
|
-
executeQueryOnCollectionA(subscribe?: boolean): QueryResponse;
|
|
74
|
-
executeJoinQuery(subscribe?: boolean): JoinQueryResponse;
|
|
75
|
-
simulateResponseForCollectionA(id?: string, a?: number): void;
|
|
76
|
-
simulateResponseForCollectionB(id: string, b: number): void;
|
|
77
|
-
}
|
|
78
|
-
export declare let squidEnvSetup: SquidEnvSetup;
|
|
79
|
-
export declare function squidEnvSetupBeforeEach(): void;
|
|
1
|
+
import { ClientRequestId, CollectionName, DocId, IntegrationId, LockManager, MutationType, SquidDocument } from '@squidcloud/common';
|
|
2
|
+
import { Subject, Subscription } from 'rxjs';
|
|
3
|
+
import { CollectionReference } from '../collection-reference';
|
|
4
|
+
import { CollectionReferenceFactory } from '../collection-reference.factory';
|
|
5
|
+
import { DataManager } from '../data.manager';
|
|
6
|
+
import { DestructManager } from '../destruct.manager';
|
|
7
|
+
import DocumentIdentityService from '../document-identity.service';
|
|
8
|
+
import { DocumentReferenceFactory } from '../document-reference.factory';
|
|
9
|
+
import { DocumentStore } from '../document-store';
|
|
10
|
+
import { MutationSender } from '../mutation/mutation-sender';
|
|
11
|
+
import { JoinQueryBuilderFactory } from '../query/join-query-builder.factory';
|
|
12
|
+
import { QueryBuilderFactory } from '../query/query-builder.factory';
|
|
13
|
+
import { QuerySubscriptionManager } from '../query/query-subscription.manager';
|
|
14
|
+
import { FakeRpcManager } from './fake-rpc.manager';
|
|
15
|
+
import { FakeSocketManager } from './fake-socket.manager';
|
|
16
|
+
export type TestDocTypeA = {
|
|
17
|
+
a: number;
|
|
18
|
+
b?: {
|
|
19
|
+
c: number;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export type TestDocTypeB = {
|
|
23
|
+
b: number;
|
|
24
|
+
c?: {
|
|
25
|
+
d: number;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export type QueryResponse = {
|
|
29
|
+
resCount: number;
|
|
30
|
+
results: Array<TestDocTypeA> | undefined;
|
|
31
|
+
receivedSubject: Subject<void>;
|
|
32
|
+
};
|
|
33
|
+
export type JoinQueryResponse = {
|
|
34
|
+
resCount: number;
|
|
35
|
+
results: Array<{
|
|
36
|
+
a: TestDocTypeA;
|
|
37
|
+
b: TestDocTypeB | undefined;
|
|
38
|
+
}> | undefined;
|
|
39
|
+
receivedSubject: Subject<void>;
|
|
40
|
+
subscription: Subscription;
|
|
41
|
+
};
|
|
42
|
+
export declare class SquidEnvSetup {
|
|
43
|
+
readonly querySubscriptionManager: QuerySubscriptionManager;
|
|
44
|
+
readonly socketManager: FakeSocketManager;
|
|
45
|
+
readonly rpcManager: FakeRpcManager;
|
|
46
|
+
readonly documentStore: DocumentStore;
|
|
47
|
+
readonly documentReferenceFactory: DocumentReferenceFactory;
|
|
48
|
+
readonly collectionReferenceFactory: CollectionReferenceFactory;
|
|
49
|
+
readonly queryBuilderFactory: QueryBuilderFactory;
|
|
50
|
+
readonly joinQueryBuilderFactory: JoinQueryBuilderFactory;
|
|
51
|
+
readonly lockManager: LockManager;
|
|
52
|
+
readonly mutationSender: MutationSender;
|
|
53
|
+
readonly dataManager: DataManager;
|
|
54
|
+
readonly clientId = "fakeClientId";
|
|
55
|
+
readonly destructManager: DestructManager;
|
|
56
|
+
readonly documentIdentityService: DocumentIdentityService;
|
|
57
|
+
readonly collectionA: CollectionReference<TestDocTypeA>;
|
|
58
|
+
readonly collectionB: CollectionReference<TestDocTypeB>;
|
|
59
|
+
constructor();
|
|
60
|
+
simulateQueryResponse(docs: Array<Partial<SquidDocument>>, collectionName: CollectionName, integrationId?: IntegrationId, clientRequestId?: ClientRequestId): void;
|
|
61
|
+
simulateMutationsResponse(updates: Array<{
|
|
62
|
+
mutationType: MutationType;
|
|
63
|
+
collectionName: CollectionName;
|
|
64
|
+
integrationId?: IntegrationId;
|
|
65
|
+
clientRequestId?: ClientRequestId;
|
|
66
|
+
doc: Partial<SquidDocument> & {
|
|
67
|
+
__docId__: DocId;
|
|
68
|
+
};
|
|
69
|
+
}>, mutationsTimestamp?: number): Promise<void>;
|
|
70
|
+
simulateErrorResponse(message: string): void;
|
|
71
|
+
runAsync(fn: () => any): Promise<void>;
|
|
72
|
+
getBuiltInDocId(idValue: string): string;
|
|
73
|
+
executeQueryOnCollectionA(subscribe?: boolean): QueryResponse;
|
|
74
|
+
executeJoinQuery(subscribe?: boolean): JoinQueryResponse;
|
|
75
|
+
simulateResponseForCollectionA(id?: string, a?: number): void;
|
|
76
|
+
simulateResponseForCollectionB(id: string, b: number): void;
|
|
77
|
+
}
|
|
78
|
+
export declare let squidEnvSetup: SquidEnvSetup;
|
|
79
|
+
export declare function squidEnvSetupBeforeEach(): void;
|
|
@@ -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.
|
|
3
|
+
"version": "1.0.34",
|
|
4
4
|
"description": "A typescript implementation of the Squid client",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/typescript-client/src/index.d.ts",
|
|
@@ -10,17 +10,15 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"prebuild": "rimraf dist",
|
|
12
12
|
"build": "webpack --mode=production",
|
|
13
|
-
"postbuild": "npm run copy-files",
|
|
14
13
|
"build:dev": "webpack --mode=development",
|
|
15
14
|
"build:prod": "webpack --mode=production",
|
|
16
|
-
"copy-files": "cpx package.json dist",
|
|
17
15
|
"watch": "webpack --watch",
|
|
18
16
|
"test": "jest --detectOpenHandles",
|
|
19
17
|
"test:watch": "jest --watch",
|
|
20
18
|
"test:cov": "jest --coverage",
|
|
21
19
|
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
|
22
20
|
"test:e2e": "jest --config ./test/jest-e2e.json",
|
|
23
|
-
"publish:public": "npm
|
|
21
|
+
"publish:public": "npm run build && npm version patch && npm publish --access public"
|
|
24
22
|
},
|
|
25
23
|
"keywords": [
|
|
26
24
|
"typescript",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getApplicationUrl(regionPrefix: string, appId: string): string;
|
package/dist/package.json
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@squidcloud/client",
|
|
3
|
-
"version": "1.0.32",
|
|
4
|
-
"description": "A typescript implementation of the Squid client",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/typescript-client/src/index.d.ts",
|
|
7
|
-
"files": [
|
|
8
|
-
"dist/**/*"
|
|
9
|
-
],
|
|
10
|
-
"scripts": {
|
|
11
|
-
"prebuild": "rimraf dist",
|
|
12
|
-
"build": "webpack --mode=production",
|
|
13
|
-
"postbuild": "npm run copy-files",
|
|
14
|
-
"build:dev": "webpack --mode=development",
|
|
15
|
-
"build:prod": "webpack --mode=production",
|
|
16
|
-
"copy-files": "cpx package.json dist",
|
|
17
|
-
"watch": "webpack --watch",
|
|
18
|
-
"test": "jest --detectOpenHandles",
|
|
19
|
-
"test:watch": "jest --watch",
|
|
20
|
-
"test:cov": "jest --coverage",
|
|
21
|
-
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
|
22
|
-
"test:e2e": "jest --config ./test/jest-e2e.json",
|
|
23
|
-
"publish:public": "npm version patch && npm run build && npm publish --access public"
|
|
24
|
-
},
|
|
25
|
-
"keywords": [
|
|
26
|
-
"typescript",
|
|
27
|
-
"javascript",
|
|
28
|
-
"squid",
|
|
29
|
-
"squid cloud",
|
|
30
|
-
"realtime",
|
|
31
|
-
"database"
|
|
32
|
-
],
|
|
33
|
-
"author": "",
|
|
34
|
-
"license": "ISC",
|
|
35
|
-
"dependencies": {
|
|
36
|
-
"@apollo/client": "^3.7.4",
|
|
37
|
-
"@squidcloud/common": "^1.0.10",
|
|
38
|
-
"@supercharge/promise-pool": "^2.3.2",
|
|
39
|
-
"cross-fetch": "^3.1.5",
|
|
40
|
-
"lodash": "^4.17.21",
|
|
41
|
-
"socket.io-client": "^4.5.2"
|
|
42
|
-
},
|
|
43
|
-
"peerDependencies": {
|
|
44
|
-
"rxjs": ">=7.5.7 <8.0.0"
|
|
45
|
-
},
|
|
46
|
-
"devDependencies": {
|
|
47
|
-
"@types/lodash": "^4.14.186",
|
|
48
|
-
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
|
49
|
-
"@typescript-eslint/parser": "^5.0.0",
|
|
50
|
-
"@webpack-cli/generators": "^3.0.0",
|
|
51
|
-
"copy-webpack-plugin": "^11.0.0",
|
|
52
|
-
"cpx": "^1.5.0",
|
|
53
|
-
"eslint": "8.22.0",
|
|
54
|
-
"eslint-config-prettier": "^8.3.0",
|
|
55
|
-
"eslint-plugin-prettier": "^4.0.0",
|
|
56
|
-
"generate-package-json-webpack-plugin": "^2.6.0",
|
|
57
|
-
"prettier": "^2.8.0",
|
|
58
|
-
"tsconfig-paths-webpack-plugin": "^4.0.0",
|
|
59
|
-
"tscpaths": "^0.0.9",
|
|
60
|
-
"webpack": "^5.75.0",
|
|
61
|
-
"webpack-cli": "^5.0.0"
|
|
62
|
-
}
|
|
63
|
-
}
|