@squidcloud/local-backend 1.0.142 → 1.0.143

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.
Files changed (173) hide show
  1. package/dist/common/src/ai-assistant.types.d.ts +34 -128
  2. package/dist/common/src/ai-assistant.types.js +2 -17
  3. package/dist/common/src/ai-assistant.types.js.map +1 -1
  4. package/dist/common/src/ai-chatbot.context.d.ts +13 -0
  5. package/dist/common/src/{ai-assistant.context.js → ai-chatbot.context.js} +20 -20
  6. package/dist/common/src/ai-chatbot.context.js.map +1 -0
  7. package/dist/common/src/ai-chatbot.schemas.d.ts +18 -0
  8. package/dist/common/src/ai-chatbot.schemas.js +22 -0
  9. package/dist/common/src/ai-chatbot.schemas.js.map +1 -0
  10. package/dist/common/src/ai-chatbot.types.d.ts +121 -0
  11. package/dist/common/src/ai-chatbot.types.js +18 -0
  12. package/dist/common/src/ai-chatbot.types.js.map +1 -0
  13. package/dist/common/src/api-call.context.d.ts +13 -13
  14. package/dist/common/src/api-call.context.js +16 -16
  15. package/dist/common/src/api.types.d.ts +22 -22
  16. package/dist/common/src/api.types.js +2 -2
  17. package/dist/common/src/application.schemas.d.ts +1648 -1648
  18. package/dist/common/src/application.schemas.js +1001 -1001
  19. package/dist/common/src/application.schemas.js.map +1 -1
  20. package/dist/common/src/application.types.d.ts +193 -193
  21. package/dist/common/src/application.types.js +89 -89
  22. package/dist/common/src/backend-function.schemas.d.ts +3 -3
  23. package/dist/common/src/backend-function.schemas.js +11 -11
  24. package/dist/common/src/backend-function.types.d.ts +4 -4
  25. package/dist/common/src/backend-function.types.js +2 -2
  26. package/dist/common/src/backend-run.types.d.ts +54 -54
  27. package/dist/common/src/backend-run.types.js +95 -95
  28. package/dist/common/src/backend-run.types.js.map +1 -1
  29. package/dist/common/src/bundle-api.types.d.ts +69 -68
  30. package/dist/common/src/bundle-api.types.js +2 -2
  31. package/dist/common/src/bundle-data.types.d.ts +74 -61
  32. package/dist/common/src/bundle-data.types.js +2 -2
  33. package/dist/common/src/communication.types.d.ts +19 -19
  34. package/dist/common/src/communication.types.js +40 -40
  35. package/dist/common/src/context.types.d.ts +24 -24
  36. package/dist/common/src/context.types.js +2 -2
  37. package/dist/common/src/distributed-lock.context.d.ts +4 -4
  38. package/dist/common/src/distributed-lock.context.js +9 -9
  39. package/dist/common/src/document.types.d.ts +32 -32
  40. package/dist/common/src/document.types.js +50 -50
  41. package/dist/common/src/graphql.context.d.ts +14 -14
  42. package/dist/common/src/graphql.context.js +12 -12
  43. package/dist/common/src/graphql.types.d.ts +11 -11
  44. package/dist/common/src/graphql.types.js +34 -34
  45. package/dist/common/src/heartbeat.types.d.ts +4 -4
  46. package/dist/common/src/heartbeat.types.js +16 -16
  47. package/dist/common/src/http-status.enum.d.ts +50 -50
  48. package/dist/common/src/http-status.enum.js +54 -54
  49. package/dist/common/src/index.d.ts +57 -56
  50. package/dist/common/src/index.js +73 -72
  51. package/dist/common/src/index.js.map +1 -1
  52. package/dist/common/src/integrations/ai_chatbot.types.d.ts +31 -0
  53. package/dist/common/src/integrations/{ai_assistant.types.js → ai_chatbot.types.js} +3 -3
  54. package/dist/common/src/integrations/ai_chatbot.types.js.map +1 -0
  55. package/dist/common/src/integrations/api.types.d.ts +80 -80
  56. package/dist/common/src/integrations/api.types.js +2 -2
  57. package/dist/common/src/integrations/auth.types.d.ts +39 -39
  58. package/dist/common/src/integrations/auth.types.js +2 -2
  59. package/dist/common/src/integrations/database.types.d.ts +274 -274
  60. package/dist/common/src/integrations/database.types.js +2 -2
  61. package/dist/common/src/integrations/index.d.ts +134 -134
  62. package/dist/common/src/integrations/index.js +119 -119
  63. package/dist/common/src/integrations/index.js.map +1 -1
  64. package/dist/common/src/integrations/observability.types.d.ts +23 -23
  65. package/dist/common/src/integrations/observability.types.js +23 -23
  66. package/dist/common/src/logger.types.d.ts +21 -21
  67. package/dist/common/src/logger.types.js +11 -11
  68. package/dist/common/src/metrics.types.d.ts +73 -73
  69. package/dist/common/src/metrics.types.js +11 -11
  70. package/dist/common/src/mutation.context.d.ts +13 -13
  71. package/dist/common/src/mutation.context.js +26 -26
  72. package/dist/common/src/mutation.schemas.d.ts +5 -5
  73. package/dist/common/src/mutation.schemas.js +114 -114
  74. package/dist/common/src/mutation.types.d.ts +63 -63
  75. package/dist/common/src/mutation.types.js +142 -142
  76. package/dist/common/src/named-query.context.d.ts +4 -4
  77. package/dist/common/src/named-query.context.js +9 -9
  78. package/dist/common/src/named-query.schemas.d.ts +3 -3
  79. package/dist/common/src/named-query.schemas.js +13 -13
  80. package/dist/common/src/named-query.types.d.ts +8 -8
  81. package/dist/common/src/named-query.types.js +2 -2
  82. package/dist/common/src/native-query.context.d.ts +7 -7
  83. package/dist/common/src/native-query.context.js +11 -11
  84. package/dist/common/src/native-query.types.d.ts +16 -16
  85. package/dist/common/src/native-query.types.js +2 -2
  86. package/dist/common/src/query/base-query-builder.d.ts +38 -38
  87. package/dist/common/src/query/base-query-builder.js +39 -39
  88. package/dist/common/src/query/index.d.ts +4 -4
  89. package/dist/common/src/query/index.js +20 -20
  90. package/dist/common/src/query/pagination.d.ts +46 -46
  91. package/dist/common/src/query/pagination.js +211 -211
  92. package/dist/common/src/query/query-context.d.ts +47 -47
  93. package/dist/common/src/query/query-context.js +159 -159
  94. package/dist/common/src/query/serialized-query.types.d.ts +24 -24
  95. package/dist/common/src/query/serialized-query.types.js +2 -2
  96. package/dist/common/src/query.types.d.ts +86 -86
  97. package/dist/common/src/query.types.js +171 -171
  98. package/dist/common/src/regions.d.ts +21 -21
  99. package/dist/common/src/regions.js +46 -46
  100. package/dist/common/src/schema/schema.types.d.ts +30 -30
  101. package/dist/common/src/schema/schema.types.js +173 -173
  102. package/dist/common/src/secret.schemas.d.ts +4 -4
  103. package/dist/common/src/secret.schemas.js +17 -17
  104. package/dist/common/src/secret.types.d.ts +68 -68
  105. package/dist/common/src/secret.types.js +5 -5
  106. package/dist/common/src/security.types.d.ts +3 -3
  107. package/dist/common/src/security.types.js +2 -2
  108. package/dist/common/src/socket.schemas.d.ts +3 -3
  109. package/dist/common/src/socket.schemas.js +57 -57
  110. package/dist/common/src/socket.types.d.ts +126 -126
  111. package/dist/common/src/socket.types.js +9 -9
  112. package/dist/common/src/time-units.d.ts +5 -5
  113. package/dist/common/src/time-units.js +8 -8
  114. package/dist/common/src/trigger.types.d.ts +15 -15
  115. package/dist/common/src/trigger.types.js +2 -2
  116. package/dist/common/src/types.d.ts +21 -21
  117. package/dist/common/src/types.js +2 -2
  118. package/dist/common/src/utils/array.d.ts +8 -8
  119. package/dist/common/src/utils/array.js +54 -54
  120. package/dist/common/src/utils/assert.d.ts +3 -3
  121. package/dist/common/src/utils/assert.js +14 -14
  122. package/dist/common/src/utils/error.d.ts +4 -4
  123. package/dist/common/src/utils/error.js +10 -10
  124. package/dist/common/src/utils/global.utils.d.ts +11 -11
  125. package/dist/common/src/utils/global.utils.js +50 -50
  126. package/dist/common/src/utils/http.d.ts +2 -2
  127. package/dist/common/src/utils/http.js +51 -51
  128. package/dist/common/src/utils/id.d.ts +2 -2
  129. package/dist/common/src/utils/id.js +21 -21
  130. package/dist/common/src/utils/lock.manager.d.ts +9 -9
  131. package/dist/common/src/utils/lock.manager.js +39 -39
  132. package/dist/common/src/utils/object.d.ts +5 -5
  133. package/dist/common/src/utils/object.js +75 -75
  134. package/dist/common/src/utils/serialization.d.ts +6 -6
  135. package/dist/common/src/utils/serialization.js +77 -77
  136. package/dist/common/src/utils/transforms.d.ts +18 -18
  137. package/dist/common/src/utils/transforms.js +104 -104
  138. package/dist/common/src/utils/url.d.ts +1 -1
  139. package/dist/common/src/utils/url.js +15 -15
  140. package/dist/common/src/utils/validation.d.ts +17 -17
  141. package/dist/common/src/utils/validation.js +209 -209
  142. package/dist/common/src/webhook-response.d.ts +6 -6
  143. package/dist/common/src/webhook-response.js +2 -2
  144. package/dist/common/src/websocket.impl.d.ts +21 -21
  145. package/dist/common/src/websocket.impl.js +79 -79
  146. package/dist/internal-common/src/code-executor.types.d.ts +13 -13
  147. package/dist/internal-common/src/code-executor.types.js +2 -2
  148. package/dist/internal-common/src/local-dev.types.d.ts +35 -35
  149. package/dist/internal-common/src/local-dev.types.js +2 -2
  150. package/dist/internal-common/src/utils/logger-utils.d.ts +3 -3
  151. package/dist/internal-common/src/utils/logger-utils.js +28 -28
  152. package/dist/local-backend/package.json +50 -57
  153. package/dist/local-backend/src/index.d.ts +4 -4
  154. package/dist/local-backend/src/index.js +26 -26
  155. package/dist/local-backend/src/local-backend-socket.service.d.ts +18 -18
  156. package/dist/local-backend/src/local-backend-socket.service.js +108 -108
  157. package/dist/local-backend/src/local-backend.app.d.ts +2 -2
  158. package/dist/local-backend/src/local-backend.app.js +19 -19
  159. package/dist/local-backend/src/local-backend.controller.d.ts +8 -8
  160. package/dist/local-backend/src/local-backend.controller.js +49 -49
  161. package/dist/local-backend/src/local-backend.module.d.ts +8 -8
  162. package/dist/local-backend/src/local-backend.module.js +53 -53
  163. package/dist/local-backend/src/local-backend.service.d.ts +15 -15
  164. package/dist/local-backend/src/local-backend.service.js +176 -176
  165. package/dist/tsconfig.build.tsbuildinfo +1 -1
  166. package/package.json +2 -9
  167. package/dist/common/src/ai-assistant.context.d.ts +0 -13
  168. package/dist/common/src/ai-assistant.context.js.map +0 -1
  169. package/dist/common/src/ai-assistant.schemas.d.ts +0 -243
  170. package/dist/common/src/ai-assistant.schemas.js +0 -211
  171. package/dist/common/src/ai-assistant.schemas.js.map +0 -1
  172. package/dist/common/src/integrations/ai_assistant.types.d.ts +0 -31
  173. package/dist/common/src/integrations/ai_assistant.types.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 = exports.LogLevel || (exports.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 || (exports.LogLevel = {}));
12
12
  //# sourceMappingURL=logger.types.js.map
@@ -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