@squidcloud/local-backend 1.0.148 → 1.0.151
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.types.d.ts +50 -50
- package/dist/common/src/ai-assistant.types.js +2 -2
- package/dist/common/src/ai-chatbot.context.d.ts +13 -13
- package/dist/common/src/ai-chatbot.context.js +19 -19
- package/dist/common/src/ai-chatbot.schemas.d.ts +18 -18
- package/dist/common/src/ai-chatbot.schemas.js +21 -21
- package/dist/common/src/ai-chatbot.types.d.ts +125 -123
- package/dist/common/src/ai-chatbot.types.js +18 -18
- 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 +22 -22
- package/dist/common/src/api.types.js +2 -2
- package/dist/common/src/application.schemas.d.ts +1648 -1648
- package/dist/common/src/application.schemas.js +948 -948
- package/dist/common/src/application.types.d.ts +193 -193
- package/dist/common/src/application.types.js +89 -89
- package/dist/common/src/application.types.js.map +1 -1
- package/dist/common/src/backend-function.schemas.d.ts +3 -3
- package/dist/common/src/backend-function.schemas.js +11 -11
- package/dist/common/src/backend-function.types.d.ts +4 -4
- 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 +92 -95
- package/dist/common/src/backend-run.types.js.map +1 -1
- package/dist/common/src/bundle-api.types.d.ts +65 -69
- package/dist/common/src/bundle-api.types.js +2 -2
- package/dist/common/src/bundle-data.types.d.ts +69 -74
- package/dist/common/src/bundle-data.types.js +2 -2
- package/dist/common/src/communication.types.d.ts +20 -19
- package/dist/common/src/communication.types.js +41 -40
- package/dist/common/src/communication.types.js.map +1 -1
- 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 +4 -4
- package/dist/common/src/distributed-lock.context.js +9 -9
- 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/http-status.enum.js.map +1 -1
- package/dist/common/src/index.d.ts +54 -57
- package/dist/common/src/index.js +70 -73
- package/dist/common/src/index.js.map +1 -1
- package/dist/common/src/integrations/ai_chatbot.types.d.ts +31 -31
- package/dist/common/src/integrations/ai_chatbot.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 +274 -274
- package/dist/common/src/integrations/database.types.js +2 -2
- package/dist/common/src/integrations/index.d.ts +134 -134
- package/dist/common/src/integrations/index.js +119 -119
- package/dist/common/src/integrations/index.js.map +1 -1
- 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/logger.types.js.map +1 -1
- 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/native-query.context.d.ts +7 -7
- package/dist/common/src/native-query.context.js +11 -11
- package/dist/common/src/native-query.types.d.ts +16 -16
- package/dist/common/src/native-query.types.js +2 -2
- package/dist/common/src/query/base-query-builder.d.ts +38 -38
- package/dist/common/src/query/base-query-builder.js +39 -39
- 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 +46 -46
- package/dist/common/src/query/pagination.js +211 -211
- 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 +97 -97
- 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 +173 -173
- package/dist/common/src/secret.schemas.d.ts +4 -4
- package/dist/common/src/secret.schemas.js +17 -17
- package/dist/common/src/secret.types.d.ts +68 -68
- 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 +57 -57
- package/dist/common/src/socket.types.d.ts +126 -126
- package/dist/common/src/socket.types.js +9 -9
- package/dist/common/src/socket.types.js.map +1 -1
- package/dist/common/src/time-units.d.ts +11 -11
- package/dist/common/src/time-units.js +14 -14
- 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 +3 -3
- package/dist/common/src/utils/assert.js +14 -14
- 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 +11 -11
- package/dist/common/src/utils/global.utils.js +50 -50
- package/dist/common/src/utils/http.d.ts +2 -2
- package/dist/common/src/utils/http.js +51 -51
- 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/object.d.ts +5 -5
- package/dist/common/src/utils/object.js +75 -75
- package/dist/common/src/utils/serialization.d.ts +5 -5
- package/dist/common/src/utils/serialization.js +73 -73
- package/dist/common/src/utils/transforms.d.ts +18 -18
- package/dist/common/src/utils/transforms.js +104 -104
- 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 +199 -199
- 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 -21
- package/dist/common/src/websocket.impl.js +79 -79
- 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/local-dev.types.d.ts +35 -35
- package/dist/internal-common/src/local-dev.types.js +2 -2
- package/dist/local-backend/package.json +48 -48
- package/dist/local-backend/src/index.d.ts +4 -4
- package/dist/local-backend/src/index.js +26 -26
- package/dist/local-backend/src/local-backend-socket.service.d.ts +18 -18
- package/dist/local-backend/src/local-backend-socket.service.js +107 -108
- 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 +48 -49
- package/dist/local-backend/src/local-backend.controller.js.map +1 -1
- package/dist/local-backend/src/local-backend.module.d.ts +8 -8
- package/dist/local-backend/src/local-backend.module.js +51 -53
- package/dist/local-backend/src/local-backend.module.js.map +1 -1
- package/dist/local-backend/src/local-backend.service.d.ts +15 -15
- package/dist/local-backend/src/local-backend.service.js +173 -176
- package/dist/local-backend/src/local-backend.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/common/src/named-query.context.d.ts +0 -4
- package/dist/common/src/named-query.context.js +0 -10
- package/dist/common/src/named-query.context.js.map +0 -1
- package/dist/common/src/named-query.schemas.d.ts +0 -3
- package/dist/common/src/named-query.schemas.js +0 -14
- package/dist/common/src/named-query.schemas.js.map +0 -1
- package/dist/common/src/named-query.types.d.ts +0 -8
- package/dist/common/src/named-query.types.js +0 -3
- package/dist/common/src/named-query.types.js.map +0 -1
- package/dist/internal-common/src/utils/logger-utils.d.ts +0 -3
- package/dist/internal-common/src/utils/logger-utils.js +0 -29
- package/dist/internal-common/src/utils/logger-utils.js.map +0 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export type LoggerContext = Record<string, any>;
|
|
2
|
-
export interface Logger {
|
|
3
|
-
trace(message: string, context?: LoggerContext): void;
|
|
4
|
-
debug(message: string, context?: LoggerContext): void;
|
|
5
|
-
info(message: string, context?: LoggerContext): void;
|
|
6
|
-
warn(message: string, context?: LoggerContext): void;
|
|
7
|
-
error(message: string, context?: LoggerContext): void;
|
|
8
|
-
log(record: LogRecord): void;
|
|
9
|
-
}
|
|
10
|
-
export declare enum LogLevel {
|
|
11
|
-
TRACE = "trace",
|
|
12
|
-
DEBUG = "debug",
|
|
13
|
-
INFO = "info",
|
|
14
|
-
WARN = "warn",
|
|
15
|
-
ERROR = "error"
|
|
16
|
-
}
|
|
17
|
-
export interface LogRecord {
|
|
18
|
-
level?: LogLevel;
|
|
19
|
-
message?: string;
|
|
20
|
-
[key: string]: any;
|
|
21
|
-
}
|
|
1
|
+
export type LoggerContext = Record<string, any>;
|
|
2
|
+
export interface Logger {
|
|
3
|
+
trace(message: string, context?: LoggerContext): void;
|
|
4
|
+
debug(message: string, context?: LoggerContext): void;
|
|
5
|
+
info(message: string, context?: LoggerContext): void;
|
|
6
|
+
warn(message: string, context?: LoggerContext): void;
|
|
7
|
+
error(message: string, context?: LoggerContext): void;
|
|
8
|
+
log(record: LogRecord): void;
|
|
9
|
+
}
|
|
10
|
+
export declare enum LogLevel {
|
|
11
|
+
TRACE = "trace",
|
|
12
|
+
DEBUG = "debug",
|
|
13
|
+
INFO = "info",
|
|
14
|
+
WARN = "warn",
|
|
15
|
+
ERROR = "error"
|
|
16
|
+
}
|
|
17
|
+
export interface LogRecord {
|
|
18
|
+
level?: LogLevel;
|
|
19
|
+
message?: string;
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LogLevel = void 0;
|
|
4
|
-
var LogLevel;
|
|
5
|
-
(function (LogLevel) {
|
|
6
|
-
LogLevel["TRACE"] = "trace";
|
|
7
|
-
LogLevel["DEBUG"] = "debug";
|
|
8
|
-
LogLevel["INFO"] = "info";
|
|
9
|
-
LogLevel["WARN"] = "warn";
|
|
10
|
-
LogLevel["ERROR"] = "error";
|
|
11
|
-
})(LogLevel
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LogLevel = void 0;
|
|
4
|
+
var LogLevel;
|
|
5
|
+
(function (LogLevel) {
|
|
6
|
+
LogLevel["TRACE"] = "trace";
|
|
7
|
+
LogLevel["DEBUG"] = "debug";
|
|
8
|
+
LogLevel["INFO"] = "info";
|
|
9
|
+
LogLevel["WARN"] = "warn";
|
|
10
|
+
LogLevel["ERROR"] = "error";
|
|
11
|
+
})(LogLevel || (exports.LogLevel = LogLevel = {}));
|
|
12
12
|
//# sourceMappingURL=logger.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.types.js","sourceRoot":"","sources":["../../../../common/src/logger.types.ts"],"names":[],"mappings":";;;AAgBA,IAAY,QAMX;AAND,WAAY,QAAQ;IAClB,2BAAe,CAAA;IACf,2BAAe,CAAA;IACf,yBAAa,CAAA;IACb,yBAAa,CAAA;IACb,2BAAe,CAAA;AACjB,CAAC,EANW,QAAQ,
|
|
1
|
+
{"version":3,"file":"logger.types.js","sourceRoot":"","sources":["../../../../common/src/logger.types.ts"],"names":[],"mappings":";;;AAgBA,IAAY,QAMX;AAND,WAAY,QAAQ;IAClB,2BAAe,CAAA;IACf,2BAAe,CAAA;IACf,yBAAa,CAAA;IACb,yBAAa,CAAA;IACb,2BAAe,CAAA;AACjB,CAAC,EANW,QAAQ,wBAAR,QAAQ,QAMnB"}
|
|
@@ -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
|