@squidcloud/local-backend 1.0.62 → 1.0.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) 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 -53
  42. package/dist/common/src/index.js +71 -69
  43. package/dist/common/src/index.js.map +1 -1
  44. package/dist/common/src/integrations/ai_assistant.types.d.ts +24 -24
  45. package/dist/common/src/integrations/ai_assistant.types.js +2 -2
  46. package/dist/common/src/integrations/api.types.d.ts +80 -80
  47. package/dist/common/src/integrations/api.types.js +2 -2
  48. package/dist/common/src/integrations/auth.types.d.ts +39 -39
  49. package/dist/common/src/integrations/auth.types.js +2 -2
  50. package/dist/common/src/integrations/database.types.d.ts +231 -231
  51. package/dist/common/src/integrations/database.types.js +2 -2
  52. package/dist/common/src/integrations/index.d.ts +124 -124
  53. package/dist/common/src/integrations/index.js +111 -111
  54. package/dist/common/src/integrations/observability.types.d.ts +23 -23
  55. package/dist/common/src/integrations/observability.types.js +23 -23
  56. package/dist/common/src/logger.types.d.ts +21 -21
  57. package/dist/common/src/logger.types.js +11 -11
  58. package/dist/common/src/metrics.types.d.ts +73 -73
  59. package/dist/common/src/metrics.types.js +11 -11
  60. package/dist/common/src/mutation.context.d.ts +13 -13
  61. package/dist/common/src/mutation.context.js +26 -26
  62. package/dist/common/src/mutation.schemas.d.ts +5 -5
  63. package/dist/common/src/mutation.schemas.js +114 -114
  64. package/dist/common/src/mutation.types.d.ts +63 -63
  65. package/dist/common/src/mutation.types.js +142 -142
  66. package/dist/common/src/named-query.context.d.ts +4 -4
  67. package/dist/common/src/named-query.context.js +9 -9
  68. package/dist/common/src/named-query.schemas.d.ts +3 -3
  69. package/dist/common/src/named-query.schemas.js +13 -13
  70. package/dist/common/src/named-query.types.d.ts +8 -8
  71. package/dist/common/src/named-query.types.js +2 -2
  72. package/dist/common/src/query/base-query-builder.d.ts +37 -37
  73. package/dist/common/src/query/base-query-builder.js +36 -36
  74. package/dist/common/src/query/index.d.ts +4 -4
  75. package/dist/common/src/query/index.js +20 -20
  76. package/dist/common/src/query/pagination.d.ts +42 -42
  77. package/dist/common/src/query/pagination.js +164 -164
  78. package/dist/common/src/query/query-context.d.ts +47 -47
  79. package/dist/common/src/query/query-context.js +159 -159
  80. package/dist/common/src/query/serialized-query.types.d.ts +24 -24
  81. package/dist/common/src/query/serialized-query.types.js +2 -2
  82. package/dist/common/src/query.types.d.ts +86 -86
  83. package/dist/common/src/query.types.js +153 -153
  84. package/dist/common/src/regions.d.ts +21 -21
  85. package/dist/common/src/regions.js +46 -46
  86. package/dist/common/src/schema/schema.types.d.ts +30 -30
  87. package/dist/common/src/schema/schema.types.js +172 -172
  88. package/dist/common/src/secret.schemas.d.ts +6 -6
  89. package/dist/common/src/secret.schemas.js +32 -32
  90. package/dist/common/src/secret.types.d.ts +49 -49
  91. package/dist/common/src/secret.types.js +5 -5
  92. package/dist/common/src/security.types.d.ts +3 -3
  93. package/dist/common/src/security.types.js +2 -2
  94. package/dist/common/src/socket.schemas.d.ts +3 -3
  95. package/dist/common/src/socket.schemas.js +58 -58
  96. package/dist/common/src/socket.types.d.ts +112 -108
  97. package/dist/common/src/socket.types.js +2 -2
  98. package/dist/common/src/time-units.d.ts +5 -5
  99. package/dist/common/src/time-units.js +8 -8
  100. package/dist/common/src/trigger.types.d.ts +15 -15
  101. package/dist/common/src/trigger.types.js +2 -2
  102. package/dist/common/src/types.d.ts +21 -21
  103. package/dist/common/src/types.js +2 -2
  104. package/dist/common/src/utils/array.d.ts +8 -8
  105. package/dist/common/src/utils/array.js +54 -54
  106. package/dist/common/src/utils/assert.d.ts +8 -8
  107. package/dist/common/src/utils/assert.js +49 -49
  108. package/dist/common/src/utils/error.d.ts +4 -4
  109. package/dist/common/src/utils/error.js +10 -10
  110. package/dist/common/src/utils/global.utils.d.ts +10 -0
  111. package/dist/common/src/utils/global.utils.js +47 -0
  112. package/dist/common/src/utils/global.utils.js.map +1 -0
  113. package/dist/common/src/utils/http.d.ts +2 -2
  114. package/dist/common/src/utils/http.js +40 -40
  115. package/dist/common/src/utils/http.js.map +1 -1
  116. package/dist/common/src/utils/id.d.ts +2 -2
  117. package/dist/common/src/utils/id.js +21 -21
  118. package/dist/common/src/utils/lock.manager.d.ts +9 -9
  119. package/dist/common/src/utils/lock.manager.js +39 -39
  120. package/dist/common/src/utils/nullish.d.ts +2 -2
  121. package/dist/common/src/utils/nullish.js +11 -11
  122. package/dist/common/src/utils/object.d.ts +5 -5
  123. package/dist/common/src/utils/object.js +75 -75
  124. package/dist/common/src/utils/serialization.d.ts +6 -6
  125. package/dist/common/src/utils/serialization.js +77 -77
  126. package/dist/common/src/utils/transforms.d.ts +18 -18
  127. package/dist/common/src/utils/transforms.js +92 -92
  128. package/dist/common/src/utils/url.d.ts +1 -1
  129. package/dist/common/src/utils/url.js +15 -15
  130. package/dist/common/src/utils/validation.d.ts +17 -17
  131. package/dist/common/src/utils/validation.js +209 -209
  132. package/dist/common/src/webhook-response.d.ts +6 -6
  133. package/dist/common/src/webhook-response.js +2 -2
  134. package/dist/common/src/websocket.impl.d.ts +21 -0
  135. package/dist/common/src/websocket.impl.js +75 -0
  136. package/dist/common/src/websocket.impl.js.map +1 -0
  137. package/dist/internal-common/src/async-queue.d.ts +4 -4
  138. package/dist/internal-common/src/async-queue.js +17 -17
  139. package/dist/internal-common/src/code-executor.types.d.ts +13 -13
  140. package/dist/internal-common/src/code-executor.types.js +2 -2
  141. package/dist/internal-common/src/dao.types.d.ts +46 -46
  142. package/dist/internal-common/src/dao.types.js +2 -2
  143. package/dist/internal-common/src/environment/environment.types.d.ts +74 -74
  144. package/dist/internal-common/src/environment/environment.types.js +2 -2
  145. package/dist/internal-common/src/environment/index.d.ts +6 -6
  146. package/dist/internal-common/src/environment/index.js +27 -27
  147. package/dist/internal-common/src/environment/local.environment.d.ts +2 -2
  148. package/dist/internal-common/src/environment/local.environment.js +62 -62
  149. package/dist/internal-common/src/filters/custom-exception.filter.d.ts +6 -6
  150. package/dist/internal-common/src/filters/custom-exception.filter.js +44 -44
  151. package/dist/internal-common/src/index.d.ts +14 -14
  152. package/dist/internal-common/src/index.js +32 -32
  153. package/dist/internal-common/src/interceptors/body.interceptor.d.ts +5 -5
  154. package/dist/internal-common/src/interceptors/body.interceptor.js +24 -24
  155. package/dist/internal-common/src/kafka/kafka.manager.d.ts +22 -22
  156. package/dist/internal-common/src/kafka/kafka.manager.js +129 -129
  157. package/dist/internal-common/src/kafka/kafka.types.d.ts +17 -17
  158. package/dist/internal-common/src/kafka/kafka.types.js +2 -2
  159. package/dist/internal-common/src/kafka-observability-publisher.d.ts +11 -11
  160. package/dist/internal-common/src/kafka-observability-publisher.js +20 -20
  161. package/dist/internal-common/src/local-dev.types.d.ts +35 -31
  162. package/dist/internal-common/src/local-dev.types.js +2 -2
  163. package/dist/internal-common/src/observability-publisher.d.ts +9 -9
  164. package/dist/internal-common/src/observability-publisher.js +58 -58
  165. package/dist/internal-common/src/observability.types.d.ts +17 -17
  166. package/dist/internal-common/src/observability.types.js +2 -2
  167. package/dist/internal-common/src/shutdown.manager.d.ts +20 -20
  168. package/dist/internal-common/src/shutdown.manager.js +75 -75
  169. package/dist/internal-common/src/utils.d.ts +5 -5
  170. package/dist/internal-common/src/utils.js +29 -29
  171. package/dist/local-backend/src/index.d.ts +4 -4
  172. package/dist/local-backend/src/index.js +20 -20
  173. package/dist/local-backend/src/local-backend-socket.service.d.ts +19 -18
  174. package/dist/local-backend/src/local-backend-socket.service.js +110 -107
  175. package/dist/local-backend/src/local-backend-socket.service.js.map +1 -1
  176. package/dist/local-backend/src/local-backend.app.d.ts +2 -2
  177. package/dist/local-backend/src/local-backend.app.js +19 -19
  178. package/dist/local-backend/src/local-backend.controller.d.ts +8 -8
  179. package/dist/local-backend/src/local-backend.controller.js +49 -49
  180. package/dist/local-backend/src/local-backend.module.d.ts +8 -8
  181. package/dist/local-backend/src/local-backend.module.js +53 -53
  182. package/dist/local-backend/src/local-backend.service.d.ts +15 -15
  183. package/dist/local-backend/src/local-backend.service.js +165 -165
  184. package/dist/tsconfig.build.tsbuildinfo +1 -1
  185. package/package.json +2 -2
@@ -1,154 +1,154 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseQuerySubscriptionId = exports.getQuerySubscriptionId = exports.compareOperator = exports.QueryMappingManager = exports.encodeCondition = exports.isSimpleCondition = void 0;
4
- const serialization_1 = require("./utils/serialization");
5
- const lodash_1 = require("lodash");
6
- function isSimpleCondition(condition) {
7
- return 'fieldName' in condition;
8
- }
9
- exports.isSimpleCondition = isSimpleCondition;
10
- function encodeCondition(condition) {
11
- return (0, serialization_1.normalizeJsonAsString)(condition);
12
- }
13
- exports.encodeCondition = encodeCondition;
14
- const sampleQueryMapping = {
15
- unconditional: ['cid_123'],
16
- conditional: {
17
- [encodeCondition({
18
- fields: [
19
- {
20
- fieldName: 'name',
21
- operator: '>',
22
- value: 'Yossi',
23
- },
24
- {
25
- fieldName: 'age',
26
- operator: '<',
27
- value: 10,
28
- },
29
- ],
30
- })]: ['cid_sort_order'],
31
- [encodeCondition({
32
- fieldName: 'age',
33
- operator: '==',
34
- value: 10,
35
- })]: ['cid_321'],
36
- [encodeCondition({
37
- fieldName: 'age',
38
- operator: '==',
39
- value: 11,
40
- })]: ['cid_321'],
41
- [encodeCondition({
42
- fieldName: 'age',
43
- operator: '==',
44
- value: 12,
45
- })]: ['cid_321'],
46
- [encodeCondition({
47
- fieldName: 'age',
48
- operator: '>',
49
- value: 20,
50
- })]: ['cid_456', 'cid_789'],
51
- [encodeCondition({
52
- fieldName: 'age',
53
- operator: '<',
54
- value: 20,
55
- })]: ['cid_789'],
56
- [encodeCondition({
57
- fieldName: 'name',
58
- operator: '!=',
59
- value: 'Yossi',
60
- })]: ['cid_not_in'],
61
- [encodeCondition({
62
- fieldName: 'name',
63
- operator: '!=',
64
- value: 'Nir',
65
- })]: ['cid_not_in'],
66
- },
67
- queriesMetadata: {
68
- cid_123: {
69
- condCount: 0,
70
- },
71
- cid_321: {
72
- condCount: 1,
73
- },
74
- cid_456: {
75
- condCount: 1,
76
- },
77
- cid_789: {
78
- condCount: 2,
79
- },
80
- cid_sort_order: {
81
- condCount: 1,
82
- },
83
- cid_not_in: {
84
- condCount: 2,
85
- },
86
- },
87
- };
88
- class QueryMappingManager {
89
- }
90
- exports.QueryMappingManager = QueryMappingManager;
91
- function compareOperator(conditionValue, valueInDocument, operator) {
92
- conditionValue = conditionValue instanceof Date ? conditionValue.getTime() : conditionValue !== null && conditionValue !== void 0 ? conditionValue : null;
93
- valueInDocument = valueInDocument instanceof Date ? valueInDocument.getTime() : valueInDocument !== null && valueInDocument !== void 0 ? valueInDocument : null;
94
- if (operator === '==') {
95
- return lodash_1.default.isEqual(conditionValue, valueInDocument);
96
- }
97
- if (operator === '!=') {
98
- return !lodash_1.default.isEqual(conditionValue, valueInDocument);
99
- }
100
- if (conditionValue === null || valueInDocument === null)
101
- return false;
102
- switch (operator) {
103
- case '<':
104
- return valueInDocument < conditionValue;
105
- case '<=':
106
- return valueInDocument <= conditionValue;
107
- case '>':
108
- return valueInDocument > conditionValue;
109
- case '>=':
110
- return valueInDocument >= conditionValue;
111
- case 'like':
112
- return (typeof valueInDocument === 'string' &&
113
- typeof conditionValue === 'string' &&
114
- isStringMatch(valueInDocument, conditionValue, false));
115
- case 'not like':
116
- return !(typeof valueInDocument === 'string' &&
117
- typeof conditionValue === 'string' &&
118
- isStringMatch(valueInDocument, conditionValue, false));
119
- case 'like_cs':
120
- return (typeof valueInDocument === 'string' &&
121
- typeof conditionValue === 'string' &&
122
- isStringMatch(valueInDocument, conditionValue, true));
123
- case 'not like_cs':
124
- return !(typeof valueInDocument === 'string' &&
125
- typeof conditionValue === 'string' &&
126
- isStringMatch(valueInDocument, conditionValue, true));
127
- default:
128
- throw new Error(`Unsupported operator comparison: ${operator}`);
129
- }
130
- }
131
- exports.compareOperator = compareOperator;
132
- function isStringMatch(str, pattern, caseSensitive) {
133
- if (!caseSensitive) {
134
- str = str.toLowerCase();
135
- pattern = pattern.toLowerCase();
136
- }
137
- const escapedPattern = pattern.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
138
- const regexPattern = escapedPattern.replace(/%/g, '.*');
139
- const regex = new RegExp(`^${regexPattern}$`);
140
- return regex.test(str);
141
- }
142
- function getQuerySubscriptionId(clientId, clientRequestId) {
143
- return `${clientId}_${clientRequestId}`;
144
- }
145
- exports.getQuerySubscriptionId = getQuerySubscriptionId;
146
- function parseQuerySubscriptionId(querySubscriptionId) {
147
- const splitString = querySubscriptionId.split('_');
148
- return {
149
- clientId: splitString[0],
150
- clientRequestId: splitString[1],
151
- };
152
- }
153
- exports.parseQuerySubscriptionId = parseQuerySubscriptionId;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseQuerySubscriptionId = exports.getQuerySubscriptionId = exports.compareOperator = exports.QueryMappingManager = exports.encodeCondition = exports.isSimpleCondition = void 0;
4
+ const serialization_1 = require("./utils/serialization");
5
+ const lodash_1 = require("lodash");
6
+ function isSimpleCondition(condition) {
7
+ return 'fieldName' in condition;
8
+ }
9
+ exports.isSimpleCondition = isSimpleCondition;
10
+ function encodeCondition(condition) {
11
+ return (0, serialization_1.normalizeJsonAsString)(condition);
12
+ }
13
+ exports.encodeCondition = encodeCondition;
14
+ const sampleQueryMapping = {
15
+ unconditional: ['cid_123'],
16
+ conditional: {
17
+ [encodeCondition({
18
+ fields: [
19
+ {
20
+ fieldName: 'name',
21
+ operator: '>',
22
+ value: 'Yossi',
23
+ },
24
+ {
25
+ fieldName: 'age',
26
+ operator: '<',
27
+ value: 10,
28
+ },
29
+ ],
30
+ })]: ['cid_sort_order'],
31
+ [encodeCondition({
32
+ fieldName: 'age',
33
+ operator: '==',
34
+ value: 10,
35
+ })]: ['cid_321'],
36
+ [encodeCondition({
37
+ fieldName: 'age',
38
+ operator: '==',
39
+ value: 11,
40
+ })]: ['cid_321'],
41
+ [encodeCondition({
42
+ fieldName: 'age',
43
+ operator: '==',
44
+ value: 12,
45
+ })]: ['cid_321'],
46
+ [encodeCondition({
47
+ fieldName: 'age',
48
+ operator: '>',
49
+ value: 20,
50
+ })]: ['cid_456', 'cid_789'],
51
+ [encodeCondition({
52
+ fieldName: 'age',
53
+ operator: '<',
54
+ value: 20,
55
+ })]: ['cid_789'],
56
+ [encodeCondition({
57
+ fieldName: 'name',
58
+ operator: '!=',
59
+ value: 'Yossi',
60
+ })]: ['cid_not_in'],
61
+ [encodeCondition({
62
+ fieldName: 'name',
63
+ operator: '!=',
64
+ value: 'Nir',
65
+ })]: ['cid_not_in'],
66
+ },
67
+ queriesMetadata: {
68
+ cid_123: {
69
+ condCount: 0,
70
+ },
71
+ cid_321: {
72
+ condCount: 1,
73
+ },
74
+ cid_456: {
75
+ condCount: 1,
76
+ },
77
+ cid_789: {
78
+ condCount: 2,
79
+ },
80
+ cid_sort_order: {
81
+ condCount: 1,
82
+ },
83
+ cid_not_in: {
84
+ condCount: 2,
85
+ },
86
+ },
87
+ };
88
+ class QueryMappingManager {
89
+ }
90
+ exports.QueryMappingManager = QueryMappingManager;
91
+ function compareOperator(conditionValue, valueInDocument, operator) {
92
+ conditionValue = conditionValue instanceof Date ? conditionValue.getTime() : conditionValue !== null && conditionValue !== void 0 ? conditionValue : null;
93
+ valueInDocument = valueInDocument instanceof Date ? valueInDocument.getTime() : valueInDocument !== null && valueInDocument !== void 0 ? valueInDocument : null;
94
+ if (operator === '==') {
95
+ return lodash_1.default.isEqual(conditionValue, valueInDocument);
96
+ }
97
+ if (operator === '!=') {
98
+ return !lodash_1.default.isEqual(conditionValue, valueInDocument);
99
+ }
100
+ if (conditionValue === null || valueInDocument === null)
101
+ return false;
102
+ switch (operator) {
103
+ case '<':
104
+ return valueInDocument < conditionValue;
105
+ case '<=':
106
+ return valueInDocument <= conditionValue;
107
+ case '>':
108
+ return valueInDocument > conditionValue;
109
+ case '>=':
110
+ return valueInDocument >= conditionValue;
111
+ case 'like':
112
+ return (typeof valueInDocument === 'string' &&
113
+ typeof conditionValue === 'string' &&
114
+ isStringMatch(valueInDocument, conditionValue, false));
115
+ case 'not like':
116
+ return !(typeof valueInDocument === 'string' &&
117
+ typeof conditionValue === 'string' &&
118
+ isStringMatch(valueInDocument, conditionValue, false));
119
+ case 'like_cs':
120
+ return (typeof valueInDocument === 'string' &&
121
+ typeof conditionValue === 'string' &&
122
+ isStringMatch(valueInDocument, conditionValue, true));
123
+ case 'not like_cs':
124
+ return !(typeof valueInDocument === 'string' &&
125
+ typeof conditionValue === 'string' &&
126
+ isStringMatch(valueInDocument, conditionValue, true));
127
+ default:
128
+ throw new Error(`Unsupported operator comparison: ${operator}`);
129
+ }
130
+ }
131
+ exports.compareOperator = compareOperator;
132
+ function isStringMatch(str, pattern, caseSensitive) {
133
+ if (!caseSensitive) {
134
+ str = str.toLowerCase();
135
+ pattern = pattern.toLowerCase();
136
+ }
137
+ const escapedPattern = pattern.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
138
+ const regexPattern = escapedPattern.replace(/%/g, '.*');
139
+ const regex = new RegExp(`^${regexPattern}$`);
140
+ return regex.test(str);
141
+ }
142
+ function getQuerySubscriptionId(clientId, clientRequestId) {
143
+ return `${clientId}_${clientRequestId}`;
144
+ }
145
+ exports.getQuerySubscriptionId = getQuerySubscriptionId;
146
+ function parseQuerySubscriptionId(querySubscriptionId) {
147
+ const splitString = querySubscriptionId.split('_');
148
+ return {
149
+ clientId: splitString[0],
150
+ clientRequestId: splitString[1],
151
+ };
152
+ }
153
+ exports.parseQuerySubscriptionId = parseQuerySubscriptionId;
154
154
  //# 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 {};