ag-common 0.0.892 → 0.0.894

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 (92) hide show
  1. package/dist/api/helpers/acm.js +7 -17
  2. package/dist/api/helpers/api.js +28 -23
  3. package/dist/api/helpers/apigw.js +54 -71
  4. package/dist/api/helpers/cosmos/delete.js +81 -94
  5. package/dist/api/helpers/cosmos/get.js +170 -195
  6. package/dist/api/helpers/cosmos/index.js +23 -53
  7. package/dist/api/helpers/cosmos/write.js +88 -92
  8. package/dist/api/helpers/dynamo/delete.js +22 -52
  9. package/dist/api/helpers/dynamo/get.js +145 -135
  10. package/dist/api/helpers/dynamo/set.js +22 -29
  11. package/dist/api/helpers/enforceDynamoProvisionCap.js +5 -5
  12. package/dist/api/helpers/google/apikey.js +1 -2
  13. package/dist/api/helpers/google/gemini.js +26 -37
  14. package/dist/api/helpers/retryOnError.js +15 -26
  15. package/dist/api/helpers/s3.js +102 -121
  16. package/dist/api/helpers/ses.js +19 -26
  17. package/dist/api/helpers/sqs.js +5 -15
  18. package/dist/api/helpers/ssmInfra/dynamo.js +9 -5
  19. package/dist/api/helpers/sts.js +26 -37
  20. package/dist/api/helpers/validations.js +7 -17
  21. package/dist/api/helpers/zod.js +1 -2
  22. package/dist/common/helpers/async.js +27 -42
  23. package/dist/common/helpers/csv.js +1 -4
  24. package/dist/common/helpers/date.js +2 -2
  25. package/dist/common/helpers/fetch.js +42 -55
  26. package/dist/common/helpers/generator.js +11 -22
  27. package/dist/common/helpers/i18n.js +3 -5
  28. package/dist/common/helpers/log.js +4 -4
  29. package/dist/common/helpers/math.js +1 -2
  30. package/dist/common/helpers/node-cache.js +10 -2
  31. package/dist/common/helpers/random.js +2 -2
  32. package/dist/common/helpers/secondsInNearest.js +1 -2
  33. package/dist/common/helpers/stream.js +24 -35
  34. package/dist/common/helpers/string/redact.js +1 -2
  35. package/dist/common/helpers/withRetry.js +5 -14
  36. package/dist/common/helpers/xml.js +9 -22
  37. package/dist/node/helpers/fetch.js +22 -33
  38. package/dist/ui/components/DarkMode/Base.js +10 -5
  39. package/dist/ui/components/Markdown/index.js +4 -5
  40. package/dist/ui/components/shadcn/accordion.js +13 -36
  41. package/dist/ui/components/shadcn/alert.d.ts +1 -1
  42. package/dist/ui/components/shadcn/alert.js +3 -23
  43. package/dist/ui/components/shadcn/avatar.js +4 -24
  44. package/dist/ui/components/shadcn/button.d.ts +1 -1
  45. package/dist/ui/components/shadcn/button.js +2 -14
  46. package/dist/ui/components/shadcn/card.js +6 -35
  47. package/dist/ui/components/shadcn/checkbox.js +4 -18
  48. package/dist/ui/components/shadcn/dialog.js +17 -46
  49. package/dist/ui/components/shadcn/dropdown-list.js +2 -2
  50. package/dist/ui/components/shadcn/dropdown-menu.js +22 -58
  51. package/dist/ui/components/shadcn/input-selector.js +4 -5
  52. package/dist/ui/components/shadcn/input.js +2 -14
  53. package/dist/ui/components/shadcn/label.d.ts +1 -1
  54. package/dist/ui/components/shadcn/label.js +2 -16
  55. package/dist/ui/components/shadcn/popover.js +3 -17
  56. package/dist/ui/components/shadcn/radio-group.js +4 -17
  57. package/dist/ui/components/shadcn/scroll-area.js +9 -26
  58. package/dist/ui/components/shadcn/select.js +23 -55
  59. package/dist/ui/components/shadcn/sheet.d.ts +1 -1
  60. package/dist/ui/components/shadcn/sheet.js +13 -42
  61. package/dist/ui/components/shadcn/switch.js +3 -17
  62. package/dist/ui/components/shadcn/textarea.js +2 -14
  63. package/dist/ui/components/shadcn/toast.js +6 -4
  64. package/dist/ui/helpers/cookie/get.js +5 -1
  65. package/dist/ui/helpers/cookie/raw.js +1 -2
  66. package/dist/ui/helpers/cookie/set.js +2 -2
  67. package/dist/ui/helpers/cookie/use.js +19 -9
  68. package/dist/ui/helpers/date.js +3 -4
  69. package/dist/ui/helpers/debounce.js +1 -1
  70. package/dist/ui/helpers/extractAttributes.js +1 -2
  71. package/dist/ui/helpers/openDialog.js +1 -2
  72. package/dist/ui/helpers/routes.js +6 -4
  73. package/dist/ui/helpers/serviceWorker.js +7 -18
  74. package/dist/ui/helpers/useContextMenu.js +2 -3
  75. package/dist/ui/helpers/useElementAttribute.js +1 -1
  76. package/dist/ui/helpers/useGranularHook.js +2 -2
  77. package/dist/ui/helpers/useInterval.js +5 -7
  78. package/dist/ui/helpers/useLocalStorage.js +1 -1
  79. package/dist/ui/helpers/useOnClickOutside.js +2 -3
  80. package/dist/ui/helpers/useOnScroll.js +6 -8
  81. package/dist/ui/helpers/useOverloadPageSearch.js +1 -1
  82. package/dist/ui/helpers/useQueryString.js +2 -2
  83. package/dist/ui/helpers/useResize.js +1 -1
  84. package/dist/ui/helpers/useTimeout.js +1 -1
  85. package/dist/ui/helpers/useTooltip.js +8 -5
  86. package/dist/ui/icons/Checkmark.js +2 -5
  87. package/dist/ui/icons/Circle.js +2 -5
  88. package/dist/ui/icons/Magnify.js +2 -5
  89. package/dist/ui/icons/Sun.js +8 -11
  90. package/dist/ui/icons/Warning.js +7 -10
  91. package/dist/ui/styles/common.js +8 -20
  92. package/package.json +66 -65
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
12
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
4
  };
@@ -23,151 +14,140 @@ const node_cache_1 = __importDefault(require("node-cache"));
23
14
  const log_1 = require("../../../common/helpers/log");
24
15
  // Create a NodeCache instance with 5 second TTL
25
16
  const cache = new node_cache_1.default({ stdTTL: 5 });
26
- function getItemCosmos(container, partitionValue) {
27
- return __awaiter(this, void 0, void 0, function* () {
28
- try {
29
- const querySpec = {
30
- query: 'SELECT TOP 1 * FROM c WHERE c.PK = @val',
31
- parameters: [
32
- {
33
- name: '@val',
34
- value: partitionValue,
35
- },
36
- ],
37
- };
38
- const { resources, requestCharge } = yield container.items
39
- .query(querySpec)
40
- .fetchAll();
41
- (0, log_1.info)(`getItemCosmos:${partitionValue}. chg=${requestCharge}`);
42
- if (resources.length > 0) {
43
- return resources[0];
44
- }
45
- else {
46
- return null;
47
- }
17
+ async function getItemCosmos(container, partitionValue) {
18
+ try {
19
+ const querySpec = {
20
+ query: 'SELECT TOP 1 * FROM c WHERE c.PK = @val',
21
+ parameters: [
22
+ {
23
+ name: '@val',
24
+ value: partitionValue,
25
+ },
26
+ ],
27
+ };
28
+ const { resources, requestCharge } = await container.items
29
+ .query(querySpec)
30
+ .fetchAll();
31
+ (0, log_1.info)(`getItemCosmos:${partitionValue}. chg=${requestCharge}`);
32
+ if (resources.length > 0) {
33
+ return resources[0];
48
34
  }
49
- catch (e) {
50
- if (e.message.includes('404')) {
51
- return null;
52
- }
53
- const em = e.message;
54
- (0, log_1.error)('Error deleting item:', em);
55
- throw e;
35
+ else {
36
+ return null;
56
37
  }
57
- });
58
- }
59
- function getItemsByCosmos(container, partitionValues) {
60
- return __awaiter(this, void 0, void 0, function* () {
61
- try {
62
- if (!partitionValues.length) {
63
- return [];
64
- }
65
- const querySpec = {
66
- query: 'SELECT * FROM c WHERE ARRAY_CONTAINS(@values, c.PK)',
67
- parameters: [
68
- {
69
- name: '@values',
70
- value: partitionValues,
71
- },
72
- ],
73
- };
74
- const { resources, requestCharge } = yield container.items
75
- .query(querySpec)
76
- .fetchAll();
77
- (0, log_1.info)(`getItemsByCosmos: fetched ${resources.length} items. chg=${requestCharge}`);
78
- return resources;
38
+ }
39
+ catch (e) {
40
+ if (e.message.includes('404')) {
41
+ return null;
79
42
  }
80
- catch (e) {
81
- const em = e.message;
82
- (0, log_1.error)('Error getting multiple items:', em);
83
- throw e;
43
+ const em = e.message;
44
+ (0, log_1.error)('Error deleting item:', em);
45
+ throw e;
46
+ }
47
+ }
48
+ async function getItemsByCosmos(container, partitionValues) {
49
+ try {
50
+ if (!partitionValues.length) {
51
+ return [];
84
52
  }
85
- });
53
+ const querySpec = {
54
+ query: 'SELECT * FROM c WHERE ARRAY_CONTAINS(@values, c.PK)',
55
+ parameters: [
56
+ {
57
+ name: '@values',
58
+ value: partitionValues,
59
+ },
60
+ ],
61
+ };
62
+ const { resources, requestCharge } = await container.items
63
+ .query(querySpec)
64
+ .fetchAll();
65
+ (0, log_1.info)(`getItemsByCosmos: fetched ${resources.length} items. chg=${requestCharge}`);
66
+ return resources;
67
+ }
68
+ catch (e) {
69
+ const em = e.message;
70
+ (0, log_1.error)('Error getting multiple items:', em);
71
+ throw e;
72
+ }
86
73
  }
87
74
  function escapeSqlString(str) {
88
75
  return str.replace(/'/g, "''");
89
76
  }
90
- function queryItemsCosmos(container, query, parameters) {
91
- return __awaiter(this, void 0, void 0, function* () {
92
- try {
93
- const querySpec = {
94
- query,
95
- parameters: parameters
96
- ? Object.entries(parameters).map(([name, value]) => ({
97
- name: `@${name}`,
98
- value,
99
- }))
100
- : undefined,
101
- };
102
- const { resources, requestCharge } = yield container.items
103
- .query(querySpec)
104
- .fetchAll();
105
- return { resources, requestCharge };
106
- }
107
- catch (e) {
108
- const em = e.message;
109
- (0, log_1.error)('Error queryItemsCosmos item:', em);
110
- return { error: em };
111
- }
112
- });
77
+ async function queryItemsCosmos(container, query, parameters) {
78
+ try {
79
+ const querySpec = {
80
+ query,
81
+ parameters: parameters
82
+ ? Object.entries(parameters).map(([name, value]) => ({
83
+ name: `@${name}`,
84
+ value,
85
+ }))
86
+ : undefined,
87
+ };
88
+ const { resources, requestCharge } = await container.items
89
+ .query(querySpec)
90
+ .fetchAll();
91
+ return { resources, requestCharge };
92
+ }
93
+ catch (e) {
94
+ const em = e.message;
95
+ (0, log_1.error)('Error queryItemsCosmos item:', em);
96
+ return { error: em };
97
+ }
113
98
  }
114
- function queryItemsByText(container_1, searchFields_1) {
115
- return __awaiter(this, arguments, void 0, function* (container, searchFields, operator = 'AND') {
116
- try {
117
- const conditions = searchFields.map((field, index) => {
118
- switch (field.type) {
119
- case 'contains':
120
- return `CONTAINS(c.${field.fieldName}, @value${index}, true)`; //true to ignore case
121
- case 'equals':
122
- return `c.${field.fieldName} = @value${index}`;
123
- case 'not_equals':
124
- return `c.${field.fieldName} != @value${index}`;
125
- default:
126
- throw new Error(`Unsupported field type: ${field.type}`);
127
- }
128
- });
129
- const query = `SELECT * FROM c WHERE ${conditions.join(` ${operator} `)}`;
130
- const parameters = searchFields.reduce((acc, field, index) => {
131
- acc[`value${index}`] = escapeSqlString(field.fieldValue);
132
- return acc;
133
- }, {});
134
- const x = yield queryItemsCosmos(container, query, parameters);
135
- (0, log_1.debug)(`queryItemsByText: ${JSON.stringify(searchFields)}, operator=${operator}. chg=${x.requestCharge}`);
136
- if ('error' in x) {
137
- throw x.error;
99
+ async function queryItemsByText(container, searchFields, operator = 'AND') {
100
+ try {
101
+ const conditions = searchFields.map((field, index) => {
102
+ switch (field.type) {
103
+ case 'contains':
104
+ return `CONTAINS(c.${field.fieldName}, @value${index}, true)`; //true to ignore case
105
+ case 'equals':
106
+ return `c.${field.fieldName} = @value${index}`;
107
+ case 'not_equals':
108
+ return `c.${field.fieldName} != @value${index}`;
109
+ default:
110
+ throw new Error(`Unsupported field type: ${field.type}`);
138
111
  }
139
- return x.resources;
140
- }
141
- catch (e) {
142
- const em = e.message;
143
- (0, log_1.error)('Error queryItemsByText item:', em);
144
- return { error: em };
112
+ });
113
+ const query = `SELECT * FROM c WHERE ${conditions.join(` ${operator} `)}`;
114
+ const parameters = searchFields.reduce((acc, field, index) => {
115
+ acc[`value${index}`] = escapeSqlString(field.fieldValue);
116
+ return acc;
117
+ }, {});
118
+ const x = await queryItemsCosmos(container, query, parameters);
119
+ (0, log_1.debug)(`queryItemsByText: ${JSON.stringify(searchFields)}, operator=${operator}. chg=${x.requestCharge}`);
120
+ if ('error' in x) {
121
+ throw x.error;
145
122
  }
146
- });
123
+ return x.resources;
124
+ }
125
+ catch (e) {
126
+ const em = e.message;
127
+ (0, log_1.error)('Error queryItemsByText item:', em);
128
+ return { error: em };
129
+ }
147
130
  }
148
- function scanCosmos(container) {
149
- return __awaiter(this, void 0, void 0, function* () {
150
- try {
151
- const query = `SELECT * FROM c`;
152
- const x = yield queryItemsCosmos(container, query, {});
153
- (0, log_1.info)(`scan. chg=${x.requestCharge}`);
154
- if ('error' in x) {
155
- throw x.error;
156
- }
157
- return x.resources;
158
- }
159
- catch (e) {
160
- const em = e.message;
161
- (0, log_1.error)('Error queryItemsByText item:', em);
162
- return { error: em };
131
+ async function scanCosmos(container) {
132
+ try {
133
+ const query = `SELECT * FROM c`;
134
+ const x = await queryItemsCosmos(container, query, {});
135
+ (0, log_1.info)(`scan. chg=${x.requestCharge}`);
136
+ if ('error' in x) {
137
+ throw x.error;
163
138
  }
164
- });
139
+ return x.resources;
140
+ }
141
+ catch (e) {
142
+ const em = e.message;
143
+ (0, log_1.error)('Error queryItemsByText item:', em);
144
+ return { error: em };
145
+ }
165
146
  }
166
- function queryItemsByNumber(container, options) {
167
- return __awaiter(this, void 0, void 0, function* () {
168
- try {
169
- const { type, field, minValue = 0, limit, descending = true } = options;
170
- const query = `
147
+ async function queryItemsByNumber(container, options) {
148
+ try {
149
+ const { type, field, minValue = 0, limit, descending = true } = options;
150
+ const query = `
171
151
  SELECT * FROM c
172
152
  WHERE IS_NUMBER(c.${field})
173
153
  AND c.${field} > @minValue
@@ -175,68 +155,63 @@ function queryItemsByNumber(container, options) {
175
155
  ORDER BY c.${field} ${descending ? 'DESC' : 'ASC'}
176
156
  ${limit ? 'OFFSET 0 LIMIT @limit' : ''}
177
157
  `;
178
- const parameters = {
179
- type,
180
- minValue,
181
- };
182
- if (limit) {
183
- parameters.limit = limit;
184
- }
185
- const x = yield queryItemsCosmos(container, query, parameters);
186
- (0, log_1.debug)(`queryItemsByNumber: type=${type}, field=${field}, minValue=${minValue}, limit=${limit}. chg=${x.requestCharge}`);
187
- if ('error' in x) {
188
- throw x.error;
189
- }
190
- return x.resources;
158
+ const parameters = {
159
+ type,
160
+ minValue,
161
+ };
162
+ if (limit) {
163
+ parameters.limit = limit;
191
164
  }
192
- catch (e) {
193
- const em = e.message;
194
- (0, log_1.error)('Error queryItemsByNumber:', em);
195
- return { error: em };
165
+ const x = await queryItemsCosmos(container, query, parameters);
166
+ (0, log_1.debug)(`queryItemsByNumber: type=${type}, field=${field}, minValue=${minValue}, limit=${limit}. chg=${x.requestCharge}`);
167
+ if ('error' in x) {
168
+ throw x.error;
196
169
  }
197
- });
170
+ return x.resources;
171
+ }
172
+ catch (e) {
173
+ const em = e.message;
174
+ (0, log_1.error)('Error queryItemsByNumber:', em);
175
+ return { error: em };
176
+ }
198
177
  }
199
- function queryItemsByType(container, type) {
200
- return __awaiter(this, void 0, void 0, function* () {
201
- try {
202
- // Check if data is in cache
203
- const cacheKey = `queryItemsByType:${type}`;
204
- const cachedData = cache.get(cacheKey);
205
- if (cachedData) {
206
- (0, log_1.info)(`queryItemsByType: type=${type}. [CACHE HIT]`);
207
- return cachedData;
208
- }
209
- const query = `
178
+ async function queryItemsByType(container, type) {
179
+ try {
180
+ // Check if data is in cache
181
+ const cacheKey = `queryItemsByType:${type}`;
182
+ const cachedData = cache.get(cacheKey);
183
+ if (cachedData) {
184
+ (0, log_1.info)(`queryItemsByType: type=${type}. [CACHE HIT]`);
185
+ return cachedData;
186
+ }
187
+ const query = `
210
188
  SELECT * FROM c
211
189
  WHERE c.type = @type
212
190
  `;
213
- const parameters = {
214
- type,
215
- };
216
- const x = yield queryItemsCosmos(container, query, parameters);
217
- (0, log_1.info)(`queryItemsByType: type=${type}. chg=${x.requestCharge}`);
218
- if ('error' in x) {
219
- throw x.error;
220
- }
221
- const result = x.resources;
222
- // Store result in cache
223
- cache.set(cacheKey, result);
224
- return result;
225
- }
226
- catch (e) {
227
- const em = e.message;
228
- (0, log_1.error)('Error queryItemsByType:', em);
229
- return { error: em };
191
+ const parameters = {
192
+ type,
193
+ };
194
+ const x = await queryItemsCosmos(container, query, parameters);
195
+ (0, log_1.info)(`queryItemsByType: type=${type}. chg=${x.requestCharge}`);
196
+ if ('error' in x) {
197
+ throw x.error;
230
198
  }
231
- });
199
+ const result = x.resources;
200
+ // Store result in cache
201
+ cache.set(cacheKey, result);
202
+ return result;
203
+ }
204
+ catch (e) {
205
+ const em = e.message;
206
+ (0, log_1.error)('Error queryItemsByType:', em);
207
+ return { error: em };
208
+ }
232
209
  }
233
- function queryItemsByRelevancy(container, type, limit) {
234
- return __awaiter(this, void 0, void 0, function* () {
235
- return queryItemsByNumber(container, {
236
- type,
237
- field: 'relevancy',
238
- limit,
239
- descending: true,
240
- });
210
+ async function queryItemsByRelevancy(container, type, limit) {
211
+ return queryItemsByNumber(container, {
212
+ type,
213
+ field: 'relevancy',
214
+ limit,
215
+ descending: true,
241
216
  });
242
217
  }
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.Cosmos = void 0;
13
4
  const delete_1 = require("./delete");
@@ -15,66 +6,45 @@ const get_1 = require("./get");
15
6
  const utils_1 = require("./utils");
16
7
  const write_1 = require("./write");
17
8
  class Cosmos {
9
+ container;
18
10
  constructor(settings) {
19
11
  this.container = (0, utils_1.createContainer)(settings);
20
12
  }
21
13
  // Get operations
22
- getItem(partitionValue) {
23
- return __awaiter(this, void 0, void 0, function* () {
24
- return (0, get_1.getItemCosmos)(this.container, partitionValue);
25
- });
14
+ async getItem(partitionValue) {
15
+ return (0, get_1.getItemCosmos)(this.container, partitionValue);
26
16
  }
27
- getItemsBy(partitionValues) {
28
- return __awaiter(this, void 0, void 0, function* () {
29
- return (0, get_1.getItemsByCosmos)(this.container, partitionValues);
30
- });
17
+ async getItemsBy(partitionValues) {
18
+ return (0, get_1.getItemsByCosmos)(this.container, partitionValues);
31
19
  }
32
- queryItemsByText(searchFields_1) {
33
- return __awaiter(this, arguments, void 0, function* (searchFields, operator = 'AND') {
34
- return (0, get_1.queryItemsByText)(this.container, searchFields, operator);
35
- });
20
+ async queryItemsByText(searchFields, operator = 'AND') {
21
+ return (0, get_1.queryItemsByText)(this.container, searchFields, operator);
36
22
  }
37
- scan() {
38
- return __awaiter(this, void 0, void 0, function* () {
39
- return (0, get_1.scanCosmos)(this.container);
40
- });
23
+ async scan() {
24
+ return (0, get_1.scanCosmos)(this.container);
41
25
  }
42
- queryItemsByNumber(options) {
43
- return __awaiter(this, void 0, void 0, function* () {
44
- return (0, get_1.queryItemsByNumber)(this.container, options);
45
- });
26
+ async queryItemsByNumber(options) {
27
+ return (0, get_1.queryItemsByNumber)(this.container, options);
46
28
  }
47
- queryItemsByType(type) {
48
- return __awaiter(this, void 0, void 0, function* () {
49
- return (0, get_1.queryItemsByType)(this.container, type);
50
- });
29
+ async queryItemsByType(type) {
30
+ return (0, get_1.queryItemsByType)(this.container, type);
51
31
  }
52
- queryItemsByRelevancy(type, limit) {
53
- return __awaiter(this, void 0, void 0, function* () {
54
- return (0, get_1.queryItemsByRelevancy)(this.container, type, limit);
55
- });
32
+ async queryItemsByRelevancy(type, limit) {
33
+ return (0, get_1.queryItemsByRelevancy)(this.container, type, limit);
56
34
  }
57
35
  // Write operations
58
- putItem(item) {
59
- return __awaiter(this, void 0, void 0, function* () {
60
- return (0, write_1.putItemCosmos)(this.container, item);
61
- });
36
+ async putItem(item) {
37
+ return (0, write_1.putItemCosmos)(this.container, item);
62
38
  }
63
- putItems(items) {
64
- return __awaiter(this, void 0, void 0, function* () {
65
- return (0, write_1.putItemsCosmos)(this.container, items);
66
- });
39
+ async putItems(items) {
40
+ return (0, write_1.putItemsCosmos)(this.container, items);
67
41
  }
68
42
  // Delete operations
69
- deleteItem(pk) {
70
- return __awaiter(this, void 0, void 0, function* () {
71
- return (0, delete_1.deleteItemCosmos)(this.container, pk);
72
- });
43
+ async deleteItem(pk) {
44
+ return (0, delete_1.deleteItemCosmos)(this.container, pk);
73
45
  }
74
- deleteItemsByField(field, value) {
75
- return __awaiter(this, void 0, void 0, function* () {
76
- return (0, delete_1.deleteItemsByField)(this.container, field, value);
77
- });
46
+ async deleteItemsByField(field, value) {
47
+ return (0, delete_1.deleteItemsByField)(this.container, field, value);
78
48
  }
79
49
  }
80
50
  exports.Cosmos = Cosmos;