@squidcloud/client 1.0.17 → 1.0.19
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 +17 -17
- package/dist/common/src/api.types.d.ts +10 -10
- package/dist/common/src/application.schemas.d.ts +608 -608
- package/dist/common/src/application.types.d.ts +197 -112
- 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 +60 -60
- package/dist/common/src/bundle-api.types.d.ts +66 -66
- package/dist/common/src/bundle-data.types.d.ts +47 -45
- package/dist/common/src/communication.types.d.ts +4 -4
- package/dist/common/src/context.types.d.ts +21 -21
- package/dist/common/src/document.types.d.ts +35 -29
- package/dist/common/src/executable.context.d.ts +4 -4
- package/dist/common/src/graphql.context.d.ts +14 -14
- package/dist/common/src/graphql.types.d.ts +8 -8
- package/dist/common/src/http-status.enum.d.ts +50 -50
- package/dist/common/src/index.d.ts +50 -49
- package/dist/common/src/integration.types.d.ts +249 -249
- package/dist/common/src/logger.types.d.ts +22 -22
- package/dist/common/src/metrics.schemas.d.ts +3 -3
- package/dist/common/src/metrics.types.d.ts +65 -65
- package/dist/common/src/mutation.context.d.ts +11 -11
- package/dist/common/src/mutation.schemas.d.ts +5 -5
- package/dist/common/src/mutation.types.d.ts +72 -70
- 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 +38 -38
- package/dist/common/src/query/simple-query-builder.d.ts +14 -14
- 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 +4 -4
- package/dist/common/src/schema/schema.types.d.ts +54 -53
- package/dist/common/src/secret.schemas.d.ts +6 -6
- package/dist/common/src/secret.types.d.ts +38 -38
- 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 -7
- 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/id.d.ts +1 -1
- package/dist/common/src/utils/lock.manager.d.ts +14 -14
- package/dist/common/src/utils/nullish.d.ts +1 -0
- 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 +7 -0
- package/dist/index.js +4 -4
- package/dist/node_modules/json-schema-typed/draft-2020-12.d.ts +1239 -1239
- package/dist/package.json +1 -1
- 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 +19 -17
- package/dist/typescript-client/src/collection-reference.factory.d.ts +16 -14
- package/dist/typescript-client/src/data.manager.d.ts +164 -162
- package/dist/typescript-client/src/destruct.manager.d.ts +9 -9
- package/dist/typescript-client/src/document-identity.service.d.ts +12 -12
- package/dist/typescript-client/src/document-reference.d.ts +21 -21
- 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 +9 -9
- package/dist/typescript-client/src/graphql-client.factory.d.ts +9 -9
- package/dist/typescript-client/src/index.d.ts +7 -4
- 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 +35 -0
- package/dist/typescript-client/src/query/query-builder.factory.d.ts +36 -44
- package/dist/typescript-client/src/query/query-subscription.manager.d.ts +59 -58
- 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 +7 -7
- package/dist/typescript-client/src/rpc.manager.d.ts +24 -23
- package/dist/typescript-client/src/socket.manager.d.ts +27 -27
- package/dist/typescript-client/src/squid.d.ts +51 -49
- 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 -77
- package/dist/typescript-client/src/types.d.ts +2 -2
- package/package.json +1 -1
- package/dist/common/src/utils/isDefined.d.ts +0 -1
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
export type MetricRate = string;
|
|
2
|
-
export type MetricResolution = string;
|
|
3
|
-
export type MetricTimeWindow = {
|
|
4
|
-
startTimeMs: number;
|
|
5
|
-
endTimeMs: number;
|
|
6
|
-
};
|
|
7
|
-
export type MetricType = 'latency' | 'successful' | 'failure' | 'total';
|
|
8
|
-
export type MetricUnit = 'millisecond' | 'count';
|
|
9
|
-
export type MetricGroupName = 'backendBootstrap' | 'backendFunctionCall' | 'integrationConnectAttempt' | 'integrationReadOperation' | 'integrationWriteOperation';
|
|
10
|
-
/**
|
|
11
|
-
* Filter key descriptions:
|
|
12
|
-
* - `functionName` - Only supported by 'backendFunctionCall' metric. The name of the function.
|
|
13
|
-
* - `integrationId` - Only supported by `integration*` metrics. The id of the integration.
|
|
14
|
-
* - `resultType` - Only supported by all metrics. The result of the operation being either 'success' or 'failure'.
|
|
15
|
-
*/
|
|
16
|
-
export type MetricFilterKey = 'functionName' | 'integrationId' | 'resultType';
|
|
17
|
-
/**
|
|
18
|
-
* Internal filters are automatically assigned and are not configurable through the open API.
|
|
19
|
-
*/
|
|
20
|
-
export type MetricInternalFilterKey = MetricFilterKey | 'appId' | 'operationType';
|
|
21
|
-
export type MetricFilterValue = string | number | boolean;
|
|
22
|
-
export type MetricFilterOperationType = 'read' | 'write';
|
|
23
|
-
export type MetricFilterResultType = 'success' | 'failure';
|
|
24
|
-
export type MetricInternalFilters = MetricFilters<MetricInternalFilterKey> & {
|
|
25
|
-
operationType?: MetricFilterOperationType;
|
|
26
|
-
};
|
|
27
|
-
export type MetricFilters<T extends string> = {
|
|
28
|
-
[key in T]?: MetricFilterValue;
|
|
29
|
-
} & {
|
|
30
|
-
resultType?: MetricFilterResultType;
|
|
31
|
-
};
|
|
32
|
-
export interface MetricRequest {
|
|
33
|
-
summary?: boolean;
|
|
34
|
-
histogram?: {
|
|
35
|
-
rate: MetricRate;
|
|
36
|
-
resolution: MetricResolution;
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
export interface GetMetricDataRequest {
|
|
40
|
-
requests: Array<{
|
|
41
|
-
filters: MetricFilters<MetricFilterKey>;
|
|
42
|
-
metricGroup: MetricGroupName;
|
|
43
|
-
metrics: {
|
|
44
|
-
[key in MetricType]?: MetricRequest;
|
|
45
|
-
};
|
|
46
|
-
}>;
|
|
47
|
-
timeWindow: MetricTimeWindow;
|
|
48
|
-
}
|
|
49
|
-
export type MetricHistogram = Array<{
|
|
50
|
-
timestamp: Date;
|
|
51
|
-
value: number;
|
|
52
|
-
}>;
|
|
53
|
-
export type MetricResponse = {
|
|
54
|
-
unit: MetricUnit;
|
|
55
|
-
summary?: number;
|
|
56
|
-
histogram?: MetricHistogram;
|
|
57
|
-
};
|
|
58
|
-
export type GetMetricDataResponse = {
|
|
59
|
-
results: Array<{
|
|
60
|
-
metricGroup: MetricGroupName;
|
|
61
|
-
metrics: {
|
|
62
|
-
[key in MetricType]?: MetricResponse;
|
|
63
|
-
};
|
|
64
|
-
}>;
|
|
65
|
-
};
|
|
1
|
+
export type MetricRate = string;
|
|
2
|
+
export type MetricResolution = string;
|
|
3
|
+
export type MetricTimeWindow = {
|
|
4
|
+
startTimeMs: number;
|
|
5
|
+
endTimeMs: number;
|
|
6
|
+
};
|
|
7
|
+
export type MetricType = 'latency' | 'successful' | 'failure' | 'total';
|
|
8
|
+
export type MetricUnit = 'millisecond' | 'count';
|
|
9
|
+
export type MetricGroupName = 'backendBootstrap' | 'backendFunctionCall' | 'integrationConnectAttempt' | 'integrationReadOperation' | 'integrationWriteOperation';
|
|
10
|
+
/**
|
|
11
|
+
* Filter key descriptions:
|
|
12
|
+
* - `functionName` - Only supported by 'backendFunctionCall' metric. The name of the function.
|
|
13
|
+
* - `integrationId` - Only supported by `integration*` metrics. The id of the integration.
|
|
14
|
+
* - `resultType` - Only supported by all metrics. The result of the operation being either 'success' or 'failure'.
|
|
15
|
+
*/
|
|
16
|
+
export type MetricFilterKey = 'functionName' | 'integrationId' | 'resultType';
|
|
17
|
+
/**
|
|
18
|
+
* Internal filters are automatically assigned and are not configurable through the open API.
|
|
19
|
+
*/
|
|
20
|
+
export type MetricInternalFilterKey = MetricFilterKey | 'appId' | 'operationType';
|
|
21
|
+
export type MetricFilterValue = string | number | boolean;
|
|
22
|
+
export type MetricFilterOperationType = 'read' | 'write';
|
|
23
|
+
export type MetricFilterResultType = 'success' | 'failure';
|
|
24
|
+
export type MetricInternalFilters = MetricFilters<MetricInternalFilterKey> & {
|
|
25
|
+
operationType?: MetricFilterOperationType;
|
|
26
|
+
};
|
|
27
|
+
export type MetricFilters<T extends string> = {
|
|
28
|
+
[key in T]?: MetricFilterValue;
|
|
29
|
+
} & {
|
|
30
|
+
resultType?: MetricFilterResultType;
|
|
31
|
+
};
|
|
32
|
+
export interface MetricRequest {
|
|
33
|
+
summary?: boolean;
|
|
34
|
+
histogram?: {
|
|
35
|
+
rate: MetricRate;
|
|
36
|
+
resolution: MetricResolution;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export interface GetMetricDataRequest {
|
|
40
|
+
requests: Array<{
|
|
41
|
+
filters: MetricFilters<MetricFilterKey>;
|
|
42
|
+
metricGroup: MetricGroupName;
|
|
43
|
+
metrics: {
|
|
44
|
+
[key in MetricType]?: MetricRequest;
|
|
45
|
+
};
|
|
46
|
+
}>;
|
|
47
|
+
timeWindow: MetricTimeWindow;
|
|
48
|
+
}
|
|
49
|
+
export type MetricHistogram = Array<{
|
|
50
|
+
timestamp: Date;
|
|
51
|
+
value: number;
|
|
52
|
+
}>;
|
|
53
|
+
export type MetricResponse = {
|
|
54
|
+
unit: MetricUnit;
|
|
55
|
+
summary?: number;
|
|
56
|
+
histogram?: MetricHistogram;
|
|
57
|
+
};
|
|
58
|
+
export type GetMetricDataResponse = {
|
|
59
|
+
results: Array<{
|
|
60
|
+
metricGroup: MetricGroupName;
|
|
61
|
+
metrics: {
|
|
62
|
+
[key in MetricType]?: MetricResponse;
|
|
63
|
+
};
|
|
64
|
+
}>;
|
|
65
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Mutation, MutationType } from './mutation.types';
|
|
2
|
-
import { BeforeAndAfterDocs } from './document.types';
|
|
3
|
-
import { Paths } from './types';
|
|
4
|
-
export declare class MutationContext<T = any> {
|
|
5
|
-
readonly mutation: Mutation<T>;
|
|
6
|
-
readonly beforeAndAfterDocs: BeforeAndAfterDocs<T>;
|
|
7
|
-
readonly serverTimeStamp: Date;
|
|
8
|
-
constructor(mutation: Mutation<T>, beforeAndAfterDocs: BeforeAndAfterDocs<T>, serverTimeStamp: Date);
|
|
9
|
-
getMutationType(): MutationType;
|
|
10
|
-
affectsPath(path: Paths<T>): boolean;
|
|
11
|
-
}
|
|
1
|
+
import { Mutation, MutationType } from './mutation.types';
|
|
2
|
+
import { BeforeAndAfterDocs } from './document.types';
|
|
3
|
+
import { Paths } from './types';
|
|
4
|
+
export declare class MutationContext<T = any> {
|
|
5
|
+
readonly mutation: Mutation<T>;
|
|
6
|
+
readonly beforeAndAfterDocs: BeforeAndAfterDocs<T>;
|
|
7
|
+
readonly serverTimeStamp: Date;
|
|
8
|
+
constructor(mutation: Mutation<T>, beforeAndAfterDocs: BeforeAndAfterDocs<T>, serverTimeStamp: Date);
|
|
9
|
+
getMutationType(): MutationType;
|
|
10
|
+
affectsPath(path: Paths<T>): boolean;
|
|
11
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { JSONSchemaType } from 'ajv';
|
|
2
|
-
import { MutateRequest } from './mutation.types';
|
|
3
|
-
type DocumentBase = Record<string, any>;
|
|
4
|
-
export declare const MutationRequestSchema: JSONSchemaType<MutateRequest<DocumentBase>>;
|
|
5
|
-
export {};
|
|
1
|
+
import { JSONSchemaType } from 'ajv';
|
|
2
|
+
import { MutateRequest } from './mutation.types';
|
|
3
|
+
type DocumentBase = Record<string, any>;
|
|
4
|
+
export declare const MutationRequestSchema: JSONSchemaType<MutateRequest<DocumentBase>>;
|
|
5
|
+
export {};
|
|
@@ -1,70 +1,72 @@
|
|
|
1
|
-
import { ClientId, IntegrationId } from './communication.types';
|
|
2
|
-
import { DocTimestamp, FieldName, SquidDocId, SquidDocIdObj, SquidDocument } from './document.types';
|
|
3
|
-
export interface MutateRequest<T = any> {
|
|
4
|
-
clientId: ClientId;
|
|
5
|
-
integrationId: IntegrationId;
|
|
6
|
-
mutations: Array<Mutation<T>>;
|
|
7
|
-
}
|
|
8
|
-
export interface ExecuteMutationsResponse {
|
|
9
|
-
timestamp: DocTimestamp;
|
|
10
|
-
idResolutionMap?: IdResolutionMap;
|
|
11
|
-
afterDocs: Record<SquidDocId, SquidDocument>;
|
|
12
|
-
}
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export type
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
export declare function
|
|
64
|
-
export declare function
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
1
|
+
import { ClientId, IntegrationId } from './communication.types';
|
|
2
|
+
import { DocTimestamp, FieldName, SquidDocId, SquidDocIdObj, SquidDocument } from './document.types';
|
|
3
|
+
export interface MutateRequest<T = any> {
|
|
4
|
+
clientId: ClientId;
|
|
5
|
+
integrationId: IntegrationId;
|
|
6
|
+
mutations: Array<Mutation<T>>;
|
|
7
|
+
}
|
|
8
|
+
export interface ExecuteMutationsResponse {
|
|
9
|
+
timestamp: DocTimestamp;
|
|
10
|
+
idResolutionMap?: IdResolutionMap;
|
|
11
|
+
afterDocs: Record<SquidDocId, SquidDocument>;
|
|
12
|
+
}
|
|
13
|
+
export interface MutateResponse extends Omit<ExecuteMutationsResponse, 'afterDocs'> {
|
|
14
|
+
refreshList: Array<SquidDocId>;
|
|
15
|
+
}
|
|
16
|
+
export type IdResolutionMap = Record<SquidDocId, SquidDocId>;
|
|
17
|
+
export type Mutation<T = any> = UpdateMutation<T> | InsertMutation<T> | DeleteMutation;
|
|
18
|
+
export type MutationType = 'insert' | 'update' | 'delete';
|
|
19
|
+
interface BaseMutation {
|
|
20
|
+
type: MutationType;
|
|
21
|
+
squidDocIdObj: SquidDocIdObj;
|
|
22
|
+
}
|
|
23
|
+
export interface DeleteMutation extends BaseMutation {
|
|
24
|
+
type: 'delete';
|
|
25
|
+
}
|
|
26
|
+
export interface UpdateMutation<T = any> extends BaseMutation {
|
|
27
|
+
type: 'update';
|
|
28
|
+
properties: {
|
|
29
|
+
[key in keyof T & string]?: Array<PropertyMutation<T[key]>>;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export interface InsertMutation<T = any> extends BaseMutation {
|
|
33
|
+
type: 'insert';
|
|
34
|
+
properties: T;
|
|
35
|
+
}
|
|
36
|
+
export type PropertyMutation<Value = any> = ApplyNumericFnPropertyMutation | ApplyStringFnPropertyMutation | ValueUpdatePropertyMutation<Value> | RemovePropertyMutation;
|
|
37
|
+
export interface ValueUpdatePropertyMutation<Value = any> {
|
|
38
|
+
type: 'update';
|
|
39
|
+
value: Value;
|
|
40
|
+
}
|
|
41
|
+
export interface ApplyNumericFnPropertyMutation {
|
|
42
|
+
type: 'applyNumericFn';
|
|
43
|
+
fn: 'increment';
|
|
44
|
+
value: number;
|
|
45
|
+
}
|
|
46
|
+
export interface RemovePropertyMutation {
|
|
47
|
+
type: 'removeProperty';
|
|
48
|
+
}
|
|
49
|
+
interface ApplyExtendString {
|
|
50
|
+
type: 'applyStringFn';
|
|
51
|
+
fn: 'extendString';
|
|
52
|
+
value: string;
|
|
53
|
+
}
|
|
54
|
+
interface ApplyTrimString {
|
|
55
|
+
type: 'applyStringFn';
|
|
56
|
+
fn: 'trim';
|
|
57
|
+
}
|
|
58
|
+
export type ApplyStringFnPropertyMutation = ApplyExtendString | ApplyTrimString;
|
|
59
|
+
/**
|
|
60
|
+
* Sorts the update mutation properties in the order the properties should be applied. If the update mutation has
|
|
61
|
+
* updates for both 'a' and 'a.b', the update should be applied first to 'a' and then to 'a.b'.
|
|
62
|
+
*/
|
|
63
|
+
export declare function sortUpdateMutationProperties(updateMutation: UpdateMutation): Array<[FieldName, Array<PropertyMutation>]>;
|
|
64
|
+
export declare function mergeMutations(mutationA: Mutation, mutationB: Mutation): Mutation;
|
|
65
|
+
export declare function applyUpdateMutation<T extends SquidDocument>(doc: T, updateMutation: UpdateMutation<T>): T | undefined;
|
|
66
|
+
export declare function convertInsertToUpdate(insertMutation: InsertMutation): UpdateMutation;
|
|
67
|
+
/**
|
|
68
|
+
* Reduces the list of mutations such that each document will have a single mutation. If for example there are multiple
|
|
69
|
+
* updates to the same document, those will be merged and a single update will be returned.
|
|
70
|
+
*/
|
|
71
|
+
export declare function reduceMutations(mutations: Array<Mutation<unknown>>): Array<Mutation<unknown>>;
|
|
72
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare class NamedQueryContext {
|
|
2
|
-
readonly params: Record<string, any>;
|
|
3
|
-
constructor(params: Record<string, any>);
|
|
4
|
-
}
|
|
1
|
+
export declare class NamedQueryContext {
|
|
2
|
+
readonly params: Record<string, any>;
|
|
3
|
+
constructor(params: Record<string, any>);
|
|
4
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { JSONSchemaType } from 'ajv';
|
|
2
|
-
import { ExecuteNamedQueryRequest } from './named-query.types';
|
|
3
|
-
export declare const ExecuteNamedQueryRequestSchema: JSONSchemaType<ExecuteNamedQueryRequest>;
|
|
1
|
+
import { JSONSchemaType } from 'ajv';
|
|
2
|
+
import { ExecuteNamedQueryRequest } from './named-query.types';
|
|
3
|
+
export declare const ExecuteNamedQueryRequestSchema: JSONSchemaType<ExecuteNamedQueryRequest>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ClientId, ClientRequestId, IntegrationId } from './communication.types';
|
|
2
|
-
import { QueryName } from './application.types';
|
|
3
|
-
export interface ExecuteNamedQueryRequest {
|
|
4
|
-
integrationId: IntegrationId;
|
|
5
|
-
queryName: QueryName;
|
|
6
|
-
paramsRecordStr: string;
|
|
7
|
-
clientRequestId: ClientRequestId;
|
|
8
|
-
clientId: ClientId;
|
|
9
|
-
}
|
|
1
|
+
import { ClientId, ClientRequestId, IntegrationId } from './communication.types';
|
|
2
|
+
import { QueryName } from './application.types';
|
|
3
|
+
export interface ExecuteNamedQueryRequest {
|
|
4
|
+
integrationId: IntegrationId;
|
|
5
|
+
queryName: QueryName;
|
|
6
|
+
paramsRecordStr: string;
|
|
7
|
+
clientRequestId: ClientRequestId;
|
|
8
|
+
clientId: ClientId;
|
|
9
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './query-context';
|
|
2
|
-
export * from './simple-query-builder';
|
|
1
|
+
export * from './query-context';
|
|
2
|
+
export * from './simple-query-builder';
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { IntegrationId } from '../communication.types';
|
|
2
|
-
import { CollectionName, FieldName } from '../document.types';
|
|
3
|
-
import { AllOperators, ContextCondition, ContextConditions, FieldSort, GeneralCondition, GeneralConditions, GenericValue, Query } from '../query.types';
|
|
4
|
-
import { Paths } from '../types';
|
|
5
|
-
export declare class QueryContext<T = any> {
|
|
6
|
-
readonly query: Query<T>;
|
|
7
|
-
private readonly parsedConditions;
|
|
8
|
-
constructor(query: Query<T>);
|
|
9
|
-
get integrationId(): IntegrationId;
|
|
10
|
-
get collectionName(): CollectionName;
|
|
11
|
-
get limit(): number;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
includes<F extends FieldName<T>, O extends AllOperators>(fieldName: F, operator: O, value: GenericValue<T, F, O>): boolean;
|
|
15
|
-
includesCondition(condition: ContextCondition<T>): boolean;
|
|
16
|
-
includesConditions(conditions: GeneralConditions<T>): boolean;
|
|
17
|
-
matchesConditions(conditions: GeneralConditions<T>): boolean;
|
|
18
|
-
matchesQuery(query: Query<T>): boolean;
|
|
19
|
-
isSubsetOf<F extends FieldName<T>, O extends AllOperators>(fieldName: F, operator: O, value: GenericValue<T, F, O> | null): boolean;
|
|
20
|
-
isSubsetOfCondition(condition: GeneralCondition<T>): boolean;
|
|
21
|
-
isSubsetOfConditions(conditions: GeneralConditions<T>): boolean;
|
|
22
|
-
isSubsetOfQuery(query: Query<T>): boolean;
|
|
23
|
-
getConditionsFor<K extends FieldName<T>>(...fieldNames: K[]): ContextConditions<T, K>;
|
|
24
|
-
getConditionsForField<K extends Paths<T>>(fieldName: K): ContextConditions<T>;
|
|
25
|
-
/**
|
|
26
|
-
* Compares a condition against a given operator and value to determine if the
|
|
27
|
-
* provided condition is a subset of the operator and value. A condition is
|
|
28
|
-
* considered a subset if all values that satisfy (return true for) the
|
|
29
|
-
* condition also satisfy the operator and value.
|
|
30
|
-
*
|
|
31
|
-
* This is done using the underlying CompareTable, which provides a comparison
|
|
32
|
-
* function for each operator pair, or undefined if the comparison would
|
|
33
|
-
* always be false, regardless of the values.
|
|
34
|
-
*/
|
|
35
|
-
private evaluateSubset;
|
|
36
|
-
private evaluateIncludes;
|
|
37
|
-
private parseConditions;
|
|
38
|
-
}
|
|
1
|
+
import { IntegrationId } from '../communication.types';
|
|
2
|
+
import { CollectionName, FieldName } from '../document.types';
|
|
3
|
+
import { AllOperators, ContextCondition, ContextConditions, FieldSort, GeneralCondition, GeneralConditions, GenericValue, Query } from '../query.types';
|
|
4
|
+
import { PartialBy, Paths } from '../types';
|
|
5
|
+
export declare class QueryContext<T = any> {
|
|
6
|
+
readonly query: Query<T>;
|
|
7
|
+
private readonly parsedConditions;
|
|
8
|
+
constructor(query: Query<T>);
|
|
9
|
+
get integrationId(): IntegrationId;
|
|
10
|
+
get collectionName(): CollectionName;
|
|
11
|
+
get limit(): number;
|
|
12
|
+
sortedBy(sorts: Array<PartialBy<FieldSort<T>, 'asc'>>): boolean;
|
|
13
|
+
sortedByExact(sorts: Array<PartialBy<FieldSort<T>, 'asc'>>): boolean;
|
|
14
|
+
includes<F extends FieldName<T>, O extends AllOperators>(fieldName: F, operator: O, value: GenericValue<T, F, O>): boolean;
|
|
15
|
+
includesCondition(condition: ContextCondition<T>): boolean;
|
|
16
|
+
includesConditions(conditions: GeneralConditions<T>): boolean;
|
|
17
|
+
matchesConditions(conditions: GeneralConditions<T>): boolean;
|
|
18
|
+
matchesQuery(query: Query<T>): boolean;
|
|
19
|
+
isSubsetOf<F extends FieldName<T>, O extends AllOperators>(fieldName: F, operator: O, value: GenericValue<T, F, O> | null): boolean;
|
|
20
|
+
isSubsetOfCondition(condition: GeneralCondition<T>): boolean;
|
|
21
|
+
isSubsetOfConditions(conditions: GeneralConditions<T>): boolean;
|
|
22
|
+
isSubsetOfQuery(query: Query<T>): boolean;
|
|
23
|
+
getConditionsFor<K extends FieldName<T>>(...fieldNames: K[]): ContextConditions<T, K>;
|
|
24
|
+
getConditionsForField<K extends Paths<T>>(fieldName: K): ContextConditions<T>;
|
|
25
|
+
/**
|
|
26
|
+
* Compares a condition against a given operator and value to determine if the
|
|
27
|
+
* provided condition is a subset of the operator and value. A condition is
|
|
28
|
+
* considered a subset if all values that satisfy (return true for) the
|
|
29
|
+
* condition also satisfy the operator and value.
|
|
30
|
+
*
|
|
31
|
+
* This is done using the underlying CompareTable, which provides a comparison
|
|
32
|
+
* function for each operator pair, or undefined if the comparison would
|
|
33
|
+
* always be false, regardless of the values.
|
|
34
|
+
*/
|
|
35
|
+
private evaluateSubset;
|
|
36
|
+
private evaluateIncludes;
|
|
37
|
+
private parseConditions;
|
|
38
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { IntegrationId } from '../communication.types';
|
|
2
|
-
import { CollectionName, DocumentData, FieldName, PrimitiveFieldType } from '../document.types';
|
|
3
|
-
import { Operator, Query } from '../query.types';
|
|
4
|
-
export declare class SimpleQueryBuilder<MyDocType extends DocumentData> {
|
|
5
|
-
protected readonly collectionName: CollectionName;
|
|
6
|
-
protected readonly integrationId: IntegrationId;
|
|
7
|
-
protected readonly query: Query<MyDocType>;
|
|
8
|
-
constructor(collectionName: CollectionName, integrationId: IntegrationId);
|
|
9
|
-
where(fieldName: (keyof MyDocType & FieldName) | string, operator: Operator | 'in' | 'not in', value: PrimitiveFieldType | Array<PrimitiveFieldType>): this;
|
|
10
|
-
limit(limit: number): this;
|
|
11
|
-
sortBy(fieldName: keyof MyDocType & FieldName, asc?: boolean): this;
|
|
12
|
-
build(): Query;
|
|
13
|
-
private mergeConditions;
|
|
14
|
-
}
|
|
1
|
+
import { IntegrationId } from '../communication.types';
|
|
2
|
+
import { CollectionName, DocumentData, FieldName, PrimitiveFieldType } from '../document.types';
|
|
3
|
+
import { Operator, Query } from '../query.types';
|
|
4
|
+
export declare class SimpleQueryBuilder<MyDocType extends DocumentData> {
|
|
5
|
+
protected readonly collectionName: CollectionName;
|
|
6
|
+
protected readonly integrationId: IntegrationId;
|
|
7
|
+
protected readonly query: Query<MyDocType>;
|
|
8
|
+
constructor(collectionName: CollectionName, integrationId: IntegrationId);
|
|
9
|
+
where(fieldName: (keyof MyDocType & FieldName) | string, operator: Operator | 'in' | 'not in', value: PrimitiveFieldType | Array<PrimitiveFieldType>): this;
|
|
10
|
+
limit(limit: number): this;
|
|
11
|
+
sortBy(fieldName: keyof MyDocType & FieldName, asc?: boolean): this;
|
|
12
|
+
build(): Query;
|
|
13
|
+
private mergeConditions;
|
|
14
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { JSONSchemaType } from 'ajv';
|
|
2
|
-
import { Query, QueryRequest, QueryUnsubscribeRequest } from './query.types';
|
|
3
|
-
export declare const QuerySchema: JSONSchemaType<Query>;
|
|
4
|
-
export declare const QueryRequestSchema: JSONSchemaType<QueryRequest>;
|
|
5
|
-
export declare const QueryUnsubscribeRequestSchema: JSONSchemaType<QueryUnsubscribeRequest>;
|
|
1
|
+
import { JSONSchemaType } from 'ajv';
|
|
2
|
+
import { Query, QueryRequest, QueryUnsubscribeRequest } from './query.types';
|
|
3
|
+
export declare const QuerySchema: JSONSchemaType<Query>;
|
|
4
|
+
export declare const QueryRequestSchema: JSONSchemaType<QueryRequest>;
|
|
5
|
+
export declare const QueryUnsubscribeRequestSchema: JSONSchemaType<QueryUnsubscribeRequest>;
|