@squidcloud/local-backend 1.0.35 → 1.0.36

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 (167) 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 +207 -207
  4. package/dist/common/src/ai-assistant.schemas.js +196 -196
  5. package/dist/common/src/ai-assistant.types.d.ts +80 -80
  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 +1168 -1168
  12. package/dist/common/src/application.schemas.js +741 -741
  13. package/dist/common/src/application.types.d.ts +228 -228
  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 +73 -73
  21. package/dist/common/src/bundle-api.types.d.ts +71 -71
  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 +31 -31
  32. package/dist/common/src/document.types.js +49 -49
  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 +54 -54
  42. package/dist/common/src/index.js +70 -70
  43. package/dist/common/src/integrations/ai_assistant.types.d.ts +30 -30
  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 +236 -236
  50. package/dist/common/src/integrations/database.types.js +2 -2
  51. package/dist/common/src/integrations/index.d.ts +101 -101
  52. package/dist/common/src/integrations/index.js +105 -105
  53. package/dist/common/src/integrations/observability.types.d.ts +22 -22
  54. package/dist/common/src/integrations/observability.types.js +14 -14
  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 +58 -58
  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/index.d.ts +2 -2
  72. package/dist/common/src/query/index.js +18 -18
  73. package/dist/common/src/query/query-context.d.ts +29 -29
  74. package/dist/common/src/query/query-context.js +185 -185
  75. package/dist/common/src/query/simple-query-builder.d.ts +29 -29
  76. package/dist/common/src/query/simple-query-builder.js +114 -114
  77. package/dist/common/src/query.schemas.d.ts +6 -6
  78. package/dist/common/src/query.schemas.js +96 -96
  79. package/dist/common/src/query.types.d.ts +92 -92
  80. package/dist/common/src/query.types.js +134 -134
  81. package/dist/common/src/regions.d.ts +21 -21
  82. package/dist/common/src/regions.js +46 -46
  83. package/dist/common/src/schema/schema.types.d.ts +30 -30
  84. package/dist/common/src/schema/schema.types.js +172 -172
  85. package/dist/common/src/secret.schemas.d.ts +6 -6
  86. package/dist/common/src/secret.schemas.js +32 -32
  87. package/dist/common/src/secret.types.d.ts +49 -49
  88. package/dist/common/src/secret.types.js +5 -5
  89. package/dist/common/src/security.types.d.ts +3 -3
  90. package/dist/common/src/security.types.js +2 -2
  91. package/dist/common/src/socket.schemas.d.ts +3 -3
  92. package/dist/common/src/socket.schemas.js +58 -58
  93. package/dist/common/src/socket.types.d.ts +108 -108
  94. package/dist/common/src/socket.types.js +2 -2
  95. package/dist/common/src/time-units.d.ts +5 -5
  96. package/dist/common/src/time-units.js +8 -8
  97. package/dist/common/src/trigger.types.d.ts +15 -15
  98. package/dist/common/src/trigger.types.js +2 -2
  99. package/dist/common/src/types.d.ts +15 -15
  100. package/dist/common/src/types.js +2 -2
  101. package/dist/common/src/utils/array.d.ts +8 -8
  102. package/dist/common/src/utils/array.js +51 -51
  103. package/dist/common/src/utils/assert.d.ts +8 -8
  104. package/dist/common/src/utils/assert.js +49 -49
  105. package/dist/common/src/utils/error.d.ts +4 -4
  106. package/dist/common/src/utils/error.js +10 -10
  107. package/dist/common/src/utils/http.d.ts +2 -2
  108. package/dist/common/src/utils/http.js +38 -38
  109. package/dist/common/src/utils/id.d.ts +2 -2
  110. package/dist/common/src/utils/id.js +21 -21
  111. package/dist/common/src/utils/lock.manager.d.ts +9 -9
  112. package/dist/common/src/utils/lock.manager.js +39 -39
  113. package/dist/common/src/utils/nullish.d.ts +1 -1
  114. package/dist/common/src/utils/nullish.js +7 -7
  115. package/dist/common/src/utils/object.d.ts +6 -6
  116. package/dist/common/src/utils/object.js +89 -89
  117. package/dist/common/src/utils/serialization.d.ts +6 -6
  118. package/dist/common/src/utils/serialization.js +54 -54
  119. package/dist/common/src/utils/transforms.d.ts +18 -18
  120. package/dist/common/src/utils/transforms.js +92 -92
  121. package/dist/common/src/utils/url.d.ts +1 -1
  122. package/dist/common/src/utils/url.js +15 -15
  123. package/dist/common/src/utils/validation.d.ts +17 -17
  124. package/dist/common/src/utils/validation.js +209 -209
  125. package/dist/common/src/webhook-response.d.ts +7 -7
  126. package/dist/common/src/webhook-response.js +7 -7
  127. package/dist/internal-common/src/async-queue.d.ts +4 -4
  128. package/dist/internal-common/src/async-queue.js +17 -17
  129. package/dist/internal-common/src/code-executor.types.d.ts +13 -13
  130. package/dist/internal-common/src/code-executor.types.js +2 -2
  131. package/dist/internal-common/src/environment/environment.types.d.ts +71 -71
  132. package/dist/internal-common/src/environment/environment.types.js +2 -2
  133. package/dist/internal-common/src/environment/index.d.ts +6 -6
  134. package/dist/internal-common/src/environment/index.js +25 -25
  135. package/dist/internal-common/src/environment/local.environment.d.ts +2 -2
  136. package/dist/internal-common/src/environment/local.environment.js +59 -59
  137. package/dist/internal-common/src/index.d.ts +11 -11
  138. package/dist/internal-common/src/index.js +29 -29
  139. package/dist/internal-common/src/kafka/kafka.manager.d.ts +22 -22
  140. package/dist/internal-common/src/kafka/kafka.manager.js +128 -128
  141. package/dist/internal-common/src/kafka/kafka.types.d.ts +17 -17
  142. package/dist/internal-common/src/kafka/kafka.types.js +2 -2
  143. package/dist/internal-common/src/kafka-observability-publisher.d.ts +11 -11
  144. package/dist/internal-common/src/kafka-observability-publisher.js +20 -20
  145. package/dist/internal-common/src/local-dev.types.d.ts +31 -31
  146. package/dist/internal-common/src/local-dev.types.js +2 -2
  147. package/dist/internal-common/src/observability-publisher.d.ts +9 -9
  148. package/dist/internal-common/src/observability-publisher.js +58 -58
  149. package/dist/internal-common/src/observability.types.d.ts +17 -17
  150. package/dist/internal-common/src/observability.types.js +2 -2
  151. package/dist/internal-common/src/shutdown.manager.d.ts +20 -20
  152. package/dist/internal-common/src/shutdown.manager.js +76 -76
  153. package/dist/internal-common/src/utils.d.ts +5 -5
  154. package/dist/internal-common/src/utils.js +29 -29
  155. package/dist/local-backend/src/index.d.ts +4 -4
  156. package/dist/local-backend/src/index.js +20 -20
  157. package/dist/local-backend/src/local-backend-socket.service.d.ts +18 -18
  158. package/dist/local-backend/src/local-backend-socket.service.js +108 -108
  159. package/dist/local-backend/src/local-backend.app.d.ts +2 -2
  160. package/dist/local-backend/src/local-backend.app.js +19 -19
  161. package/dist/local-backend/src/local-backend.controller.d.ts +8 -8
  162. package/dist/local-backend/src/local-backend.controller.js +49 -49
  163. package/dist/local-backend/src/local-backend.module.d.ts +8 -8
  164. package/dist/local-backend/src/local-backend.module.js +53 -53
  165. package/dist/local-backend/src/local-backend.service.d.ts +15 -15
  166. package/dist/local-backend/src/local-backend.service.js +165 -165
  167. package/package.json +1 -1
@@ -1,135 +1,135 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseQuerySubscriptionId = exports.getQuerySubscriptionId = exports.compareOperator = exports.findQueriesForDocumentSync = exports.SimpleQueryMappingManager = exports.QueryMappingManager = void 0;
4
- const nullish_1 = require("./utils/nullish");
5
- const object_1 = require("./utils/object");
6
- const serialization_1 = require("./utils/serialization");
7
- class QueryMappingManager {
8
- }
9
- exports.QueryMappingManager = QueryMappingManager;
10
- class SimpleQueryMappingManager extends QueryMappingManager {
11
- async findQueriesForDocument(appId, doc, collectionName, integrationId) {
12
- const mapping = await this.getMapping(appId, collectionName, integrationId);
13
- if (!mapping)
14
- return [];
15
- return findQueriesForDocumentSync(mapping, doc);
16
- }
17
- }
18
- exports.SimpleQueryMappingManager = SimpleQueryMappingManager;
19
- function findQueriesForDocumentSync(mapping, doc) {
20
- var _a;
21
- const result = [...(mapping.unconditional || [])];
22
- const ignoredMappedId = new Set();
23
- const mappedIdFoundMap = new Map();
24
- for (const [encodedFieldName, fieldMapping] of Object.entries(mapping.conditional || {})) {
25
- const fieldName = (0, serialization_1.decodeValueForMapping)(encodedFieldName);
26
- for (const [operator, operatorMapping] of Object.entries(fieldMapping)) {
27
- const matchedMappedId = [];
28
- const valueInDocument = (_a = (0, object_1.getInPath)(doc, fieldName)) !== null && _a !== void 0 ? _a : null;
29
- const encodedValueInDocument = (0, serialization_1.encodeValueForMapping)(valueInDocument);
30
- switch (operator) {
31
- case '==': {
32
- matchedMappedId.push(...(operatorMapping[encodedValueInDocument] || []));
33
- break;
34
- }
35
- case '!=': {
36
- const matchedSubscriptionIds = operatorMapping[encodedValueInDocument] || [];
37
- matchedSubscriptionIds.forEach((qsi) => ignoredMappedId.add(qsi));
38
- const restOfValues = Object.entries(operatorMapping).filter(([value]) => value !== encodedValueInDocument);
39
- for (const [ignored, mappedId] of restOfValues) {
40
- matchedMappedId.push(...mappedId);
41
- }
42
- break;
43
- }
44
- case '<':
45
- case '<=':
46
- case '>':
47
- case '>=':
48
- case 'like':
49
- case 'not like':
50
- case 'like_cs':
51
- case 'not like_cs': {
52
- if ((0, nullish_1.isNotNullish)(valueInDocument)) {
53
- matchedMappedId.push(...Object.entries(operatorMapping)
54
- .filter(([conditionValue]) => compareOperator((0, serialization_1.decodeValueForMapping)(conditionValue), valueInDocument, operator))
55
- .reduce((current, [ignored, matchedMappedId]) => {
56
- current.push(...matchedMappedId);
57
- return current;
58
- }, []));
59
- }
60
- break;
61
- }
62
- default:
63
- throw new Error('Unsupported operator: ' + operator);
64
- }
65
- for (const mappedId of matchedMappedId) {
66
- mappedIdFoundMap.set(mappedId, (mappedIdFoundMap.get(mappedId) || 0) + 1);
67
- }
68
- }
69
- }
70
- for (const [mappedId, matchCount] of mappedIdFoundMap.entries()) {
71
- if (ignoredMappedId.has(mappedId))
72
- continue;
73
- if (matchCount >= mapping.queriesMetadata[mappedId].condCount) {
74
- result.push(mappedId);
75
- }
76
- }
77
- return result;
78
- }
79
- exports.findQueriesForDocumentSync = findQueriesForDocumentSync;
80
- function compareOperator(conditionValue, valueInDocument, operator) {
81
- if (conditionValue === null || valueInDocument === null)
82
- return false;
83
- switch (operator) {
84
- case '<':
85
- return valueInDocument < conditionValue;
86
- case '<=':
87
- return valueInDocument <= conditionValue;
88
- case '>':
89
- return valueInDocument > conditionValue;
90
- case '>=':
91
- return valueInDocument >= conditionValue;
92
- case 'like':
93
- return (typeof valueInDocument === 'string' &&
94
- typeof conditionValue === 'string' &&
95
- isStringMatch(valueInDocument, conditionValue, false));
96
- case 'not like':
97
- return !(typeof valueInDocument === 'string' &&
98
- typeof conditionValue === 'string' &&
99
- isStringMatch(valueInDocument, conditionValue, false));
100
- case 'like_cs':
101
- return (typeof valueInDocument === 'string' &&
102
- typeof conditionValue === 'string' &&
103
- isStringMatch(valueInDocument, conditionValue, true));
104
- case 'not like_cs':
105
- return !(typeof valueInDocument === 'string' &&
106
- typeof conditionValue === 'string' &&
107
- isStringMatch(valueInDocument, conditionValue, true));
108
- default:
109
- throw new Error(`Unsupported operator comparison: ${operator}`);
110
- }
111
- }
112
- exports.compareOperator = compareOperator;
113
- function isStringMatch(str, pattern, caseSensitive) {
114
- if (!caseSensitive) {
115
- str = str.toLowerCase();
116
- pattern = pattern.toLowerCase();
117
- }
118
- const escapedPattern = pattern.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
119
- const regexPattern = escapedPattern.replace(/%/g, '.*');
120
- const regex = new RegExp(`^${regexPattern}$`);
121
- return regex.test(str);
122
- }
123
- function getQuerySubscriptionId(clientId, clientRequestId) {
124
- return `${clientId}_${clientRequestId}`;
125
- }
126
- exports.getQuerySubscriptionId = getQuerySubscriptionId;
127
- function parseQuerySubscriptionId(querySubscriptionId) {
128
- const splitString = querySubscriptionId.split('_');
129
- return {
130
- clientId: splitString[0],
131
- clientRequestId: splitString[1],
132
- };
133
- }
134
- exports.parseQuerySubscriptionId = parseQuerySubscriptionId;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseQuerySubscriptionId = exports.getQuerySubscriptionId = exports.compareOperator = exports.findQueriesForDocumentSync = exports.SimpleQueryMappingManager = exports.QueryMappingManager = void 0;
4
+ const nullish_1 = require("./utils/nullish");
5
+ const object_1 = require("./utils/object");
6
+ const serialization_1 = require("./utils/serialization");
7
+ class QueryMappingManager {
8
+ }
9
+ exports.QueryMappingManager = QueryMappingManager;
10
+ class SimpleQueryMappingManager extends QueryMappingManager {
11
+ async findQueriesForDocument(appId, doc, collectionName, integrationId) {
12
+ const mapping = await this.getMapping(appId, collectionName, integrationId);
13
+ if (!mapping)
14
+ return [];
15
+ return findQueriesForDocumentSync(mapping, doc);
16
+ }
17
+ }
18
+ exports.SimpleQueryMappingManager = SimpleQueryMappingManager;
19
+ function findQueriesForDocumentSync(mapping, doc) {
20
+ var _a;
21
+ const result = [...(mapping.unconditional || [])];
22
+ const ignoredMappedId = new Set();
23
+ const mappedIdFoundMap = new Map();
24
+ for (const [encodedFieldName, fieldMapping] of Object.entries(mapping.conditional || {})) {
25
+ const fieldName = (0, serialization_1.decodeValueForMapping)(encodedFieldName);
26
+ for (const [operator, operatorMapping] of Object.entries(fieldMapping)) {
27
+ const matchedMappedId = [];
28
+ const valueInDocument = (_a = (0, object_1.getInPath)(doc, fieldName)) !== null && _a !== void 0 ? _a : null;
29
+ const encodedValueInDocument = (0, serialization_1.encodeValueForMapping)(valueInDocument);
30
+ switch (operator) {
31
+ case '==': {
32
+ matchedMappedId.push(...(operatorMapping[encodedValueInDocument] || []));
33
+ break;
34
+ }
35
+ case '!=': {
36
+ const matchedSubscriptionIds = operatorMapping[encodedValueInDocument] || [];
37
+ matchedSubscriptionIds.forEach((qsi) => ignoredMappedId.add(qsi));
38
+ const restOfValues = Object.entries(operatorMapping).filter(([value]) => value !== encodedValueInDocument);
39
+ for (const [ignored, mappedId] of restOfValues) {
40
+ matchedMappedId.push(...mappedId);
41
+ }
42
+ break;
43
+ }
44
+ case '<':
45
+ case '<=':
46
+ case '>':
47
+ case '>=':
48
+ case 'like':
49
+ case 'not like':
50
+ case 'like_cs':
51
+ case 'not like_cs': {
52
+ if ((0, nullish_1.isNotNullish)(valueInDocument)) {
53
+ matchedMappedId.push(...Object.entries(operatorMapping)
54
+ .filter(([conditionValue]) => compareOperator((0, serialization_1.decodeValueForMapping)(conditionValue), valueInDocument, operator))
55
+ .reduce((current, [ignored, matchedMappedId]) => {
56
+ current.push(...matchedMappedId);
57
+ return current;
58
+ }, []));
59
+ }
60
+ break;
61
+ }
62
+ default:
63
+ throw new Error('Unsupported operator: ' + operator);
64
+ }
65
+ for (const mappedId of matchedMappedId) {
66
+ mappedIdFoundMap.set(mappedId, (mappedIdFoundMap.get(mappedId) || 0) + 1);
67
+ }
68
+ }
69
+ }
70
+ for (const [mappedId, matchCount] of mappedIdFoundMap.entries()) {
71
+ if (ignoredMappedId.has(mappedId))
72
+ continue;
73
+ if (matchCount >= mapping.queriesMetadata[mappedId].condCount) {
74
+ result.push(mappedId);
75
+ }
76
+ }
77
+ return result;
78
+ }
79
+ exports.findQueriesForDocumentSync = findQueriesForDocumentSync;
80
+ function compareOperator(conditionValue, valueInDocument, operator) {
81
+ if (conditionValue === null || valueInDocument === null)
82
+ return false;
83
+ switch (operator) {
84
+ case '<':
85
+ return valueInDocument < conditionValue;
86
+ case '<=':
87
+ return valueInDocument <= conditionValue;
88
+ case '>':
89
+ return valueInDocument > conditionValue;
90
+ case '>=':
91
+ return valueInDocument >= conditionValue;
92
+ case 'like':
93
+ return (typeof valueInDocument === 'string' &&
94
+ typeof conditionValue === 'string' &&
95
+ isStringMatch(valueInDocument, conditionValue, false));
96
+ case 'not like':
97
+ return !(typeof valueInDocument === 'string' &&
98
+ typeof conditionValue === 'string' &&
99
+ isStringMatch(valueInDocument, conditionValue, false));
100
+ case 'like_cs':
101
+ return (typeof valueInDocument === 'string' &&
102
+ typeof conditionValue === 'string' &&
103
+ isStringMatch(valueInDocument, conditionValue, true));
104
+ case 'not like_cs':
105
+ return !(typeof valueInDocument === 'string' &&
106
+ typeof conditionValue === 'string' &&
107
+ isStringMatch(valueInDocument, conditionValue, true));
108
+ default:
109
+ throw new Error(`Unsupported operator comparison: ${operator}`);
110
+ }
111
+ }
112
+ exports.compareOperator = compareOperator;
113
+ function isStringMatch(str, pattern, caseSensitive) {
114
+ if (!caseSensitive) {
115
+ str = str.toLowerCase();
116
+ pattern = pattern.toLowerCase();
117
+ }
118
+ const escapedPattern = pattern.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
119
+ const regexPattern = escapedPattern.replace(/%/g, '.*');
120
+ const regex = new RegExp(`^${regexPattern}$`);
121
+ return regex.test(str);
122
+ }
123
+ function getQuerySubscriptionId(clientId, clientRequestId) {
124
+ return `${clientId}_${clientRequestId}`;
125
+ }
126
+ exports.getQuerySubscriptionId = getQuerySubscriptionId;
127
+ function parseQuerySubscriptionId(querySubscriptionId) {
128
+ const splitString = querySubscriptionId.split('_');
129
+ return {
130
+ clientId: splitString[0],
131
+ clientRequestId: splitString[1],
132
+ };
133
+ }
134
+ exports.parseQuerySubscriptionId = parseQuerySubscriptionId;
135
135
  //# sourceMappingURL=query.types.js.map
@@ -1,21 +1,21 @@
1
- export type SquidCloudId = 'aws' | 'gcp' | 'azure';
2
- export declare const SupportedSquidRegions: readonly ["us-east-1.aws"];
3
- export type SupportedSquidRegion = (typeof SupportedSquidRegions)[number];
4
- export interface SquidCloudRegion {
5
- id: string;
6
- name: string;
7
- }
8
- export interface SquidSupportedCloud {
9
- id: SquidCloudId;
10
- name: string;
11
- icon: string;
12
- regions: Array<SquidCloudRegion>;
13
- tooltip?: string;
14
- }
15
- export declare const squidSupportedRegionMap: Record<SupportedSquidRegion, SquidCloudRegion>;
16
- export declare function getSquidSupportedCloudMap(): Record<SquidCloudId, SquidSupportedCloud>;
17
- export declare function convertToSquidRegion(cloudId: SquidCloudId, region: string): SupportedSquidRegion;
18
- export declare function convertFromSquidRegion(regionAndCloud: SupportedSquidRegion): {
19
- cloudId: SquidCloudId;
20
- region: string;
21
- };
1
+ export type SquidCloudId = 'aws' | 'gcp' | 'azure';
2
+ export declare const SupportedSquidRegions: readonly ["us-east-1.aws"];
3
+ export type SupportedSquidRegion = (typeof SupportedSquidRegions)[number];
4
+ export interface SquidCloudRegion {
5
+ id: string;
6
+ name: string;
7
+ }
8
+ export interface SquidSupportedCloud {
9
+ id: SquidCloudId;
10
+ name: string;
11
+ icon: string;
12
+ regions: Array<SquidCloudRegion>;
13
+ tooltip?: string;
14
+ }
15
+ export declare const squidSupportedRegionMap: Record<SupportedSquidRegion, SquidCloudRegion>;
16
+ export declare function getSquidSupportedCloudMap(): Record<SquidCloudId, SquidSupportedCloud>;
17
+ export declare function convertToSquidRegion(cloudId: SquidCloudId, region: string): SupportedSquidRegion;
18
+ export declare function convertFromSquidRegion(regionAndCloud: SupportedSquidRegion): {
19
+ cloudId: SquidCloudId;
20
+ region: string;
21
+ };
@@ -1,47 +1,47 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.convertFromSquidRegion = exports.convertToSquidRegion = exports.getSquidSupportedCloudMap = exports.squidSupportedRegionMap = exports.SupportedSquidRegions = void 0;
4
- const nullish_1 = require("./utils/nullish");
5
- exports.SupportedSquidRegions = ['us-east-1.aws'];
6
- exports.squidSupportedRegionMap = {
7
- 'us-east-1.aws': { id: 'us-east-1', name: 'US East (N. Virginia)' },
8
- ['us-east-1.aws-dev']: { id: 'us-east-1', name: 'US East (N. Virginia - Dev)' },
9
- ['local']: { id: 'local', name: 'Local' },
10
- };
11
- function getSquidSupportedCloudMap() {
12
- return {
13
- aws: {
14
- id: 'aws',
15
- name: 'Amazon Web Services',
16
- icon: 'aws_icon',
17
- regions: [exports.squidSupportedRegionMap['us-east-1.aws']].filter(nullish_1.isNotNullish),
18
- },
19
- gcp: {
20
- id: 'gcp',
21
- name: 'Google Cloud Platform',
22
- icon: 'gcp_icon',
23
- tooltip: 'Google Cloud (GCP) support is coming soon!',
24
- regions: [],
25
- },
26
- azure: {
27
- id: 'azure',
28
- name: 'Microsoft Azure',
29
- icon: 'azure_icon',
30
- tooltip: 'Microsoft Azure support is coming soon!',
31
- regions: [],
32
- },
33
- };
34
- }
35
- exports.getSquidSupportedCloudMap = getSquidSupportedCloudMap;
36
- function convertToSquidRegion(cloudId, region) {
37
- if (region === 'local')
38
- return 'local';
39
- return `${region}.${cloudId}`;
40
- }
41
- exports.convertToSquidRegion = convertToSquidRegion;
42
- function convertFromSquidRegion(regionAndCloud) {
43
- const splitRegion = regionAndCloud.split('.');
44
- return { cloudId: splitRegion[1], region: splitRegion[0] };
45
- }
46
- exports.convertFromSquidRegion = convertFromSquidRegion;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.convertFromSquidRegion = exports.convertToSquidRegion = exports.getSquidSupportedCloudMap = exports.squidSupportedRegionMap = exports.SupportedSquidRegions = void 0;
4
+ const nullish_1 = require("./utils/nullish");
5
+ exports.SupportedSquidRegions = ['us-east-1.aws'];
6
+ exports.squidSupportedRegionMap = {
7
+ 'us-east-1.aws': { id: 'us-east-1', name: 'US East (N. Virginia)' },
8
+ ['us-east-1.aws-dev']: { id: 'us-east-1', name: 'US East (N. Virginia - Dev)' },
9
+ ['local']: { id: 'local', name: 'Local' },
10
+ };
11
+ function getSquidSupportedCloudMap() {
12
+ return {
13
+ aws: {
14
+ id: 'aws',
15
+ name: 'Amazon Web Services',
16
+ icon: 'aws_icon',
17
+ regions: [exports.squidSupportedRegionMap['us-east-1.aws']].filter(nullish_1.isNotNullish),
18
+ },
19
+ gcp: {
20
+ id: 'gcp',
21
+ name: 'Google Cloud Platform',
22
+ icon: 'gcp_icon',
23
+ tooltip: 'Google Cloud (GCP) support is coming soon!',
24
+ regions: [],
25
+ },
26
+ azure: {
27
+ id: 'azure',
28
+ name: 'Microsoft Azure',
29
+ icon: 'azure_icon',
30
+ tooltip: 'Microsoft Azure support is coming soon!',
31
+ regions: [],
32
+ },
33
+ };
34
+ }
35
+ exports.getSquidSupportedCloudMap = getSquidSupportedCloudMap;
36
+ function convertToSquidRegion(cloudId, region) {
37
+ if (region === 'local')
38
+ return 'local';
39
+ return `${region}.${cloudId}`;
40
+ }
41
+ exports.convertToSquidRegion = convertToSquidRegion;
42
+ function convertFromSquidRegion(regionAndCloud) {
43
+ const splitRegion = regionAndCloud.split('.');
44
+ return { cloudId: splitRegion[1], region: splitRegion[0] };
45
+ }
46
+ exports.convertFromSquidRegion = convertFromSquidRegion;
47
47
  //# sourceMappingURL=regions.js.map
@@ -1,30 +1,30 @@
1
- import { JSONSchema } from 'json-schema-typed';
2
- export type FieldPlaceholder = '__SQUID_SERVER_TIMESTAMP__' | '__SQUID_CLIENT_IP__' | '__SQUID_USER_ID__' | '__SQUID_API_KEY__';
3
- export type BasicFieldType = 'string' | 'integer' | 'number' | 'boolean' | 'map' | 'array' | 'any';
4
- export type CustomFieldType = 'date' | 'json' | 'objectId';
5
- export type SupportedFieldType = BasicFieldType | CustomFieldType;
6
- export declare const SUPPORTED_FIELD_TYPES_ARRAY: Array<SupportedFieldType>;
7
- type ConvertDeep<T extends JSONSchema> = Exclude<T, boolean> & {
8
- properties?: Record<string, ConvertDeep<JSONSchema>>;
9
- patternProperties?: Record<string, ConvertDeep<JSONSchema>>;
10
- nullable?: boolean;
11
- applyDefaultValueOn?: 'always' | 'empty' | 'updateOrEmpty';
12
- isDate?: boolean;
13
- isJSON?: boolean;
14
- insertable?: boolean;
15
- deletable?: boolean;
16
- };
17
- export type PropertySchema = ConvertDeep<JSONSchema>;
18
- export type TopLevelPropertySchema = PropertySchema & {
19
- primaryKey?: boolean;
20
- isComputed?: boolean;
21
- isDefaultComputed?: boolean;
22
- dataType?: string;
23
- };
24
- export type CollectionSchema = Omit<ConvertDeep<JSONSchema>, 'properties'> & {
25
- properties?: Record<string, TopLevelPropertySchema>;
26
- };
27
- export declare function compileSchema<S extends CollectionSchema>(schema: S): any;
28
- export declare function validateSchema<S extends CollectionSchema>(schema: S, data: any, updatedPaths?: Array<string>, dataBefore?: any): void;
29
- export declare function findMatchingPropertiesForKey<S extends CollectionSchema | PropertySchema>(schema: S, key: string): Array<PropertySchema>;
30
- export {};
1
+ import { JSONSchema } from 'json-schema-typed';
2
+ export type FieldPlaceholder = '__SQUID_SERVER_TIMESTAMP__' | '__SQUID_CLIENT_IP__' | '__SQUID_USER_ID__' | '__SQUID_API_KEY__';
3
+ export type BasicFieldType = 'string' | 'integer' | 'number' | 'boolean' | 'map' | 'array' | 'any';
4
+ export type CustomFieldType = 'date' | 'json' | 'objectId';
5
+ export type SupportedFieldType = BasicFieldType | CustomFieldType;
6
+ export declare const SUPPORTED_FIELD_TYPES_ARRAY: Array<SupportedFieldType>;
7
+ type ConvertDeep<T extends JSONSchema> = Exclude<T, boolean> & {
8
+ properties?: Record<string, ConvertDeep<JSONSchema>>;
9
+ patternProperties?: Record<string, ConvertDeep<JSONSchema>>;
10
+ nullable?: boolean;
11
+ applyDefaultValueOn?: 'always' | 'empty' | 'updateOrEmpty';
12
+ isDate?: boolean;
13
+ isJSON?: boolean;
14
+ insertable?: boolean;
15
+ deletable?: boolean;
16
+ };
17
+ export type PropertySchema = ConvertDeep<JSONSchema>;
18
+ export type TopLevelPropertySchema = PropertySchema & {
19
+ primaryKey?: boolean;
20
+ isComputed?: boolean;
21
+ isDefaultComputed?: boolean;
22
+ dataType?: string;
23
+ };
24
+ export type CollectionSchema = Omit<ConvertDeep<JSONSchema>, 'properties'> & {
25
+ properties?: Record<string, TopLevelPropertySchema>;
26
+ };
27
+ export declare function compileSchema<S extends CollectionSchema>(schema: S): any;
28
+ export declare function validateSchema<S extends CollectionSchema>(schema: S, data: any, updatedPaths?: Array<string>, dataBefore?: any): void;
29
+ export declare function findMatchingPropertiesForKey<S extends CollectionSchema | PropertySchema>(schema: S, key: string): Array<PropertySchema>;
30
+ export {};