@squidcloud/local-backend 1.0.66 → 1.0.67

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 (179) hide show
  1. package/dist/common/src/ai-assistant.context.d.ts +13 -13
  2. package/dist/common/src/ai-assistant.context.js +19 -19
  3. package/dist/common/src/ai-assistant.schemas.d.ts +243 -243
  4. package/dist/common/src/ai-assistant.schemas.js +210 -210
  5. package/dist/common/src/ai-assistant.types.d.ts +90 -90
  6. package/dist/common/src/ai-assistant.types.js +11 -11
  7. package/dist/common/src/api-call.context.d.ts +13 -13
  8. package/dist/common/src/api-call.context.js +16 -16
  9. package/dist/common/src/api.types.d.ts +23 -23
  10. package/dist/common/src/api.types.js +2 -2
  11. package/dist/common/src/application.schemas.d.ts +1312 -1312
  12. package/dist/common/src/application.schemas.js +860 -860
  13. package/dist/common/src/application.types.d.ts +186 -186
  14. package/dist/common/src/application.types.js +89 -89
  15. package/dist/common/src/backend-function.schemas.d.ts +3 -3
  16. package/dist/common/src/backend-function.schemas.js +12 -12
  17. package/dist/common/src/backend-function.types.d.ts +6 -6
  18. package/dist/common/src/backend-function.types.js +2 -2
  19. package/dist/common/src/backend-run.types.d.ts +54 -54
  20. package/dist/common/src/backend-run.types.js +96 -96
  21. package/dist/common/src/bundle-api.types.d.ts +63 -63
  22. package/dist/common/src/bundle-api.types.js +2 -2
  23. package/dist/common/src/bundle-data.types.d.ts +59 -59
  24. package/dist/common/src/bundle-data.types.js +2 -2
  25. package/dist/common/src/communication.types.d.ts +18 -18
  26. package/dist/common/src/communication.types.js +40 -40
  27. package/dist/common/src/context.types.d.ts +24 -24
  28. package/dist/common/src/context.types.js +2 -2
  29. package/dist/common/src/distributed-lock.context.d.ts +5 -5
  30. package/dist/common/src/distributed-lock.context.js +10 -10
  31. package/dist/common/src/document.types.d.ts +32 -32
  32. package/dist/common/src/document.types.js +50 -50
  33. package/dist/common/src/graphql.context.d.ts +14 -14
  34. package/dist/common/src/graphql.context.js +12 -12
  35. package/dist/common/src/graphql.types.d.ts +11 -11
  36. package/dist/common/src/graphql.types.js +34 -34
  37. package/dist/common/src/heartbeat.types.d.ts +4 -4
  38. package/dist/common/src/heartbeat.types.js +16 -16
  39. package/dist/common/src/http-status.enum.d.ts +50 -50
  40. package/dist/common/src/http-status.enum.js +54 -54
  41. package/dist/common/src/index.d.ts +55 -55
  42. package/dist/common/src/index.js +71 -71
  43. package/dist/common/src/integrations/ai_assistant.types.d.ts +24 -24
  44. package/dist/common/src/integrations/ai_assistant.types.js +2 -2
  45. package/dist/common/src/integrations/api.types.d.ts +80 -80
  46. package/dist/common/src/integrations/api.types.js +2 -2
  47. package/dist/common/src/integrations/auth.types.d.ts +39 -39
  48. package/dist/common/src/integrations/auth.types.js +2 -2
  49. package/dist/common/src/integrations/database.types.d.ts +231 -231
  50. package/dist/common/src/integrations/database.types.js +2 -2
  51. package/dist/common/src/integrations/index.d.ts +124 -124
  52. package/dist/common/src/integrations/index.js +111 -111
  53. package/dist/common/src/integrations/observability.types.d.ts +23 -23
  54. package/dist/common/src/integrations/observability.types.js +23 -23
  55. package/dist/common/src/logger.types.d.ts +21 -21
  56. package/dist/common/src/logger.types.js +11 -11
  57. package/dist/common/src/metrics.types.d.ts +73 -73
  58. package/dist/common/src/metrics.types.js +11 -11
  59. package/dist/common/src/mutation.context.d.ts +13 -13
  60. package/dist/common/src/mutation.context.js +26 -26
  61. package/dist/common/src/mutation.schemas.d.ts +5 -5
  62. package/dist/common/src/mutation.schemas.js +114 -114
  63. package/dist/common/src/mutation.types.d.ts +63 -63
  64. package/dist/common/src/mutation.types.js +142 -142
  65. package/dist/common/src/named-query.context.d.ts +4 -4
  66. package/dist/common/src/named-query.context.js +9 -9
  67. package/dist/common/src/named-query.schemas.d.ts +3 -3
  68. package/dist/common/src/named-query.schemas.js +13 -13
  69. package/dist/common/src/named-query.types.d.ts +8 -8
  70. package/dist/common/src/named-query.types.js +2 -2
  71. package/dist/common/src/query/base-query-builder.d.ts +37 -37
  72. package/dist/common/src/query/base-query-builder.js +36 -36
  73. package/dist/common/src/query/index.d.ts +4 -4
  74. package/dist/common/src/query/index.js +20 -20
  75. package/dist/common/src/query/pagination.d.ts +42 -42
  76. package/dist/common/src/query/pagination.js +164 -164
  77. package/dist/common/src/query/query-context.d.ts +47 -47
  78. package/dist/common/src/query/query-context.js +159 -159
  79. package/dist/common/src/query/serialized-query.types.d.ts +24 -24
  80. package/dist/common/src/query/serialized-query.types.js +2 -2
  81. package/dist/common/src/query.types.d.ts +86 -86
  82. package/dist/common/src/query.types.js +153 -153
  83. package/dist/common/src/regions.d.ts +21 -21
  84. package/dist/common/src/regions.js +46 -46
  85. package/dist/common/src/schema/schema.types.d.ts +30 -30
  86. package/dist/common/src/schema/schema.types.js +172 -172
  87. package/dist/common/src/secret.schemas.d.ts +6 -6
  88. package/dist/common/src/secret.schemas.js +38 -38
  89. package/dist/common/src/secret.types.d.ts +49 -49
  90. package/dist/common/src/secret.types.js +5 -5
  91. package/dist/common/src/security.types.d.ts +3 -3
  92. package/dist/common/src/security.types.js +2 -2
  93. package/dist/common/src/socket.schemas.d.ts +3 -3
  94. package/dist/common/src/socket.schemas.js +58 -58
  95. package/dist/common/src/socket.types.d.ts +112 -112
  96. package/dist/common/src/socket.types.js +2 -2
  97. package/dist/common/src/time-units.d.ts +5 -5
  98. package/dist/common/src/time-units.js +8 -8
  99. package/dist/common/src/trigger.types.d.ts +15 -15
  100. package/dist/common/src/trigger.types.js +2 -2
  101. package/dist/common/src/types.d.ts +21 -21
  102. package/dist/common/src/types.js +2 -2
  103. package/dist/common/src/utils/array.d.ts +8 -8
  104. package/dist/common/src/utils/array.js +54 -54
  105. package/dist/common/src/utils/assert.d.ts +8 -8
  106. package/dist/common/src/utils/assert.js +49 -49
  107. package/dist/common/src/utils/error.d.ts +4 -4
  108. package/dist/common/src/utils/error.js +10 -10
  109. package/dist/common/src/utils/global.utils.d.ts +10 -10
  110. package/dist/common/src/utils/global.utils.js +46 -46
  111. package/dist/common/src/utils/http.d.ts +2 -2
  112. package/dist/common/src/utils/http.js +41 -41
  113. package/dist/common/src/utils/id.d.ts +2 -2
  114. package/dist/common/src/utils/id.js +21 -21
  115. package/dist/common/src/utils/lock.manager.d.ts +9 -9
  116. package/dist/common/src/utils/lock.manager.js +39 -39
  117. package/dist/common/src/utils/nullish.d.ts +2 -2
  118. package/dist/common/src/utils/nullish.js +11 -11
  119. package/dist/common/src/utils/object.d.ts +5 -5
  120. package/dist/common/src/utils/object.js +75 -75
  121. package/dist/common/src/utils/serialization.d.ts +6 -6
  122. package/dist/common/src/utils/serialization.js +77 -77
  123. package/dist/common/src/utils/transforms.d.ts +18 -18
  124. package/dist/common/src/utils/transforms.js +92 -92
  125. package/dist/common/src/utils/url.d.ts +1 -1
  126. package/dist/common/src/utils/url.js +15 -15
  127. package/dist/common/src/utils/validation.d.ts +17 -17
  128. package/dist/common/src/utils/validation.js +209 -209
  129. package/dist/common/src/webhook-response.d.ts +6 -6
  130. package/dist/common/src/webhook-response.js +2 -2
  131. package/dist/common/src/websocket.impl.d.ts +21 -21
  132. package/dist/common/src/websocket.impl.js +76 -76
  133. package/dist/internal-common/src/async-queue.d.ts +4 -4
  134. package/dist/internal-common/src/async-queue.js +17 -17
  135. package/dist/internal-common/src/code-executor.types.d.ts +13 -13
  136. package/dist/internal-common/src/code-executor.types.js +2 -2
  137. package/dist/internal-common/src/dao.types.d.ts +46 -46
  138. package/dist/internal-common/src/dao.types.js +2 -2
  139. package/dist/internal-common/src/environment/environment.types.d.ts +74 -74
  140. package/dist/internal-common/src/environment/environment.types.js +2 -2
  141. package/dist/internal-common/src/environment/index.d.ts +6 -6
  142. package/dist/internal-common/src/environment/index.js +27 -27
  143. package/dist/internal-common/src/environment/local.environment.d.ts +2 -2
  144. package/dist/internal-common/src/environment/local.environment.js +62 -62
  145. package/dist/internal-common/src/filters/custom-exception.filter.d.ts +6 -6
  146. package/dist/internal-common/src/filters/custom-exception.filter.js +44 -44
  147. package/dist/internal-common/src/index.d.ts +14 -14
  148. package/dist/internal-common/src/index.js +32 -32
  149. package/dist/internal-common/src/interceptors/body.interceptor.d.ts +5 -5
  150. package/dist/internal-common/src/interceptors/body.interceptor.js +24 -24
  151. package/dist/internal-common/src/kafka/kafka.manager.d.ts +22 -22
  152. package/dist/internal-common/src/kafka/kafka.manager.js +129 -129
  153. package/dist/internal-common/src/kafka/kafka.types.d.ts +17 -17
  154. package/dist/internal-common/src/kafka/kafka.types.js +2 -2
  155. package/dist/internal-common/src/kafka-observability-publisher.d.ts +11 -11
  156. package/dist/internal-common/src/kafka-observability-publisher.js +20 -20
  157. package/dist/internal-common/src/local-dev.types.d.ts +35 -35
  158. package/dist/internal-common/src/local-dev.types.js +2 -2
  159. package/dist/internal-common/src/observability-publisher.d.ts +9 -9
  160. package/dist/internal-common/src/observability-publisher.js +58 -58
  161. package/dist/internal-common/src/observability.types.d.ts +17 -17
  162. package/dist/internal-common/src/observability.types.js +2 -2
  163. package/dist/internal-common/src/shutdown.manager.d.ts +20 -20
  164. package/dist/internal-common/src/shutdown.manager.js +75 -75
  165. package/dist/internal-common/src/utils.d.ts +5 -5
  166. package/dist/internal-common/src/utils.js +29 -29
  167. package/dist/local-backend/src/index.d.ts +4 -4
  168. package/dist/local-backend/src/index.js +20 -20
  169. package/dist/local-backend/src/local-backend-socket.service.d.ts +19 -19
  170. package/dist/local-backend/src/local-backend-socket.service.js +110 -110
  171. package/dist/local-backend/src/local-backend.app.d.ts +2 -2
  172. package/dist/local-backend/src/local-backend.app.js +19 -19
  173. package/dist/local-backend/src/local-backend.controller.d.ts +8 -8
  174. package/dist/local-backend/src/local-backend.controller.js +49 -49
  175. package/dist/local-backend/src/local-backend.module.d.ts +8 -8
  176. package/dist/local-backend/src/local-backend.module.js +53 -53
  177. package/dist/local-backend/src/local-backend.service.d.ts +15 -15
  178. package/dist/local-backend/src/local-backend.service.js +165 -165
  179. package/package.json +1 -1
@@ -1,41 +1,41 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.omitSquidDevId = exports.verifyWithSquidDevId = exports.validateEnvironment = exports.appIdWithEnvironmentIdAndDevId = exports.appIdWithEnvironmentId = exports.parseAppId = exports.allEnvironmentIds = void 0;
4
- const assert_1 = require("./utils/assert");
5
- exports.allEnvironmentIds = ['prod', 'dev'];
6
- function parseAppId(appId) {
7
- const [appIdWithoutEnv, environmentId, squidDeveloperId, other] = appId.split(/[_-]/);
8
- (0, assert_1.assertTruthy)(!other, 'Invalid appId: ' + appId);
9
- return {
10
- appId: appIdWithoutEnv,
11
- environmentId: (environmentId !== null && environmentId !== void 0 ? environmentId : 'prod'),
12
- squidDeveloperId,
13
- };
14
- }
15
- exports.parseAppId = parseAppId;
16
- function appIdWithEnvironmentId(appId, environmentId) {
17
- const parsedAppId = parseAppId(appId);
18
- return `${parsedAppId.appId}${!environmentId || environmentId === 'prod' ? '' : `-${environmentId}`}`;
19
- }
20
- exports.appIdWithEnvironmentId = appIdWithEnvironmentId;
21
- function appIdWithEnvironmentIdAndDevId(appId, environmentId, developerId) {
22
- return `${appIdWithEnvironmentId(appId, environmentId)}${developerId ? `-${developerId}` : ''}`;
23
- }
24
- exports.appIdWithEnvironmentIdAndDevId = appIdWithEnvironmentIdAndDevId;
25
- function validateEnvironment(appId) {
26
- const parsedAppId = parseAppId(appId);
27
- (0, assert_1.assertTruthy)(parsedAppId.environmentId !== 'prod' || !parsedAppId.squidDeveloperId, 'Cannot use developer ID in production');
28
- return parsedAppId;
29
- }
30
- exports.validateEnvironment = validateEnvironment;
31
- function verifyWithSquidDevId(appId) {
32
- const parsedAppId = parseAppId(appId);
33
- (0, assert_1.assertTruthy)(parsedAppId.squidDeveloperId, 'Must provide squid developer ID');
34
- }
35
- exports.verifyWithSquidDevId = verifyWithSquidDevId;
36
- function omitSquidDevId(appId) {
37
- const parsedAppId = parseAppId(appId);
38
- return appIdWithEnvironmentId(parsedAppId.appId, parsedAppId.environmentId);
39
- }
40
- exports.omitSquidDevId = omitSquidDevId;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.omitSquidDevId = exports.verifyWithSquidDevId = exports.validateEnvironment = exports.appIdWithEnvironmentIdAndDevId = exports.appIdWithEnvironmentId = exports.parseAppId = exports.allEnvironmentIds = void 0;
4
+ const assert_1 = require("./utils/assert");
5
+ exports.allEnvironmentIds = ['prod', 'dev'];
6
+ function parseAppId(appId) {
7
+ const [appIdWithoutEnv, environmentId, squidDeveloperId, other] = appId.split(/[_-]/);
8
+ (0, assert_1.assertTruthy)(!other, 'Invalid appId: ' + appId);
9
+ return {
10
+ appId: appIdWithoutEnv,
11
+ environmentId: (environmentId !== null && environmentId !== void 0 ? environmentId : 'prod'),
12
+ squidDeveloperId,
13
+ };
14
+ }
15
+ exports.parseAppId = parseAppId;
16
+ function appIdWithEnvironmentId(appId, environmentId) {
17
+ const parsedAppId = parseAppId(appId);
18
+ return `${parsedAppId.appId}${!environmentId || environmentId === 'prod' ? '' : `-${environmentId}`}`;
19
+ }
20
+ exports.appIdWithEnvironmentId = appIdWithEnvironmentId;
21
+ function appIdWithEnvironmentIdAndDevId(appId, environmentId, developerId) {
22
+ return `${appIdWithEnvironmentId(appId, environmentId)}${developerId ? `-${developerId}` : ''}`;
23
+ }
24
+ exports.appIdWithEnvironmentIdAndDevId = appIdWithEnvironmentIdAndDevId;
25
+ function validateEnvironment(appId) {
26
+ const parsedAppId = parseAppId(appId);
27
+ (0, assert_1.assertTruthy)(parsedAppId.environmentId !== 'prod' || !parsedAppId.squidDeveloperId, 'Cannot use developer ID in production');
28
+ return parsedAppId;
29
+ }
30
+ exports.validateEnvironment = validateEnvironment;
31
+ function verifyWithSquidDevId(appId) {
32
+ const parsedAppId = parseAppId(appId);
33
+ (0, assert_1.assertTruthy)(parsedAppId.squidDeveloperId, 'Must provide squid developer ID');
34
+ }
35
+ exports.verifyWithSquidDevId = verifyWithSquidDevId;
36
+ function omitSquidDevId(appId) {
37
+ const parsedAppId = parseAppId(appId);
38
+ return appIdWithEnvironmentId(parsedAppId.appId, parsedAppId.environmentId);
39
+ }
40
+ exports.omitSquidDevId = omitSquidDevId;
41
41
  //# sourceMappingURL=communication.types.js.map
@@ -1,24 +1,24 @@
1
- import { AppId, ClientId } from './communication.types';
2
- export type AuthType = 'Bearer' | 'ApiKey';
3
- export interface AuthWithBearer {
4
- type: 'Bearer';
5
- userId: string;
6
- expiration: number;
7
- attributes: Record<string, any>;
8
- }
9
- export interface AuthWithApiKey {
10
- type: 'ApiKey';
11
- apiKey: string;
12
- }
13
- export type Auth = AuthWithBearer | AuthWithApiKey;
14
- export interface AuthToken {
15
- type: AuthType;
16
- token: string;
17
- integrationId?: string;
18
- }
19
- export interface RunContext {
20
- appId: AppId;
21
- clientId?: ClientId;
22
- sourceIp?: string;
23
- headers?: Record<string, any>;
24
- }
1
+ import { AppId, ClientId } from './communication.types';
2
+ export type AuthType = 'Bearer' | 'ApiKey';
3
+ export interface AuthWithBearer {
4
+ type: 'Bearer';
5
+ userId: string;
6
+ expiration: number;
7
+ attributes: Record<string, any>;
8
+ }
9
+ export interface AuthWithApiKey {
10
+ type: 'ApiKey';
11
+ apiKey: string;
12
+ }
13
+ export type Auth = AuthWithBearer | AuthWithApiKey;
14
+ export interface AuthToken {
15
+ type: AuthType;
16
+ token: string;
17
+ integrationId?: string;
18
+ }
19
+ export interface RunContext {
20
+ appId: AppId;
21
+ clientId?: ClientId;
22
+ sourceIp?: string;
23
+ headers?: Record<string, any>;
24
+ }
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=context.types.js.map
@@ -1,5 +1,5 @@
1
- export declare class DistributedLockContext {
2
- readonly mutex: string;
3
- readonly exclusive: boolean;
4
- constructor(mutex: string, exclusive: boolean);
5
- }
1
+ export declare class DistributedLockContext {
2
+ readonly mutex: string;
3
+ readonly exclusive: boolean;
4
+ constructor(mutex: string, exclusive: boolean);
5
+ }
@@ -1,11 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DistributedLockContext = void 0;
4
- class DistributedLockContext {
5
- constructor(mutex, exclusive) {
6
- this.mutex = mutex;
7
- this.exclusive = exclusive;
8
- }
9
- }
10
- exports.DistributedLockContext = DistributedLockContext;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DistributedLockContext = void 0;
4
+ class DistributedLockContext {
5
+ constructor(mutex, exclusive) {
6
+ this.mutex = mutex;
7
+ this.exclusive = exclusive;
8
+ }
9
+ }
10
+ exports.DistributedLockContext = DistributedLockContext;
11
11
  //# sourceMappingURL=distributed-lock.context.js.map
@@ -1,32 +1,32 @@
1
- import { IntegrationId } from './communication.types';
2
- export type FieldName<T = any> = string & keyof T;
3
- export type PrimitiveFieldType = string | number | boolean | null | Date;
4
- export type FieldType = PrimitiveFieldType | Array<FieldType> | {
5
- [key: string]: FieldType;
6
- };
7
- export type DocId = string;
8
- export type DocIdObj = Record<FieldName, any>;
9
- export type CollectionName = string;
10
- export type FullCollectionName = string;
11
- export type DocTimestamp = number;
12
- export declare const SquidPlaceholderId = "__squidId";
13
- export interface SquidDocIdObj {
14
- collectionName: CollectionName;
15
- docId: DocId;
16
- integrationId: IntegrationId;
17
- }
18
- export interface BeforeAndAfterDocs<T = SquidDocument> {
19
- before: T | undefined;
20
- after: T | undefined;
21
- }
22
- export type SquidDocId = string;
23
- export interface SquidDocument {
24
- __docId__: DocId;
25
- __ts__: DocTimestamp;
26
- [fieldName: string]: FieldType | undefined;
27
- }
28
- export type DocumentData = Record<FieldName, any | undefined>;
29
- export declare function parseSquidDocId(squidDocId: SquidDocId): SquidDocIdObj;
30
- export declare function getSquidDocId(squidDocIdObj: SquidDocIdObj): SquidDocId;
31
- export declare function getSquidDocId(docId: DocId, collectionName: CollectionName, integrationId: IntegrationId): SquidDocId;
32
- export declare function hasDocumentDiff(beforeDoc: SquidDocument | undefined, afterDoc: SquidDocument | undefined): boolean;
1
+ import { IntegrationId } from './communication.types';
2
+ export type FieldName<T = any> = string & keyof T;
3
+ export type PrimitiveFieldType = string | number | boolean | null | Date;
4
+ export type FieldType = PrimitiveFieldType | Array<FieldType> | {
5
+ [key: string]: FieldType;
6
+ };
7
+ export type DocId = string;
8
+ export type DocIdObj = Record<FieldName, any>;
9
+ export type CollectionName = string;
10
+ export type FullCollectionName = string;
11
+ export type DocTimestamp = number;
12
+ export declare const SquidPlaceholderId = "__squidId";
13
+ export interface SquidDocIdObj {
14
+ collectionName: CollectionName;
15
+ docId: DocId;
16
+ integrationId: IntegrationId;
17
+ }
18
+ export interface BeforeAndAfterDocs<T = SquidDocument> {
19
+ before: T | undefined;
20
+ after: T | undefined;
21
+ }
22
+ export type SquidDocId = string;
23
+ export interface SquidDocument {
24
+ __docId__: DocId;
25
+ __ts__: DocTimestamp;
26
+ [fieldName: string]: FieldType | undefined;
27
+ }
28
+ export type DocumentData = Record<FieldName, any | undefined>;
29
+ export declare function parseSquidDocId(squidDocId: SquidDocId): SquidDocIdObj;
30
+ export declare function getSquidDocId(squidDocIdObj: SquidDocIdObj): SquidDocId;
31
+ export declare function getSquidDocId(docId: DocId, collectionName: CollectionName, integrationId: IntegrationId): SquidDocId;
32
+ export declare function hasDocumentDiff(beforeDoc: SquidDocument | undefined, afterDoc: SquidDocument | undefined): boolean;
@@ -1,51 +1,51 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hasDocumentDiff = exports.getSquidDocId = exports.parseSquidDocId = exports.SquidPlaceholderId = void 0;
4
- const deep_diff_1 = require("deep-diff");
5
- const nullish_1 = require("./utils/nullish");
6
- const serialization_1 = require("./utils/serialization");
7
- exports.SquidPlaceholderId = '__squidId';
8
- function parseSquidDocId(squidDocId) {
9
- return (0, serialization_1.deserializeObj)(squidDocId);
10
- }
11
- exports.parseSquidDocId = parseSquidDocId;
12
- function getSquidDocId(...args) {
13
- const [a, b, c] = args;
14
- const squidDocIdObjObj = typeof a === 'object' ? a : { docId: a, collectionName: b, integrationId: c };
15
- if (!squidDocIdObjObj.integrationId)
16
- squidDocIdObjObj.integrationId = undefined;
17
- return (0, serialization_1.normalizeJsonAsString)(squidDocIdObjObj);
18
- }
19
- exports.getSquidDocId = getSquidDocId;
20
- function hasDocumentDiff(beforeDoc, afterDoc) {
21
- const diffs = (0, deep_diff_1.default)(beforeDoc, afterDoc) || [];
22
- const ignoredKeys = ['__docId__', '__ts__'];
23
- const docIdDiff = diffs.find((diff) => {
24
- var _a;
25
- return ((_a = diff.path) === null || _a === void 0 ? void 0 : _a[0]) === '__docId__';
26
- });
27
- if (docIdDiff) {
28
- if (docIdDiff.kind !== 'E' || !docIdDiff.rhs) {
29
- throw new Error(`Unexpected diff for __docId__: ${(0, serialization_1.normalizeJsonAsString)(docIdDiff)}`);
30
- }
31
- const docIdObj = parseSquidDocId(docIdDiff.rhs + '');
32
- ignoredKeys.push(...Object.keys(docIdObj));
33
- }
34
- const diff = diffs === null || diffs === void 0 ? void 0 : diffs.find((diff, index) => {
35
- var _a;
36
- if (ignoredKeys.includes((_a = diff.path) === null || _a === void 0 ? void 0 : _a[0]))
37
- return false;
38
- switch (diff.kind) {
39
- case 'N':
40
- return (0, nullish_1.isNotNullish)(diff.rhs);
41
- case 'E':
42
- case 'D':
43
- case 'A':
44
- return true;
45
- }
46
- return false;
47
- });
48
- return !!diff;
49
- }
50
- exports.hasDocumentDiff = hasDocumentDiff;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hasDocumentDiff = exports.getSquidDocId = exports.parseSquidDocId = exports.SquidPlaceholderId = void 0;
4
+ const deep_diff_1 = require("deep-diff");
5
+ const nullish_1 = require("./utils/nullish");
6
+ const serialization_1 = require("./utils/serialization");
7
+ exports.SquidPlaceholderId = '__squidId';
8
+ function parseSquidDocId(squidDocId) {
9
+ return (0, serialization_1.deserializeObj)(squidDocId);
10
+ }
11
+ exports.parseSquidDocId = parseSquidDocId;
12
+ function getSquidDocId(...args) {
13
+ const [a, b, c] = args;
14
+ const squidDocIdObjObj = typeof a === 'object' ? a : { docId: a, collectionName: b, integrationId: c };
15
+ if (!squidDocIdObjObj.integrationId)
16
+ squidDocIdObjObj.integrationId = undefined;
17
+ return (0, serialization_1.normalizeJsonAsString)(squidDocIdObjObj);
18
+ }
19
+ exports.getSquidDocId = getSquidDocId;
20
+ function hasDocumentDiff(beforeDoc, afterDoc) {
21
+ const diffs = (0, deep_diff_1.default)(beforeDoc, afterDoc) || [];
22
+ const ignoredKeys = ['__docId__', '__ts__'];
23
+ const docIdDiff = diffs.find((diff) => {
24
+ var _a;
25
+ return ((_a = diff.path) === null || _a === void 0 ? void 0 : _a[0]) === '__docId__';
26
+ });
27
+ if (docIdDiff) {
28
+ if (docIdDiff.kind !== 'E' || !docIdDiff.rhs) {
29
+ throw new Error(`Unexpected diff for __docId__: ${(0, serialization_1.normalizeJsonAsString)(docIdDiff)}`);
30
+ }
31
+ const docIdObj = parseSquidDocId(docIdDiff.rhs + '');
32
+ ignoredKeys.push(...Object.keys(docIdObj));
33
+ }
34
+ const diff = diffs === null || diffs === void 0 ? void 0 : diffs.find((diff, index) => {
35
+ var _a;
36
+ if (ignoredKeys.includes((_a = diff.path) === null || _a === void 0 ? void 0 : _a[0]))
37
+ return false;
38
+ switch (diff.kind) {
39
+ case 'N':
40
+ return (0, nullish_1.isNotNullish)(diff.rhs);
41
+ case 'E':
42
+ case 'D':
43
+ case 'A':
44
+ return true;
45
+ }
46
+ return false;
47
+ });
48
+ return !!diff;
49
+ }
50
+ exports.hasDocumentDiff = hasDocumentDiff;
51
51
  //# sourceMappingURL=document.types.js.map
@@ -1,14 +1,14 @@
1
- interface GraphQlRequest {
2
- isGraphiQL: boolean;
3
- query?: string;
4
- operationName?: string;
5
- variables?: string | Record<string, any>;
6
- }
7
- export declare class GraphqlContext {
8
- readonly isGraphiQL: boolean;
9
- readonly query: string | undefined;
10
- readonly variables: string | Record<string, any> | undefined;
11
- readonly operationName: string | undefined;
12
- constructor(graphQlRequest: GraphQlRequest);
13
- }
14
- export {};
1
+ interface GraphQlRequest {
2
+ isGraphiQL: boolean;
3
+ query?: string;
4
+ operationName?: string;
5
+ variables?: string | Record<string, any>;
6
+ }
7
+ export declare class GraphqlContext {
8
+ readonly isGraphiQL: boolean;
9
+ readonly query: string | undefined;
10
+ readonly variables: string | Record<string, any> | undefined;
11
+ readonly operationName: string | undefined;
12
+ constructor(graphQlRequest: GraphQlRequest);
13
+ }
14
+ export {};
@@ -1,13 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GraphqlContext = void 0;
4
- class GraphqlContext {
5
- constructor(graphQlRequest) {
6
- this.isGraphiQL = graphQlRequest.isGraphiQL;
7
- this.query = graphQlRequest.query;
8
- this.operationName = graphQlRequest.operationName;
9
- this.variables = graphQlRequest.variables;
10
- }
11
- }
12
- exports.GraphqlContext = GraphqlContext;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GraphqlContext = void 0;
4
+ class GraphqlContext {
5
+ constructor(graphQlRequest) {
6
+ this.isGraphiQL = graphQlRequest.isGraphiQL;
7
+ this.query = graphQlRequest.query;
8
+ this.operationName = graphQlRequest.operationName;
9
+ this.variables = graphQlRequest.variables;
10
+ }
11
+ }
12
+ exports.GraphqlContext = GraphqlContext;
13
13
  //# sourceMappingURL=graphql.context.js.map
@@ -1,11 +1,11 @@
1
- import { IntrospectionQuery } from 'graphql';
2
- export { ExecutionResult, IntrospectionQuery } from 'graphql';
3
- export interface GraphQLRequest {
4
- operationName?: string;
5
- query?: string;
6
- variables?: string | Record<string, any>;
7
- }
8
- export interface SecureGraphQLRequest extends GraphQLRequest {
9
- isGraphiQL: boolean;
10
- }
11
- export declare const EmptyIntrospection: IntrospectionQuery;
1
+ import { IntrospectionQuery } from 'graphql';
2
+ export { ExecutionResult, IntrospectionQuery } from 'graphql';
3
+ export interface GraphQLRequest {
4
+ operationName?: string;
5
+ query?: string;
6
+ variables?: string | Record<string, any>;
7
+ }
8
+ export interface SecureGraphQLRequest extends GraphQLRequest {
9
+ isGraphiQL: boolean;
10
+ }
11
+ export declare const EmptyIntrospection: IntrospectionQuery;
@@ -1,35 +1,35 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EmptyIntrospection = void 0;
4
- exports.EmptyIntrospection = {
5
- __schema: {
6
- queryType: { name: 'Query', kind: 'OBJECT' },
7
- mutationType: null,
8
- subscriptionType: null,
9
- types: [
10
- {
11
- name: 'Query',
12
- kind: 'OBJECT',
13
- fields: [
14
- {
15
- name: 'isEmpty',
16
- type: {
17
- kind: 'SCALAR',
18
- name: 'Boolean',
19
- },
20
- args: [],
21
- isDeprecated: false,
22
- deprecationReason: null,
23
- },
24
- ],
25
- interfaces: [],
26
- },
27
- {
28
- name: 'Boolean',
29
- kind: 'SCALAR',
30
- },
31
- ],
32
- directives: [],
33
- },
34
- };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EmptyIntrospection = void 0;
4
+ exports.EmptyIntrospection = {
5
+ __schema: {
6
+ queryType: { name: 'Query', kind: 'OBJECT' },
7
+ mutationType: null,
8
+ subscriptionType: null,
9
+ types: [
10
+ {
11
+ name: 'Query',
12
+ kind: 'OBJECT',
13
+ fields: [
14
+ {
15
+ name: 'isEmpty',
16
+ type: {
17
+ kind: 'SCALAR',
18
+ name: 'Boolean',
19
+ },
20
+ args: [],
21
+ isDeprecated: false,
22
+ deprecationReason: null,
23
+ },
24
+ ],
25
+ interfaces: [],
26
+ },
27
+ {
28
+ name: 'Boolean',
29
+ kind: 'SCALAR',
30
+ },
31
+ ],
32
+ directives: [],
33
+ },
34
+ };
35
35
  //# sourceMappingURL=graphql.types.js.map
@@ -1,4 +1,4 @@
1
- export interface HeartbeatProvider {
2
- checkHeartbeat(): Promise<void>;
3
- }
4
- export declare function checkAllHeartbeatProviders(heartbeatProviders: Record<string, HeartbeatProvider>): Promise<void>;
1
+ export interface HeartbeatProvider {
2
+ checkHeartbeat(): Promise<void>;
3
+ }
4
+ export declare function checkAllHeartbeatProviders(heartbeatProviders: Record<string, HeartbeatProvider>): Promise<void>;
@@ -1,17 +1,17 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.checkAllHeartbeatProviders = void 0;
4
- const rxjs_1 = require("rxjs");
5
- async function checkAllHeartbeatProviders(heartbeatProviders) {
6
- await Promise.all(Object.entries(heartbeatProviders).map(async ([id, provider]) => {
7
- try {
8
- return await (0, rxjs_1.firstValueFrom)((0, rxjs_1.from)(provider.checkHeartbeat()).pipe((0, rxjs_1.timeout)(5000), (0, rxjs_1.map)(() => true)));
9
- }
10
- catch (e) {
11
- console.log(`Error in heartbeat provider: ${id}`, e);
12
- throw e;
13
- }
14
- }));
15
- }
16
- exports.checkAllHeartbeatProviders = checkAllHeartbeatProviders;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkAllHeartbeatProviders = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ async function checkAllHeartbeatProviders(heartbeatProviders) {
6
+ await Promise.all(Object.entries(heartbeatProviders).map(async ([id, provider]) => {
7
+ try {
8
+ return await (0, rxjs_1.firstValueFrom)((0, rxjs_1.from)(provider.checkHeartbeat()).pipe((0, rxjs_1.timeout)(5000), (0, rxjs_1.map)(() => true)));
9
+ }
10
+ catch (e) {
11
+ console.log(`Error in heartbeat provider: ${id}`, e);
12
+ throw e;
13
+ }
14
+ }));
15
+ }
16
+ exports.checkAllHeartbeatProviders = checkAllHeartbeatProviders;
17
17
  //# sourceMappingURL=heartbeat.types.js.map
@@ -1,50 +1,50 @@
1
- export declare enum HttpStatus {
2
- CONTINUE = 100,
3
- SWITCHING_PROTOCOLS = 101,
4
- PROCESSING = 102,
5
- EARLYHINTS = 103,
6
- OK = 200,
7
- CREATED = 201,
8
- ACCEPTED = 202,
9
- NON_AUTHORITATIVE_INFORMATION = 203,
10
- NO_CONTENT = 204,
11
- RESET_CONTENT = 205,
12
- PARTIAL_CONTENT = 206,
13
- AMBIGUOUS = 300,
14
- MOVED_PERMANENTLY = 301,
15
- FOUND = 302,
16
- SEE_OTHER = 303,
17
- NOT_MODIFIED = 304,
18
- TEMPORARY_REDIRECT = 307,
19
- PERMANENT_REDIRECT = 308,
20
- BAD_REQUEST = 400,
21
- UNAUTHORIZED = 401,
22
- PAYMENT_REQUIRED = 402,
23
- FORBIDDEN = 403,
24
- NOT_FOUND = 404,
25
- METHOD_NOT_ALLOWED = 405,
26
- NOT_ACCEPTABLE = 406,
27
- PROXY_AUTHENTICATION_REQUIRED = 407,
28
- REQUEST_TIMEOUT = 408,
29
- CONFLICT = 409,
30
- GONE = 410,
31
- LENGTH_REQUIRED = 411,
32
- PRECONDITION_FAILED = 412,
33
- PAYLOAD_TOO_LARGE = 413,
34
- URI_TOO_LONG = 414,
35
- UNSUPPORTED_MEDIA_TYPE = 415,
36
- REQUESTED_RANGE_NOT_SATISFIABLE = 416,
37
- EXPECTATION_FAILED = 417,
38
- I_AM_A_TEAPOT = 418,
39
- MISDIRECTED = 421,
40
- UNPROCESSABLE_ENTITY = 422,
41
- FAILED_DEPENDENCY = 424,
42
- PRECONDITION_REQUIRED = 428,
43
- TOO_MANY_REQUESTS = 429,
44
- INTERNAL_SERVER_ERROR = 500,
45
- NOT_IMPLEMENTED = 501,
46
- BAD_GATEWAY = 502,
47
- SERVICE_UNAVAILABLE = 503,
48
- GATEWAY_TIMEOUT = 504,
49
- HTTP_VERSION_NOT_SUPPORTED = 505
50
- }
1
+ export declare enum HttpStatus {
2
+ CONTINUE = 100,
3
+ SWITCHING_PROTOCOLS = 101,
4
+ PROCESSING = 102,
5
+ EARLYHINTS = 103,
6
+ OK = 200,
7
+ CREATED = 201,
8
+ ACCEPTED = 202,
9
+ NON_AUTHORITATIVE_INFORMATION = 203,
10
+ NO_CONTENT = 204,
11
+ RESET_CONTENT = 205,
12
+ PARTIAL_CONTENT = 206,
13
+ AMBIGUOUS = 300,
14
+ MOVED_PERMANENTLY = 301,
15
+ FOUND = 302,
16
+ SEE_OTHER = 303,
17
+ NOT_MODIFIED = 304,
18
+ TEMPORARY_REDIRECT = 307,
19
+ PERMANENT_REDIRECT = 308,
20
+ BAD_REQUEST = 400,
21
+ UNAUTHORIZED = 401,
22
+ PAYMENT_REQUIRED = 402,
23
+ FORBIDDEN = 403,
24
+ NOT_FOUND = 404,
25
+ METHOD_NOT_ALLOWED = 405,
26
+ NOT_ACCEPTABLE = 406,
27
+ PROXY_AUTHENTICATION_REQUIRED = 407,
28
+ REQUEST_TIMEOUT = 408,
29
+ CONFLICT = 409,
30
+ GONE = 410,
31
+ LENGTH_REQUIRED = 411,
32
+ PRECONDITION_FAILED = 412,
33
+ PAYLOAD_TOO_LARGE = 413,
34
+ URI_TOO_LONG = 414,
35
+ UNSUPPORTED_MEDIA_TYPE = 415,
36
+ REQUESTED_RANGE_NOT_SATISFIABLE = 416,
37
+ EXPECTATION_FAILED = 417,
38
+ I_AM_A_TEAPOT = 418,
39
+ MISDIRECTED = 421,
40
+ UNPROCESSABLE_ENTITY = 422,
41
+ FAILED_DEPENDENCY = 424,
42
+ PRECONDITION_REQUIRED = 428,
43
+ TOO_MANY_REQUESTS = 429,
44
+ INTERNAL_SERVER_ERROR = 500,
45
+ NOT_IMPLEMENTED = 501,
46
+ BAD_GATEWAY = 502,
47
+ SERVICE_UNAVAILABLE = 503,
48
+ GATEWAY_TIMEOUT = 504,
49
+ HTTP_VERSION_NOT_SUPPORTED = 505
50
+ }