@squidcloud/local-backend 1.0.62 → 1.0.64
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 +13 -13
- package/dist/common/src/ai-assistant.context.js +19 -19
- package/dist/common/src/ai-assistant.schemas.d.ts +243 -243
- package/dist/common/src/ai-assistant.schemas.js +210 -210
- package/dist/common/src/ai-assistant.types.d.ts +90 -90
- package/dist/common/src/ai-assistant.types.js +11 -11
- package/dist/common/src/api-call.context.d.ts +13 -13
- package/dist/common/src/api-call.context.js +16 -16
- package/dist/common/src/api.types.d.ts +23 -23
- package/dist/common/src/api.types.js +2 -2
- package/dist/common/src/application.schemas.d.ts +1312 -1312
- package/dist/common/src/application.schemas.js +860 -860
- package/dist/common/src/application.types.d.ts +186 -186
- package/dist/common/src/application.types.js +89 -89
- package/dist/common/src/backend-function.schemas.d.ts +3 -3
- package/dist/common/src/backend-function.schemas.js +12 -12
- package/dist/common/src/backend-function.types.d.ts +6 -6
- package/dist/common/src/backend-function.types.js +2 -2
- package/dist/common/src/backend-run.types.d.ts +54 -54
- package/dist/common/src/backend-run.types.js +96 -96
- package/dist/common/src/bundle-api.types.d.ts +63 -63
- package/dist/common/src/bundle-api.types.js +2 -2
- package/dist/common/src/bundle-data.types.d.ts +59 -59
- package/dist/common/src/bundle-data.types.js +2 -2
- package/dist/common/src/communication.types.d.ts +18 -18
- package/dist/common/src/communication.types.js +40 -40
- package/dist/common/src/context.types.d.ts +24 -24
- package/dist/common/src/context.types.js +2 -2
- package/dist/common/src/distributed-lock.context.d.ts +5 -5
- package/dist/common/src/distributed-lock.context.js +10 -10
- package/dist/common/src/document.types.d.ts +32 -32
- package/dist/common/src/document.types.js +50 -50
- package/dist/common/src/graphql.context.d.ts +14 -14
- package/dist/common/src/graphql.context.js +12 -12
- package/dist/common/src/graphql.types.d.ts +11 -11
- package/dist/common/src/graphql.types.js +34 -34
- package/dist/common/src/heartbeat.types.d.ts +4 -4
- package/dist/common/src/heartbeat.types.js +16 -16
- package/dist/common/src/http-status.enum.d.ts +50 -50
- package/dist/common/src/http-status.enum.js +54 -54
- package/dist/common/src/index.d.ts +55 -53
- package/dist/common/src/index.js +71 -69
- package/dist/common/src/index.js.map +1 -1
- package/dist/common/src/integrations/ai_assistant.types.d.ts +24 -24
- package/dist/common/src/integrations/ai_assistant.types.js +2 -2
- package/dist/common/src/integrations/api.types.d.ts +80 -80
- package/dist/common/src/integrations/api.types.js +2 -2
- package/dist/common/src/integrations/auth.types.d.ts +39 -39
- package/dist/common/src/integrations/auth.types.js +2 -2
- package/dist/common/src/integrations/database.types.d.ts +231 -231
- package/dist/common/src/integrations/database.types.js +2 -2
- package/dist/common/src/integrations/index.d.ts +124 -124
- package/dist/common/src/integrations/index.js +111 -111
- package/dist/common/src/integrations/observability.types.d.ts +23 -23
- package/dist/common/src/integrations/observability.types.js +23 -23
- package/dist/common/src/logger.types.d.ts +21 -21
- package/dist/common/src/logger.types.js +11 -11
- package/dist/common/src/metrics.types.d.ts +73 -73
- package/dist/common/src/metrics.types.js +11 -11
- package/dist/common/src/mutation.context.d.ts +13 -13
- package/dist/common/src/mutation.context.js +26 -26
- package/dist/common/src/mutation.schemas.d.ts +5 -5
- package/dist/common/src/mutation.schemas.js +114 -114
- package/dist/common/src/mutation.types.d.ts +63 -63
- package/dist/common/src/mutation.types.js +142 -142
- package/dist/common/src/named-query.context.d.ts +4 -4
- package/dist/common/src/named-query.context.js +9 -9
- package/dist/common/src/named-query.schemas.d.ts +3 -3
- package/dist/common/src/named-query.schemas.js +13 -13
- package/dist/common/src/named-query.types.d.ts +8 -8
- package/dist/common/src/named-query.types.js +2 -2
- package/dist/common/src/query/base-query-builder.d.ts +37 -37
- package/dist/common/src/query/base-query-builder.js +36 -36
- package/dist/common/src/query/index.d.ts +4 -4
- package/dist/common/src/query/index.js +20 -20
- package/dist/common/src/query/pagination.d.ts +42 -42
- package/dist/common/src/query/pagination.js +164 -164
- package/dist/common/src/query/query-context.d.ts +47 -47
- package/dist/common/src/query/query-context.js +159 -159
- package/dist/common/src/query/serialized-query.types.d.ts +24 -24
- package/dist/common/src/query/serialized-query.types.js +2 -2
- package/dist/common/src/query.types.d.ts +86 -86
- package/dist/common/src/query.types.js +153 -153
- package/dist/common/src/regions.d.ts +21 -21
- package/dist/common/src/regions.js +46 -46
- package/dist/common/src/schema/schema.types.d.ts +30 -30
- package/dist/common/src/schema/schema.types.js +172 -172
- package/dist/common/src/secret.schemas.d.ts +6 -6
- package/dist/common/src/secret.schemas.js +32 -32
- package/dist/common/src/secret.types.d.ts +49 -49
- package/dist/common/src/secret.types.js +5 -5
- package/dist/common/src/security.types.d.ts +3 -3
- package/dist/common/src/security.types.js +2 -2
- package/dist/common/src/socket.schemas.d.ts +3 -3
- package/dist/common/src/socket.schemas.js +58 -58
- package/dist/common/src/socket.types.d.ts +112 -108
- package/dist/common/src/socket.types.js +2 -2
- package/dist/common/src/time-units.d.ts +5 -5
- package/dist/common/src/time-units.js +8 -8
- package/dist/common/src/trigger.types.d.ts +15 -15
- package/dist/common/src/trigger.types.js +2 -2
- package/dist/common/src/types.d.ts +21 -21
- package/dist/common/src/types.js +2 -2
- package/dist/common/src/utils/array.d.ts +8 -8
- package/dist/common/src/utils/array.js +54 -54
- package/dist/common/src/utils/assert.d.ts +8 -8
- package/dist/common/src/utils/assert.js +49 -49
- package/dist/common/src/utils/error.d.ts +4 -4
- package/dist/common/src/utils/error.js +10 -10
- package/dist/common/src/utils/global.utils.d.ts +10 -0
- package/dist/common/src/utils/global.utils.js +47 -0
- package/dist/common/src/utils/global.utils.js.map +1 -0
- package/dist/common/src/utils/http.d.ts +2 -2
- package/dist/common/src/utils/http.js +40 -40
- package/dist/common/src/utils/http.js.map +1 -1
- package/dist/common/src/utils/id.d.ts +2 -2
- package/dist/common/src/utils/id.js +21 -21
- package/dist/common/src/utils/lock.manager.d.ts +9 -9
- package/dist/common/src/utils/lock.manager.js +39 -39
- package/dist/common/src/utils/nullish.d.ts +2 -2
- package/dist/common/src/utils/nullish.js +11 -11
- package/dist/common/src/utils/object.d.ts +5 -5
- package/dist/common/src/utils/object.js +75 -75
- package/dist/common/src/utils/serialization.d.ts +6 -6
- package/dist/common/src/utils/serialization.js +77 -77
- package/dist/common/src/utils/transforms.d.ts +18 -18
- package/dist/common/src/utils/transforms.js +92 -92
- package/dist/common/src/utils/url.d.ts +1 -1
- package/dist/common/src/utils/url.js +15 -15
- package/dist/common/src/utils/validation.d.ts +17 -17
- package/dist/common/src/utils/validation.js +209 -209
- package/dist/common/src/webhook-response.d.ts +6 -6
- package/dist/common/src/webhook-response.js +2 -2
- package/dist/common/src/websocket.impl.d.ts +21 -0
- package/dist/common/src/websocket.impl.js +75 -0
- package/dist/common/src/websocket.impl.js.map +1 -0
- package/dist/internal-common/src/async-queue.d.ts +4 -4
- package/dist/internal-common/src/async-queue.js +17 -17
- package/dist/internal-common/src/code-executor.types.d.ts +13 -13
- package/dist/internal-common/src/code-executor.types.js +2 -2
- package/dist/internal-common/src/dao.types.d.ts +46 -46
- package/dist/internal-common/src/dao.types.js +2 -2
- package/dist/internal-common/src/environment/environment.types.d.ts +74 -74
- package/dist/internal-common/src/environment/environment.types.js +2 -2
- package/dist/internal-common/src/environment/index.d.ts +6 -6
- package/dist/internal-common/src/environment/index.js +27 -27
- package/dist/internal-common/src/environment/local.environment.d.ts +2 -2
- package/dist/internal-common/src/environment/local.environment.js +62 -62
- package/dist/internal-common/src/filters/custom-exception.filter.d.ts +6 -6
- package/dist/internal-common/src/filters/custom-exception.filter.js +44 -44
- package/dist/internal-common/src/index.d.ts +14 -14
- package/dist/internal-common/src/index.js +32 -32
- package/dist/internal-common/src/interceptors/body.interceptor.d.ts +5 -5
- package/dist/internal-common/src/interceptors/body.interceptor.js +24 -24
- package/dist/internal-common/src/kafka/kafka.manager.d.ts +22 -22
- package/dist/internal-common/src/kafka/kafka.manager.js +129 -129
- package/dist/internal-common/src/kafka/kafka.types.d.ts +17 -17
- package/dist/internal-common/src/kafka/kafka.types.js +2 -2
- package/dist/internal-common/src/kafka-observability-publisher.d.ts +11 -11
- package/dist/internal-common/src/kafka-observability-publisher.js +20 -20
- package/dist/internal-common/src/local-dev.types.d.ts +35 -31
- package/dist/internal-common/src/local-dev.types.js +2 -2
- package/dist/internal-common/src/observability-publisher.d.ts +9 -9
- package/dist/internal-common/src/observability-publisher.js +58 -58
- package/dist/internal-common/src/observability.types.d.ts +17 -17
- package/dist/internal-common/src/observability.types.js +2 -2
- package/dist/internal-common/src/shutdown.manager.d.ts +20 -20
- package/dist/internal-common/src/shutdown.manager.js +75 -75
- package/dist/internal-common/src/utils.d.ts +5 -5
- package/dist/internal-common/src/utils.js +29 -29
- package/dist/local-backend/src/index.d.ts +4 -4
- package/dist/local-backend/src/index.js +20 -20
- package/dist/local-backend/src/local-backend-socket.service.d.ts +19 -18
- package/dist/local-backend/src/local-backend-socket.service.js +110 -107
- package/dist/local-backend/src/local-backend-socket.service.js.map +1 -1
- package/dist/local-backend/src/local-backend.app.d.ts +2 -2
- package/dist/local-backend/src/local-backend.app.js +19 -19
- package/dist/local-backend/src/local-backend.controller.d.ts +8 -8
- package/dist/local-backend/src/local-backend.controller.js +49 -49
- package/dist/local-backend/src/local-backend.module.d.ts +8 -8
- package/dist/local-backend/src/local-backend.module.js +53 -53
- package/dist/local-backend/src/local-backend.service.d.ts +15 -15
- package/dist/local-backend/src/local-backend.service.js +165 -165
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
export type MetricType = 'count' | 'gauge';
|
|
2
|
-
export type AggregationPeriod = '1m' | '5m' | '15m' | '1h' | '1d' | '1w';
|
|
3
|
-
export declare const aggregationPeriodMap: Record<AggregationPeriod, number>;
|
|
4
|
-
export interface SnowflakeCountMetricHistogramData {
|
|
5
|
-
STEPINTERVAL: number;
|
|
6
|
-
SUMINSTEP: number;
|
|
7
|
-
CUMULATIVESUM: number;
|
|
8
|
-
RATE: number;
|
|
9
|
-
}
|
|
10
|
-
export interface CountMetricHistogramData {
|
|
11
|
-
stepInterval: number;
|
|
12
|
-
sumInStep: number;
|
|
13
|
-
cumulativeSum: number;
|
|
14
|
-
rate: number;
|
|
15
|
-
}
|
|
16
|
-
export interface CountMetricSummary {
|
|
17
|
-
cumulativeRate: number;
|
|
18
|
-
cumulativeSum: number;
|
|
19
|
-
}
|
|
20
|
-
export interface SnowflakeGaugeMetricHistogramData {
|
|
21
|
-
STEPINTERVAL: number;
|
|
22
|
-
SUMINSTEP: number;
|
|
23
|
-
COUNTINSTEP: number;
|
|
24
|
-
MININSTEP: number;
|
|
25
|
-
MAXINSTEP: number;
|
|
26
|
-
AVGINSTEP: number;
|
|
27
|
-
MEDIANINSTEP: number;
|
|
28
|
-
}
|
|
29
|
-
export interface GaugeMetricHistogramData {
|
|
30
|
-
stepInterval: number;
|
|
31
|
-
sumInStep: number;
|
|
32
|
-
countInStep: number;
|
|
33
|
-
minInStep: number;
|
|
34
|
-
maxInStep: number;
|
|
35
|
-
avgInStep: number;
|
|
36
|
-
medianInStep: number;
|
|
37
|
-
}
|
|
38
|
-
export interface GaugeMetricSummary {
|
|
39
|
-
cumulativeSum: number;
|
|
40
|
-
cumulativeMin: number;
|
|
41
|
-
cumulativeMax: number;
|
|
42
|
-
cumulativeAvg: number;
|
|
43
|
-
cumulativeCount: number;
|
|
44
|
-
}
|
|
45
|
-
interface BaseMetricResponse {
|
|
46
|
-
type: MetricType;
|
|
47
|
-
}
|
|
48
|
-
export interface CountMetricResponse extends BaseMetricResponse {
|
|
49
|
-
type: 'count';
|
|
50
|
-
histogram: Array<CountMetricHistogramData>;
|
|
51
|
-
summary: CountMetricSummary;
|
|
52
|
-
}
|
|
53
|
-
export interface GaugeMetricResponse extends BaseMetricResponse {
|
|
54
|
-
type: 'gauge';
|
|
55
|
-
histogram: Array<GaugeMetricHistogramData>;
|
|
56
|
-
summary: GaugeMetricSummary;
|
|
57
|
-
}
|
|
58
|
-
export type MetricResponse = CountMetricResponse | GaugeMetricResponse;
|
|
59
|
-
export interface GetSingleMetricRequest {
|
|
60
|
-
metricName: string;
|
|
61
|
-
tagFilters: Record<string, string | Array<string>>;
|
|
62
|
-
metricType: MetricType;
|
|
63
|
-
}
|
|
64
|
-
export interface GetMetricsRequest {
|
|
65
|
-
requests: Array<GetSingleMetricRequest>;
|
|
66
|
-
from: number;
|
|
67
|
-
to: number;
|
|
68
|
-
aggregationPeriod: AggregationPeriod;
|
|
69
|
-
}
|
|
70
|
-
export interface GetMetricsResponse {
|
|
71
|
-
responses: Array<MetricResponse>;
|
|
72
|
-
}
|
|
73
|
-
export {};
|
|
1
|
+
export type MetricType = 'count' | 'gauge';
|
|
2
|
+
export type AggregationPeriod = '1m' | '5m' | '15m' | '1h' | '1d' | '1w';
|
|
3
|
+
export declare const aggregationPeriodMap: Record<AggregationPeriod, number>;
|
|
4
|
+
export interface SnowflakeCountMetricHistogramData {
|
|
5
|
+
STEPINTERVAL: number;
|
|
6
|
+
SUMINSTEP: number;
|
|
7
|
+
CUMULATIVESUM: number;
|
|
8
|
+
RATE: number;
|
|
9
|
+
}
|
|
10
|
+
export interface CountMetricHistogramData {
|
|
11
|
+
stepInterval: number;
|
|
12
|
+
sumInStep: number;
|
|
13
|
+
cumulativeSum: number;
|
|
14
|
+
rate: number;
|
|
15
|
+
}
|
|
16
|
+
export interface CountMetricSummary {
|
|
17
|
+
cumulativeRate: number;
|
|
18
|
+
cumulativeSum: number;
|
|
19
|
+
}
|
|
20
|
+
export interface SnowflakeGaugeMetricHistogramData {
|
|
21
|
+
STEPINTERVAL: number;
|
|
22
|
+
SUMINSTEP: number;
|
|
23
|
+
COUNTINSTEP: number;
|
|
24
|
+
MININSTEP: number;
|
|
25
|
+
MAXINSTEP: number;
|
|
26
|
+
AVGINSTEP: number;
|
|
27
|
+
MEDIANINSTEP: number;
|
|
28
|
+
}
|
|
29
|
+
export interface GaugeMetricHistogramData {
|
|
30
|
+
stepInterval: number;
|
|
31
|
+
sumInStep: number;
|
|
32
|
+
countInStep: number;
|
|
33
|
+
minInStep: number;
|
|
34
|
+
maxInStep: number;
|
|
35
|
+
avgInStep: number;
|
|
36
|
+
medianInStep: number;
|
|
37
|
+
}
|
|
38
|
+
export interface GaugeMetricSummary {
|
|
39
|
+
cumulativeSum: number;
|
|
40
|
+
cumulativeMin: number;
|
|
41
|
+
cumulativeMax: number;
|
|
42
|
+
cumulativeAvg: number;
|
|
43
|
+
cumulativeCount: number;
|
|
44
|
+
}
|
|
45
|
+
interface BaseMetricResponse {
|
|
46
|
+
type: MetricType;
|
|
47
|
+
}
|
|
48
|
+
export interface CountMetricResponse extends BaseMetricResponse {
|
|
49
|
+
type: 'count';
|
|
50
|
+
histogram: Array<CountMetricHistogramData>;
|
|
51
|
+
summary: CountMetricSummary;
|
|
52
|
+
}
|
|
53
|
+
export interface GaugeMetricResponse extends BaseMetricResponse {
|
|
54
|
+
type: 'gauge';
|
|
55
|
+
histogram: Array<GaugeMetricHistogramData>;
|
|
56
|
+
summary: GaugeMetricSummary;
|
|
57
|
+
}
|
|
58
|
+
export type MetricResponse = CountMetricResponse | GaugeMetricResponse;
|
|
59
|
+
export interface GetSingleMetricRequest {
|
|
60
|
+
metricName: string;
|
|
61
|
+
tagFilters: Record<string, string | Array<string>>;
|
|
62
|
+
metricType: MetricType;
|
|
63
|
+
}
|
|
64
|
+
export interface GetMetricsRequest {
|
|
65
|
+
requests: Array<GetSingleMetricRequest>;
|
|
66
|
+
from: number;
|
|
67
|
+
to: number;
|
|
68
|
+
aggregationPeriod: AggregationPeriod;
|
|
69
|
+
}
|
|
70
|
+
export interface GetMetricsResponse {
|
|
71
|
+
responses: Array<MetricResponse>;
|
|
72
|
+
}
|
|
73
|
+
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.aggregationPeriodMap = void 0;
|
|
4
|
-
exports.aggregationPeriodMap = {
|
|
5
|
-
'1m': 1,
|
|
6
|
-
'5m': 5,
|
|
7
|
-
'15m': 15,
|
|
8
|
-
'1h': 60,
|
|
9
|
-
'1d': 1440,
|
|
10
|
-
'1w': 10080,
|
|
11
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.aggregationPeriodMap = void 0;
|
|
4
|
+
exports.aggregationPeriodMap = {
|
|
5
|
+
'1m': 1,
|
|
6
|
+
'5m': 5,
|
|
7
|
+
'15m': 15,
|
|
8
|
+
'1h': 60,
|
|
9
|
+
'1d': 1440,
|
|
10
|
+
'1w': 10080,
|
|
11
|
+
};
|
|
12
12
|
//# sourceMappingURL=metrics.types.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { BeforeAndAfterDocs } from './document.types';
|
|
2
|
-
import { Mutation, MutationType } from './mutation.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
|
-
get before(): T | undefined;
|
|
11
|
-
get after(): T | undefined;
|
|
12
|
-
affectsPath(path: Paths<T>): boolean;
|
|
13
|
-
}
|
|
1
|
+
import { BeforeAndAfterDocs } from './document.types';
|
|
2
|
+
import { Mutation, MutationType } from './mutation.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
|
+
get before(): T | undefined;
|
|
11
|
+
get after(): T | undefined;
|
|
12
|
+
affectsPath(path: Paths<T>): boolean;
|
|
13
|
+
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MutationContext = void 0;
|
|
4
|
-
const _ = require("lodash");
|
|
5
|
-
class MutationContext {
|
|
6
|
-
constructor(mutation, beforeAndAfterDocs, serverTimeStamp) {
|
|
7
|
-
this.mutation = mutation;
|
|
8
|
-
this.beforeAndAfterDocs = beforeAndAfterDocs;
|
|
9
|
-
this.serverTimeStamp = serverTimeStamp;
|
|
10
|
-
}
|
|
11
|
-
getMutationType() {
|
|
12
|
-
return this.mutation.type;
|
|
13
|
-
}
|
|
14
|
-
get before() {
|
|
15
|
-
return this.beforeAndAfterDocs.before;
|
|
16
|
-
}
|
|
17
|
-
get after() {
|
|
18
|
-
return this.beforeAndAfterDocs.after;
|
|
19
|
-
}
|
|
20
|
-
affectsPath(path) {
|
|
21
|
-
const before = this.before ? _.get(this.before, path) : undefined;
|
|
22
|
-
const after = this.after ? _.get(this.after, path) : undefined;
|
|
23
|
-
return !_.isEqual(before, after);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.MutationContext = MutationContext;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MutationContext = void 0;
|
|
4
|
+
const _ = require("lodash");
|
|
5
|
+
class MutationContext {
|
|
6
|
+
constructor(mutation, beforeAndAfterDocs, serverTimeStamp) {
|
|
7
|
+
this.mutation = mutation;
|
|
8
|
+
this.beforeAndAfterDocs = beforeAndAfterDocs;
|
|
9
|
+
this.serverTimeStamp = serverTimeStamp;
|
|
10
|
+
}
|
|
11
|
+
getMutationType() {
|
|
12
|
+
return this.mutation.type;
|
|
13
|
+
}
|
|
14
|
+
get before() {
|
|
15
|
+
return this.beforeAndAfterDocs.before;
|
|
16
|
+
}
|
|
17
|
+
get after() {
|
|
18
|
+
return this.beforeAndAfterDocs.after;
|
|
19
|
+
}
|
|
20
|
+
affectsPath(path) {
|
|
21
|
+
const before = this.before ? _.get(this.before, path) : undefined;
|
|
22
|
+
const after = this.after ? _.get(this.after, path) : undefined;
|
|
23
|
+
return !_.isEqual(before, after);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.MutationContext = MutationContext;
|
|
27
27
|
//# sourceMappingURL=mutation.context.js.map
|
|
@@ -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,115 +1,115 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MutationRequestSchema = void 0;
|
|
4
|
-
const Anything = {};
|
|
5
|
-
const AnyString = {
|
|
6
|
-
type: 'string',
|
|
7
|
-
};
|
|
8
|
-
const DocumentSchema = {
|
|
9
|
-
type: 'object',
|
|
10
|
-
};
|
|
11
|
-
const DocIdSchema = {
|
|
12
|
-
type: 'object',
|
|
13
|
-
required: ['docId', 'integrationId', 'collectionName'],
|
|
14
|
-
properties: {
|
|
15
|
-
docId: AnyString,
|
|
16
|
-
integrationId: AnyString,
|
|
17
|
-
collectionName: AnyString,
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
const InsertSchema = {
|
|
21
|
-
type: 'object',
|
|
22
|
-
required: ['type', 'properties', 'squidDocIdObj'],
|
|
23
|
-
properties: {
|
|
24
|
-
type: { type: 'string', const: 'insert' },
|
|
25
|
-
properties: DocumentSchema,
|
|
26
|
-
squidDocIdObj: DocIdSchema,
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
const DeleteSchema = {
|
|
30
|
-
type: 'object',
|
|
31
|
-
required: ['type', 'squidDocIdObj'],
|
|
32
|
-
properties: {
|
|
33
|
-
type: { type: 'string', const: 'delete' },
|
|
34
|
-
squidDocIdObj: DocIdSchema,
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
const ValueUpdateProperties = {
|
|
38
|
-
type: { type: 'string', const: 'update' },
|
|
39
|
-
value: Anything,
|
|
40
|
-
};
|
|
41
|
-
const PropertyMutationSchema = {
|
|
42
|
-
oneOf: [
|
|
43
|
-
{
|
|
44
|
-
type: 'object',
|
|
45
|
-
required: ['type', 'fn', 'value'],
|
|
46
|
-
properties: {
|
|
47
|
-
type: { type: 'string', const: 'applyNumericFn' },
|
|
48
|
-
fn: { type: 'string', const: 'increment' },
|
|
49
|
-
value: { type: 'number' },
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
type: 'object',
|
|
54
|
-
required: ['type'],
|
|
55
|
-
properties: {
|
|
56
|
-
type: { type: 'string', const: 'removeProperty' },
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
type: 'object',
|
|
61
|
-
required: ['type', 'value'],
|
|
62
|
-
properties: ValueUpdateProperties,
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
type: 'object',
|
|
66
|
-
required: ['type', 'fn', 'value'],
|
|
67
|
-
properties: {
|
|
68
|
-
type: { type: 'string', const: 'applyStringFn' },
|
|
69
|
-
fn: { type: 'string', const: 'extendString' },
|
|
70
|
-
value: AnyString,
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
type: 'object',
|
|
75
|
-
required: ['type', 'fn'],
|
|
76
|
-
properties: {
|
|
77
|
-
type: { type: 'string', const: 'applyStringFn' },
|
|
78
|
-
fn: { type: 'string', const: 'trim' },
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
],
|
|
82
|
-
};
|
|
83
|
-
const UpdateSchema = {
|
|
84
|
-
type: 'object',
|
|
85
|
-
required: [],
|
|
86
|
-
properties: {
|
|
87
|
-
type: { type: 'string', const: 'update' },
|
|
88
|
-
squidDocIdObj: DocIdSchema,
|
|
89
|
-
properties: {
|
|
90
|
-
type: 'object',
|
|
91
|
-
patternProperties: {
|
|
92
|
-
'[0-9a-zA-Z\\$_\\-\\.]+': {
|
|
93
|
-
type: 'array',
|
|
94
|
-
minItems: 1,
|
|
95
|
-
items: PropertyMutationSchema,
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
};
|
|
101
|
-
const MutationSchema = {
|
|
102
|
-
oneOf: [InsertSchema, DeleteSchema, UpdateSchema],
|
|
103
|
-
};
|
|
104
|
-
exports.MutationRequestSchema = {
|
|
105
|
-
type: 'object',
|
|
106
|
-
required: ['integrationId', 'mutations'],
|
|
107
|
-
properties: {
|
|
108
|
-
integrationId: AnyString,
|
|
109
|
-
mutations: {
|
|
110
|
-
type: 'array',
|
|
111
|
-
items: MutationSchema,
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MutationRequestSchema = void 0;
|
|
4
|
+
const Anything = {};
|
|
5
|
+
const AnyString = {
|
|
6
|
+
type: 'string',
|
|
7
|
+
};
|
|
8
|
+
const DocumentSchema = {
|
|
9
|
+
type: 'object',
|
|
10
|
+
};
|
|
11
|
+
const DocIdSchema = {
|
|
12
|
+
type: 'object',
|
|
13
|
+
required: ['docId', 'integrationId', 'collectionName'],
|
|
14
|
+
properties: {
|
|
15
|
+
docId: AnyString,
|
|
16
|
+
integrationId: AnyString,
|
|
17
|
+
collectionName: AnyString,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
const InsertSchema = {
|
|
21
|
+
type: 'object',
|
|
22
|
+
required: ['type', 'properties', 'squidDocIdObj'],
|
|
23
|
+
properties: {
|
|
24
|
+
type: { type: 'string', const: 'insert' },
|
|
25
|
+
properties: DocumentSchema,
|
|
26
|
+
squidDocIdObj: DocIdSchema,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
const DeleteSchema = {
|
|
30
|
+
type: 'object',
|
|
31
|
+
required: ['type', 'squidDocIdObj'],
|
|
32
|
+
properties: {
|
|
33
|
+
type: { type: 'string', const: 'delete' },
|
|
34
|
+
squidDocIdObj: DocIdSchema,
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
const ValueUpdateProperties = {
|
|
38
|
+
type: { type: 'string', const: 'update' },
|
|
39
|
+
value: Anything,
|
|
40
|
+
};
|
|
41
|
+
const PropertyMutationSchema = {
|
|
42
|
+
oneOf: [
|
|
43
|
+
{
|
|
44
|
+
type: 'object',
|
|
45
|
+
required: ['type', 'fn', 'value'],
|
|
46
|
+
properties: {
|
|
47
|
+
type: { type: 'string', const: 'applyNumericFn' },
|
|
48
|
+
fn: { type: 'string', const: 'increment' },
|
|
49
|
+
value: { type: 'number' },
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
type: 'object',
|
|
54
|
+
required: ['type'],
|
|
55
|
+
properties: {
|
|
56
|
+
type: { type: 'string', const: 'removeProperty' },
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
type: 'object',
|
|
61
|
+
required: ['type', 'value'],
|
|
62
|
+
properties: ValueUpdateProperties,
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
type: 'object',
|
|
66
|
+
required: ['type', 'fn', 'value'],
|
|
67
|
+
properties: {
|
|
68
|
+
type: { type: 'string', const: 'applyStringFn' },
|
|
69
|
+
fn: { type: 'string', const: 'extendString' },
|
|
70
|
+
value: AnyString,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
type: 'object',
|
|
75
|
+
required: ['type', 'fn'],
|
|
76
|
+
properties: {
|
|
77
|
+
type: { type: 'string', const: 'applyStringFn' },
|
|
78
|
+
fn: { type: 'string', const: 'trim' },
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
};
|
|
83
|
+
const UpdateSchema = {
|
|
84
|
+
type: 'object',
|
|
85
|
+
required: [],
|
|
86
|
+
properties: {
|
|
87
|
+
type: { type: 'string', const: 'update' },
|
|
88
|
+
squidDocIdObj: DocIdSchema,
|
|
89
|
+
properties: {
|
|
90
|
+
type: 'object',
|
|
91
|
+
patternProperties: {
|
|
92
|
+
'[0-9a-zA-Z\\$_\\-\\.]+': {
|
|
93
|
+
type: 'array',
|
|
94
|
+
minItems: 1,
|
|
95
|
+
items: PropertyMutationSchema,
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
const MutationSchema = {
|
|
102
|
+
oneOf: [InsertSchema, DeleteSchema, UpdateSchema],
|
|
103
|
+
};
|
|
104
|
+
exports.MutationRequestSchema = {
|
|
105
|
+
type: 'object',
|
|
106
|
+
required: ['integrationId', 'mutations'],
|
|
107
|
+
properties: {
|
|
108
|
+
integrationId: AnyString,
|
|
109
|
+
mutations: {
|
|
110
|
+
type: 'array',
|
|
111
|
+
items: MutationSchema,
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
115
|
//# sourceMappingURL=mutation.schemas.js.map
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import { IntegrationId } from './communication.types';
|
|
2
|
-
import { DocTimestamp, FieldName, SquidDocId, SquidDocIdObj, SquidDocument } from './document.types';
|
|
3
|
-
export interface MutateRequest<T = any> {
|
|
4
|
-
integrationId: IntegrationId;
|
|
5
|
-
mutations: Array<Mutation<T>>;
|
|
6
|
-
}
|
|
7
|
-
export interface ExecuteMutationsResponse {
|
|
8
|
-
timestamp: DocTimestamp;
|
|
9
|
-
idResolutionMap?: IdResolutionMap;
|
|
10
|
-
afterDocs: Record<SquidDocId, SquidDocument>;
|
|
11
|
-
}
|
|
12
|
-
export interface MutateResponse extends Omit<ExecuteMutationsResponse, 'afterDocs'> {
|
|
13
|
-
refreshList: Array<SquidDocId>;
|
|
14
|
-
}
|
|
15
|
-
export type IdResolutionMap = Record<SquidDocId, SquidDocId>;
|
|
16
|
-
export type Mutation<T = any> = UpdateMutation<T> | InsertMutation<T> | DeleteMutation;
|
|
17
|
-
export type MutationType = 'insert' | 'update' | 'delete';
|
|
18
|
-
interface BaseMutation {
|
|
19
|
-
type: MutationType;
|
|
20
|
-
squidDocIdObj: SquidDocIdObj;
|
|
21
|
-
}
|
|
22
|
-
export interface DeleteMutation extends BaseMutation {
|
|
23
|
-
type: 'delete';
|
|
24
|
-
}
|
|
25
|
-
export interface UpdateMutation<T = any> extends BaseMutation {
|
|
26
|
-
type: 'update';
|
|
27
|
-
properties: {
|
|
28
|
-
[key in keyof T & string]?: Array<PropertyMutation<T[key]>>;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
export interface InsertMutation<T = any> extends BaseMutation {
|
|
32
|
-
type: 'insert';
|
|
33
|
-
properties: T;
|
|
34
|
-
}
|
|
35
|
-
export type PropertyMutation<Value = any> = ApplyNumericFnPropertyMutation | ApplyStringFnPropertyMutation | ValueUpdatePropertyMutation<Value> | RemovePropertyMutation;
|
|
36
|
-
export interface ValueUpdatePropertyMutation<Value = any> {
|
|
37
|
-
type: 'update';
|
|
38
|
-
value: Value;
|
|
39
|
-
}
|
|
40
|
-
export interface ApplyNumericFnPropertyMutation {
|
|
41
|
-
type: 'applyNumericFn';
|
|
42
|
-
fn: 'increment';
|
|
43
|
-
value: number;
|
|
44
|
-
}
|
|
45
|
-
export interface RemovePropertyMutation {
|
|
46
|
-
type: 'removeProperty';
|
|
47
|
-
}
|
|
48
|
-
interface ApplyExtendString {
|
|
49
|
-
type: 'applyStringFn';
|
|
50
|
-
fn: 'extendString';
|
|
51
|
-
value: string;
|
|
52
|
-
}
|
|
53
|
-
interface ApplyTrimString {
|
|
54
|
-
type: 'applyStringFn';
|
|
55
|
-
fn: 'trim';
|
|
56
|
-
}
|
|
57
|
-
export type ApplyStringFnPropertyMutation = ApplyExtendString | ApplyTrimString;
|
|
58
|
-
export declare function sortUpdateMutationProperties(updateMutation: UpdateMutation): Array<[FieldName, Array<PropertyMutation>]>;
|
|
59
|
-
export declare function mergeMutations(mutationA: Mutation, mutationB: Mutation): Mutation;
|
|
60
|
-
export declare function applyUpdateMutation<T extends SquidDocument>(doc: T, updateMutation: UpdateMutation<T>): T | undefined;
|
|
61
|
-
export declare function convertInsertToUpdate(insertMutation: InsertMutation): UpdateMutation;
|
|
62
|
-
export declare function reduceMutations(mutations: Array<Mutation<unknown>>): Array<Mutation<unknown>>;
|
|
63
|
-
export {};
|
|
1
|
+
import { IntegrationId } from './communication.types';
|
|
2
|
+
import { DocTimestamp, FieldName, SquidDocId, SquidDocIdObj, SquidDocument } from './document.types';
|
|
3
|
+
export interface MutateRequest<T = any> {
|
|
4
|
+
integrationId: IntegrationId;
|
|
5
|
+
mutations: Array<Mutation<T>>;
|
|
6
|
+
}
|
|
7
|
+
export interface ExecuteMutationsResponse {
|
|
8
|
+
timestamp: DocTimestamp;
|
|
9
|
+
idResolutionMap?: IdResolutionMap;
|
|
10
|
+
afterDocs: Record<SquidDocId, SquidDocument>;
|
|
11
|
+
}
|
|
12
|
+
export interface MutateResponse extends Omit<ExecuteMutationsResponse, 'afterDocs'> {
|
|
13
|
+
refreshList: Array<SquidDocId>;
|
|
14
|
+
}
|
|
15
|
+
export type IdResolutionMap = Record<SquidDocId, SquidDocId>;
|
|
16
|
+
export type Mutation<T = any> = UpdateMutation<T> | InsertMutation<T> | DeleteMutation;
|
|
17
|
+
export type MutationType = 'insert' | 'update' | 'delete';
|
|
18
|
+
interface BaseMutation {
|
|
19
|
+
type: MutationType;
|
|
20
|
+
squidDocIdObj: SquidDocIdObj;
|
|
21
|
+
}
|
|
22
|
+
export interface DeleteMutation extends BaseMutation {
|
|
23
|
+
type: 'delete';
|
|
24
|
+
}
|
|
25
|
+
export interface UpdateMutation<T = any> extends BaseMutation {
|
|
26
|
+
type: 'update';
|
|
27
|
+
properties: {
|
|
28
|
+
[key in keyof T & string]?: Array<PropertyMutation<T[key]>>;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export interface InsertMutation<T = any> extends BaseMutation {
|
|
32
|
+
type: 'insert';
|
|
33
|
+
properties: T;
|
|
34
|
+
}
|
|
35
|
+
export type PropertyMutation<Value = any> = ApplyNumericFnPropertyMutation | ApplyStringFnPropertyMutation | ValueUpdatePropertyMutation<Value> | RemovePropertyMutation;
|
|
36
|
+
export interface ValueUpdatePropertyMutation<Value = any> {
|
|
37
|
+
type: 'update';
|
|
38
|
+
value: Value;
|
|
39
|
+
}
|
|
40
|
+
export interface ApplyNumericFnPropertyMutation {
|
|
41
|
+
type: 'applyNumericFn';
|
|
42
|
+
fn: 'increment';
|
|
43
|
+
value: number;
|
|
44
|
+
}
|
|
45
|
+
export interface RemovePropertyMutation {
|
|
46
|
+
type: 'removeProperty';
|
|
47
|
+
}
|
|
48
|
+
interface ApplyExtendString {
|
|
49
|
+
type: 'applyStringFn';
|
|
50
|
+
fn: 'extendString';
|
|
51
|
+
value: string;
|
|
52
|
+
}
|
|
53
|
+
interface ApplyTrimString {
|
|
54
|
+
type: 'applyStringFn';
|
|
55
|
+
fn: 'trim';
|
|
56
|
+
}
|
|
57
|
+
export type ApplyStringFnPropertyMutation = ApplyExtendString | ApplyTrimString;
|
|
58
|
+
export declare function sortUpdateMutationProperties(updateMutation: UpdateMutation): Array<[FieldName, Array<PropertyMutation>]>;
|
|
59
|
+
export declare function mergeMutations(mutationA: Mutation, mutationB: Mutation): Mutation;
|
|
60
|
+
export declare function applyUpdateMutation<T extends SquidDocument>(doc: T, updateMutation: UpdateMutation<T>): T | undefined;
|
|
61
|
+
export declare function convertInsertToUpdate(insertMutation: InsertMutation): UpdateMutation;
|
|
62
|
+
export declare function reduceMutations(mutations: Array<Mutation<unknown>>): Array<Mutation<unknown>>;
|
|
63
|
+
export {};
|