@webda/azure 0.0.0-stage → 4.0.0-beta.14

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 (68) hide show
  1. package/LICENSE +166 -0
  2. package/README.md +248 -2
  3. package/lib/auth.d.ts +36 -0
  4. package/lib/auth.d.ts.map +1 -0
  5. package/lib/auth.js +70 -0
  6. package/lib/auth.js.map +1 -0
  7. package/lib/deployers/arm.service.d.ts +177 -0
  8. package/lib/deployers/arm.service.d.ts.map +1 -0
  9. package/lib/deployers/arm.service.js +307 -0
  10. package/lib/deployers/arm.service.js.map +1 -0
  11. package/lib/deployers/containerapps.service.d.ts +186 -0
  12. package/lib/deployers/containerapps.service.d.ts.map +1 -0
  13. package/lib/deployers/containerapps.service.js +482 -0
  14. package/lib/deployers/containerapps.service.js.map +1 -0
  15. package/lib/deployers/functions-entrypoint.d.ts +60 -0
  16. package/lib/deployers/functions-entrypoint.d.ts.map +1 -0
  17. package/lib/deployers/functions-entrypoint.js +78 -0
  18. package/lib/deployers/functions-entrypoint.js.map +1 -0
  19. package/lib/deployers/functions.service.d.ts +96 -0
  20. package/lib/deployers/functions.service.d.ts.map +1 -0
  21. package/lib/deployers/functions.service.js +340 -0
  22. package/lib/deployers/functions.service.js.map +1 -0
  23. package/lib/deployers/functionspackager.service.d.ts +82 -0
  24. package/lib/deployers/functionspackager.service.d.ts.map +1 -0
  25. package/lib/deployers/functionspackager.service.js +157 -0
  26. package/lib/deployers/functionspackager.service.js.map +1 -0
  27. package/lib/index.d.ts +15 -0
  28. package/lib/index.d.ts.map +1 -0
  29. package/lib/index.js +18 -0
  30. package/lib/index.js.map +1 -0
  31. package/lib/services/azure-parameters.d.ts +56 -0
  32. package/lib/services/azure-parameters.d.ts.map +1 -0
  33. package/lib/services/azure-parameters.js +43 -0
  34. package/lib/services/azure-parameters.js.map +1 -0
  35. package/lib/services/blob.service.d.ts +196 -0
  36. package/lib/services/blob.service.d.ts.map +1 -0
  37. package/lib/services/blob.service.js +450 -0
  38. package/lib/services/blob.service.js.map +1 -0
  39. package/lib/services/contributors.d.ts +50 -0
  40. package/lib/services/contributors.d.ts.map +1 -0
  41. package/lib/services/contributors.js +2 -0
  42. package/lib/services/contributors.js.map +1 -0
  43. package/lib/services/cosmos.service.d.ts +253 -0
  44. package/lib/services/cosmos.service.d.ts.map +1 -0
  45. package/lib/services/cosmos.service.js +566 -0
  46. package/lib/services/cosmos.service.js.map +1 -0
  47. package/lib/services/functionserver.service.d.ts +51 -0
  48. package/lib/services/functionserver.service.d.ts.map +1 -0
  49. package/lib/services/functionserver.service.js +232 -0
  50. package/lib/services/functionserver.service.js.map +1 -0
  51. package/lib/services/keyvault.service.d.ts +106 -0
  52. package/lib/services/keyvault.service.d.ts.map +1 -0
  53. package/lib/services/keyvault.service.js +228 -0
  54. package/lib/services/keyvault.service.js.map +1 -0
  55. package/lib/services/monitorlogger.service.d.ts +117 -0
  56. package/lib/services/monitorlogger.service.d.ts.map +1 -0
  57. package/lib/services/monitorlogger.service.js +149 -0
  58. package/lib/services/monitorlogger.service.js.map +1 -0
  59. package/lib/services/servicebus.service.d.ts +224 -0
  60. package/lib/services/servicebus.service.d.ts.map +1 -0
  61. package/lib/services/servicebus.service.js +351 -0
  62. package/lib/services/servicebus.service.js.map +1 -0
  63. package/lib/template.d.ts +68 -0
  64. package/lib/template.d.ts.map +1 -0
  65. package/lib/template.js +74 -0
  66. package/lib/template.js.map +1 -0
  67. package/package.json +77 -3
  68. package/webda.module.json +1891 -0
@@ -0,0 +1,566 @@
1
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
2
+ var useValue = arguments.length > 2;
3
+ for (var i = 0; i < initializers.length; i++) {
4
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
5
+ }
6
+ return useValue ? value : void 0;
7
+ };
8
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
9
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
10
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
11
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
12
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
13
+ var _, done = false;
14
+ for (var i = decorators.length - 1; i >= 0; i--) {
15
+ var context = {};
16
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
17
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
18
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
19
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
20
+ if (kind === "accessor") {
21
+ if (result === void 0) continue;
22
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
23
+ if (_ = accept(result.get)) descriptor.get = _;
24
+ if (_ = accept(result.set)) descriptor.set = _;
25
+ if (_ = accept(result.init)) initializers.unshift(_);
26
+ }
27
+ else if (_ = accept(result)) {
28
+ if (kind === "field") initializers.unshift(_);
29
+ else descriptor[key] = _;
30
+ }
31
+ }
32
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
33
+ done = true;
34
+ };
35
+ import { CosmosClient } from "@azure/cosmos";
36
+ import { EventRepository, InstanceCache, MemoryRepository, SecretString, Store, StoreNotFoundError, StoreParameters, UpdateConditionFailError, useModelMetadata, WebdaError } from "@webda/core";
37
+ import * as QL from "@webda/ql";
38
+ import { getAzureCredential, loadAzureParameters } from "./azure-parameters.js";
39
+ import { armLiteral, armValue } from "../template.js";
40
+ /** Cosmos DB NoSQL settings. All models in the store share a typed container. */
41
+ export class CosmosStoreParameters extends StoreParameters {
42
+ constructor() {
43
+ super(...arguments);
44
+ /**
45
+ * Partition key
46
+ */
47
+ this.partitionKey = "/id";
48
+ /**
49
+ * Create if not exists
50
+ */
51
+ this.createIfNotExists = false;
52
+ }
53
+ /**
54
+ * Perform load.
55
+ * @override
56
+ */
57
+ load(params = {}) {
58
+ super.load(params);
59
+ return loadAzureParameters(this);
60
+ }
61
+ }
62
+ /**
63
+ * Translate the supported WebdaQL filter subset with bound values and quoted field identifiers.
64
+ * @param query - WebdaQL query or parsed filter
65
+ * @returns SQL text and bound parameters
66
+ */
67
+ export function cosmosQuery(query) {
68
+ const parameters = [];
69
+ const field = (path) => (path[0] === "__type" ? "c" : 'c["value"]') + path.map(part => `[${JSON.stringify(part)}]`).join("");
70
+ const bind = (value) => {
71
+ const name = `@p${parameters.length}`;
72
+ parameters.push({ name, value });
73
+ return name;
74
+ };
75
+ const translate = (expression) => {
76
+ if (expression instanceof QL.BooleanExpression)
77
+ return expression.value ? "true" : "false";
78
+ if (expression instanceof QL.AndExpression || expression instanceof QL.OrExpression) {
79
+ return expression.children.length
80
+ ? `(${expression.children.map(translate).join(` ${expression.operator} `)})`
81
+ : expression.operator === "AND"
82
+ ? "true"
83
+ : "false";
84
+ }
85
+ if (!(expression instanceof QL.ComparisonExpression))
86
+ throw new WebdaError.NotImplemented("Unsupported Cosmos query expression");
87
+ const attribute = field(expression.attribute), value = expression.value;
88
+ switch (expression.operator) {
89
+ case "=":
90
+ case "!=":
91
+ case ">":
92
+ case ">=":
93
+ case "<":
94
+ case "<=":
95
+ return `${attribute} ${expression.operator} ${bind(value)}`;
96
+ case "IN":
97
+ return `ARRAY_CONTAINS(${bind(value)}, ${attribute})`;
98
+ case "CONTAINS":
99
+ return `ARRAY_CONTAINS(${attribute}, ${bind(value)})`;
100
+ case "LIKE":
101
+ return `${attribute} LIKE ${bind(value)}`;
102
+ case "IS NULL":
103
+ return `(NOT IS_DEFINED(${attribute}) OR IS_NULL(${attribute}))`;
104
+ case "IS NOT NULL":
105
+ return `(IS_DEFINED(${attribute}) AND NOT IS_NULL(${attribute}))`;
106
+ default:
107
+ throw new WebdaError.NotImplemented(`Unsupported Cosmos query operator ${expression.operator}`);
108
+ }
109
+ };
110
+ const filter = translate(query.filter);
111
+ const order = query.orderBy?.map(item => `${field(item.field.split("."))} ${item.direction}`).join(", ");
112
+ return { query: `SELECT * FROM c WHERE ${filter}${order ? ` ORDER BY ${order}` : ""}`, parameters };
113
+ }
114
+ /** Typed Cosmos repository. A serializer envelope preserves dates, behaviors and concrete model types. */
115
+ export class CosmosRepository extends MemoryRepository {
116
+ /**
117
+ * Initialize the Azure integration.
118
+ * @param model - Model class or model identifier
119
+ * @param pks - Primary key field names
120
+ * @param container - Lazy Cosmos container accessor
121
+ * @param partitionKey - Cosmos partition key path
122
+ * @param separator - Composite primary key separator
123
+ */
124
+ constructor(model, pks, container, partitionKey = "/id", separator) {
125
+ super(model, pks, separator);
126
+ this.container = container;
127
+ this.partitionKey = partitionKey;
128
+ if (partitionKey !== "/id" &&
129
+ (!/^\/[a-zA-Z]\w*$/.test(partitionKey) ||
130
+ !pks.includes(partitionKey.slice(1)) ||
131
+ ["value", "__type", "constructor", "prototype"].includes(partitionKey.slice(1)))) {
132
+ throw new WebdaError.BadRequest("A custom Cosmos partition key must name a top-level primary key field");
133
+ }
134
+ }
135
+ /**
136
+ * Encode the model primary key as a Cosmos item identifier.
137
+ * @param primaryKey - Model primary key
138
+ * @returns The key result
139
+ */
140
+ key(primaryKey) {
141
+ return Buffer.from(this.getPrimaryKey(primaryKey).toString()).toString("base64url");
142
+ }
143
+ /**
144
+ * Resolve the partition value from the primary key.
145
+ * @param primaryKey - Model primary key
146
+ * @returns The partition result
147
+ */
148
+ partition(primaryKey) {
149
+ if (this.partitionKey === "/id")
150
+ return this.key(primaryKey);
151
+ const value = this.getPrimaryKey(primaryKey, true)[this.partitionKey.slice(1)];
152
+ if (!["string", "number", "boolean"].includes(typeof value))
153
+ throw new WebdaError.BadRequest("Cosmos partition key requires a scalar value");
154
+ return value;
155
+ }
156
+ /**
157
+ * Address a Cosmos document by its item and partition keys.
158
+ * @param primaryKey - Model primary key
159
+ * @returns The item result
160
+ */
161
+ item(primaryKey) {
162
+ return this.container().item(this.key(primaryKey), this.partition(primaryKey));
163
+ }
164
+ /**
165
+ * Serialize a model into a typed Cosmos document.
166
+ * @param item - Collection item or model instance
167
+ * @returns The document result
168
+ */
169
+ document(item) {
170
+ return {
171
+ ...JSON.parse(this.serialize(item)),
172
+ id: this.key(item),
173
+ ...(this.partitionKey === "/id" ? {} : { [this.partitionKey.slice(1)]: this.partition(item) })
174
+ };
175
+ }
176
+ /**
177
+ * Restore a typed model from a Cosmos document.
178
+ * @param document - Stored Cosmos document
179
+ * @returns The from document result
180
+ */
181
+ fromDocument(document) {
182
+ const { id: _id, _etag: _etag, _rid: _rid, _self: _self, _attachments: _attachments, _ts: _ts, ...envelope } = document;
183
+ if (this.partitionKey !== "/id")
184
+ delete envelope[this.partitionKey.slice(1)];
185
+ return this.deserialize(JSON.stringify(envelope));
186
+ }
187
+ /**
188
+ * Map Cosmos storage errors to Webda errors.
189
+ * @param primaryKey - Model primary key
190
+ * @param error - Azure SDK error
191
+ */
192
+ translateError(primaryKey, error) {
193
+ const code = error.code;
194
+ if (code === 404)
195
+ throw new StoreNotFoundError(primaryKey, this.container().id);
196
+ if (code === 412)
197
+ throw new UpdateConditionFailError(primaryKey, "_etag", "current version");
198
+ if (code === 409)
199
+ throw new WebdaError.Conflict("Cosmos item already exists");
200
+ throw error;
201
+ }
202
+ /**
203
+ * Read a Cosmos document or raise the store not-found error.
204
+ * @param primaryKey - Model primary key
205
+ * @returns The read result
206
+ */
207
+ async read(primaryKey) {
208
+ try {
209
+ const { resource } = await this.item(primaryKey).read();
210
+ if (!resource)
211
+ throw new StoreNotFoundError(primaryKey, this.container().id);
212
+ return resource;
213
+ }
214
+ catch (error) {
215
+ this.translateError(primaryKey, error);
216
+ }
217
+ }
218
+ /**
219
+ * Perform get.
220
+ * @override
221
+ */
222
+ async get(primaryKey) {
223
+ return this.fromDocument(await this.read(primaryKey));
224
+ }
225
+ /**
226
+ * Perform exists.
227
+ * @override
228
+ */
229
+ async exists(primaryKey) {
230
+ try {
231
+ await this.read(primaryKey);
232
+ return true;
233
+ }
234
+ catch (error) {
235
+ if (error instanceof StoreNotFoundError)
236
+ return false;
237
+ throw error;
238
+ }
239
+ }
240
+ /**
241
+ * Perform create.
242
+ * @override
243
+ */
244
+ async create(data, save = true) {
245
+ const item = this.buildItem(data);
246
+ if (save) {
247
+ try {
248
+ await this.container().items.create(this.document(item));
249
+ }
250
+ catch (error) {
251
+ this.translateError(this.getPrimaryKey(item), error);
252
+ }
253
+ }
254
+ return item;
255
+ }
256
+ /**
257
+ * Validate a write condition against the current document.
258
+ * @param primaryKey - Model primary key
259
+ * @param document - Stored Cosmos document
260
+ * @param field - Conditional write field
261
+ * @param expected - Expected field value
262
+ */
263
+ checkWriteCondition(primaryKey, document, field, expected) {
264
+ if (!field)
265
+ return;
266
+ const actual = field === "_etag"
267
+ ? document._etag
268
+ : field.split(".").reduce((value, key) => value?.[key], this.fromDocument(document));
269
+ if ((actual instanceof Date ? actual.toISOString() : actual) !==
270
+ (expected instanceof Date ? expected.toISOString() : expected)) {
271
+ throw new UpdateConditionFailError(primaryKey, field, expected);
272
+ }
273
+ }
274
+ /**
275
+ * Use the shared model mutation helpers, then submit the complete change atomically under the read ETag.
276
+ * @param primaryKey - Model primary key
277
+ * @param change - Model mutation applied through shared repository helpers
278
+ * @param conditionField - Conditional write field
279
+ * @param condition - Expected write condition
280
+ * @param native - Native atomic Cosmos patch operations
281
+ */
282
+ async mutate(primaryKey, change, conditionField, condition, native) {
283
+ const original = await this.read(primaryKey);
284
+ this.checkWriteCondition(primaryKey, original, conditionField, condition);
285
+ const key = this.getPrimaryKey(primaryKey).toString();
286
+ const memory = new MemoryRepository(this.model, this.pks, this.separator, new Map([[key, this.serialize(this.fromDocument(original))]]));
287
+ await change(memory);
288
+ const updated = this.document((await memory.get(primaryKey)));
289
+ if (updated.id !== original.id)
290
+ throw new WebdaError.BadRequest("Cannot change a Cosmos primary key");
291
+ const operations = native ?? [];
292
+ const path = (name) => `/value/${name.replace(/~/g, "~0").replace(/\//g, "~1")}`;
293
+ if (!native) {
294
+ for (const [name, value] of Object.entries(updated.value)) {
295
+ if (JSON.stringify(value) !== JSON.stringify(original.value[name]))
296
+ operations.push({ op: "set", path: path(name), value });
297
+ }
298
+ for (const name of Object.keys(original.value))
299
+ if (!(name in updated.value))
300
+ operations.push({ op: "remove", path: path(name) });
301
+ }
302
+ if (JSON.stringify(updated.$serializer) !== JSON.stringify(original.$serializer))
303
+ operations.push({ op: "set", path: "/$serializer", value: updated.$serializer });
304
+ if (!operations.length)
305
+ return;
306
+ if (operations.length > 10)
307
+ throw new WebdaError.BadRequest("Cosmos supports at most ten atomic patch operations; use update() for larger changes");
308
+ try {
309
+ await this.item(primaryKey).patch(operations, {
310
+ accessCondition: { type: "IfMatch", condition: original._etag }
311
+ });
312
+ }
313
+ catch (error) {
314
+ this.translateError(primaryKey, error);
315
+ }
316
+ }
317
+ /**
318
+ * Perform update.
319
+ * @override
320
+ */
321
+ async update(data, conditionField, condition) {
322
+ const original = await this.read(data);
323
+ this.checkWriteCondition(data, original, conditionField, condition);
324
+ const existing = this.fromDocument(original);
325
+ const clazz = (data instanceof this.model ? data.constructor : existing.constructor);
326
+ const memory = new MemoryRepository(clazz, this.pks, this.separator);
327
+ const replacement = this.document((await memory.create(data, false)));
328
+ if (replacement.id !== original.id)
329
+ throw new WebdaError.BadRequest("Cannot change a Cosmos primary key");
330
+ try {
331
+ await this.item(data).replace(replacement, { accessCondition: { type: "IfMatch", condition: original._etag } });
332
+ }
333
+ catch (error) {
334
+ this.translateError(data, error);
335
+ }
336
+ }
337
+ /**
338
+ * Perform patch.
339
+ * @override
340
+ */
341
+ async patch(primaryKey, data, field, expected) {
342
+ const key = this.getPrimaryKey(primaryKey, true);
343
+ if (this.pks.some(name => Object.prototype.hasOwnProperty.call(data, name) && data[name] !== key[name])) {
344
+ throw new WebdaError.BadRequest("Cannot change a Cosmos primary key");
345
+ }
346
+ await this.mutate(primaryKey, repo => repo.patch(primaryKey, data), field, expected);
347
+ }
348
+ /**
349
+ * Perform delete.
350
+ * @override
351
+ */
352
+ async delete(primaryKey, field, expected) {
353
+ const original = await this.read(primaryKey);
354
+ this.checkWriteCondition(primaryKey, original, field, expected);
355
+ try {
356
+ await this.item(primaryKey).delete({ accessCondition: { type: "IfMatch", condition: original._etag } });
357
+ }
358
+ catch (error) {
359
+ this.translateError(primaryKey, error);
360
+ }
361
+ }
362
+ /**
363
+ * Perform remove attribute.
364
+ * @override
365
+ */
366
+ async removeAttribute(primaryKey, attribute, field, expected) {
367
+ await this.mutate(primaryKey, repo => repo.removeAttribute(primaryKey, attribute), field, expected);
368
+ }
369
+ /**
370
+ * Perform increment attributes.
371
+ * @override
372
+ */
373
+ async incrementAttributes(primaryKey, info, field, expected) {
374
+ const entries = Array.isArray(info)
375
+ ? info.map(entry => (typeof entry === "string" ? [entry, 1] : [entry.property, entry.value ?? 1]))
376
+ : Object.entries(info);
377
+ const operations = entries.map(([property, value]) => {
378
+ if (!Number.isFinite(value) ||
379
+ property.split(".").some(part => ["__proto__", "constructor", "prototype"].includes(part)))
380
+ throw new WebdaError.BadRequest("Invalid Cosmos increment");
381
+ return {
382
+ op: "incr",
383
+ path: "/value/" +
384
+ property
385
+ .split(".")
386
+ .map(part => part.replace(/~/g, "~0").replace(/\//g, "~1"))
387
+ .join("/"),
388
+ value
389
+ };
390
+ });
391
+ let updated = {};
392
+ await this.mutate(primaryKey, async (repo) => {
393
+ updated = (await repo.incrementAttributes(primaryKey, info));
394
+ }, field, expected, operations);
395
+ return updated;
396
+ }
397
+ /**
398
+ * Perform upsert item to collection.
399
+ * @override
400
+ */
401
+ async upsertItemToCollection(primaryKey, collection, item, index, field, expected) {
402
+ await this.mutate(primaryKey, repo => repo.upsertItemToCollection(primaryKey, collection, item, index, field, expected));
403
+ }
404
+ /**
405
+ * Perform delete item from collection.
406
+ * @override
407
+ */
408
+ async deleteItemFromCollection(primaryKey, collection, index, field, expected) {
409
+ await this.mutate(primaryKey, repo => repo.deleteItemFromCollection(primaryKey, collection, index, field, expected));
410
+ }
411
+ /**
412
+ * Perform query.
413
+ * @override
414
+ */
415
+ async query(query, params) {
416
+ const parsed = typeof query === "string" ? QL.parse(params ? QL.bind(query, params) : query) : QL.normalizeQuery(query);
417
+ QL.assertFilterQuery(parsed);
418
+ const types = this.acceptedTypes();
419
+ if (types.length)
420
+ parsed.filter = new QL.AndExpression([new QL.ComparisonExpression("IN", "__type", types), parsed.filter]);
421
+ const result = await this.container()
422
+ .items.query(cosmosQuery(parsed), {
423
+ maxItemCount: parsed.limit,
424
+ continuationToken: parsed.continuationToken
425
+ })
426
+ .fetchNext();
427
+ return {
428
+ results: result.resources.map(document => this.fromDocument(document)),
429
+ continuationToken: result.continuationToken
430
+ };
431
+ }
432
+ /**
433
+ * Perform iterate.
434
+ * @override
435
+ */
436
+ async *iterate(query, params) {
437
+ const parsed = QL.parse(params ? QL.bind(query, params) : query);
438
+ do {
439
+ const page = await this.query(parsed);
440
+ yield* page.results;
441
+ parsed.continuationToken = page.continuationToken;
442
+ } while (parsed.continuationToken);
443
+ }
444
+ /**
445
+ * Perform delete many.
446
+ * @override
447
+ */
448
+ async deleteMany() {
449
+ throw new WebdaError.NotImplemented("Cosmos bulk delete is not supported");
450
+ }
451
+ /**
452
+ * Perform update many.
453
+ * @override
454
+ */
455
+ async updateMany() {
456
+ throw new WebdaError.NotImplemented("Cosmos bulk update is not supported");
457
+ }
458
+ }
459
+ /** Cosmos DB NoSQL store using optimistic ETags and atomic document patches.
460
+ * @WebdaModda
461
+ */
462
+ let CosmosStore = (() => {
463
+ var _a;
464
+ let _classSuper = Store;
465
+ let _instanceExtraInitializers = [];
466
+ let _getRepository_decorators;
467
+ return _a = class CosmosStore extends _classSuper {
468
+ constructor() {
469
+ super(...arguments);
470
+ /**
471
+ * Client
472
+ */
473
+ this.client = __runInitializers(this, _instanceExtraInitializers);
474
+ }
475
+ /**
476
+ * Perform init.
477
+ * @override
478
+ */
479
+ async init() {
480
+ const p = this.parameters;
481
+ this.client = new CosmosClient({
482
+ endpoint: p.endpoint,
483
+ ...(p.key !== undefined ? { key: SecretString.from(p.key, "key") } : { aadCredentials: getAzureCredential(p) })
484
+ });
485
+ if (p.createIfNotExists) {
486
+ await this.client.databases.createIfNotExists({ id: p.database });
487
+ await this.client
488
+ .database(p.database)
489
+ .containers.createIfNotExists({ id: p.container, partitionKey: { paths: [p.partitionKey] } }, { offerThroughput: p.throughput });
490
+ }
491
+ await super.init();
492
+ return this;
493
+ }
494
+ /**
495
+ * Perform get repository.
496
+ * @override
497
+ */
498
+ getRepository(model) {
499
+ const meta = useModelMetadata(model);
500
+ const repository = new CosmosRepository(model, meta.PrimaryKey, () => this.client.database(this.parameters.database).container(this.parameters.container), this.parameters.partitionKey, meta.PrimaryKeySeparator);
501
+ return new EventRepository(model, meta.PrimaryKey, repository, meta.PrimaryKeySeparator);
502
+ }
503
+ /**
504
+ * Perform stop.
505
+ * @override
506
+ */
507
+ async stop() {
508
+ this.client?.dispose();
509
+ await super.stop();
510
+ }
511
+ /**
512
+ * Describe the Azure resources and identity permissions required by this service.
513
+ * @param deployer - Deployment scope and identity helpers
514
+ * @returns The azure resources result
515
+ */
516
+ getAzureResources(deployer) {
517
+ const p = this.parameters, account = new URL(p.endpoint).hostname.split(".")[0];
518
+ const accountId = `/subscriptions/${deployer.resources.subscriptionId}/resourceGroups/${deployer.resources.resourceGroup}/providers/Microsoft.DocumentDB/databaseAccounts/${account}`;
519
+ const databaseId = `${accountId}/sqlDatabases/${p.database}`;
520
+ return {
521
+ resources: [
522
+ {
523
+ type: "Microsoft.DocumentDB/databaseAccounts/sqlDatabases",
524
+ apiVersion: "2024-11-15",
525
+ name: `${account}/${p.database}`,
526
+ properties: { resource: { id: p.database } }
527
+ },
528
+ {
529
+ type: "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers",
530
+ apiVersion: "2024-11-15",
531
+ name: `${account}/${p.database}/${p.container}`,
532
+ dependsOn: [databaseId],
533
+ properties: {
534
+ resource: { id: p.container, partitionKey: { paths: [p.partitionKey], kind: "Hash" } },
535
+ options: p.throughput ? { throughput: p.throughput } : {}
536
+ }
537
+ },
538
+ {
539
+ type: "Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments",
540
+ apiVersion: "2024-11-15",
541
+ name: `[concat(${armLiteral(`${account}/`)}, guid(${armLiteral(accountId)}, ${armLiteral(`${p.database}/${p.container}`)}, ${armValue(deployer.getAppPrincipalId())}))]`,
542
+ dependsOn: [`${databaseId}/containers/${p.container}`],
543
+ properties: {
544
+ roleDefinitionId: `${accountId}/sqlRoleDefinitions/00000000-0000-0000-0000-000000000002`,
545
+ scope: `${accountId}/dbs/${p.database}/colls/${p.container}`,
546
+ principalId: deployer.getAppPrincipalId()
547
+ }
548
+ }
549
+ ]
550
+ };
551
+ }
552
+ },
553
+ (() => {
554
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
555
+ _getRepository_decorators = [InstanceCache()];
556
+ __esDecorate(_a, null, _getRepository_decorators, { kind: "method", name: "getRepository", static: false, private: false, access: { has: obj => "getRepository" in obj, get: obj => obj.getRepository }, metadata: _metadata }, null, _instanceExtraInitializers);
557
+ if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
558
+ })(),
559
+ /**
560
+ * Parameters
561
+ */
562
+ _a.Parameters = CosmosStoreParameters,
563
+ _a;
564
+ })();
565
+ export { CosmosStore };
566
+ //# sourceMappingURL=cosmos.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cosmos.service.js","sources":["../../src/services/cosmos.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAa,YAAY,EAAgC,MAAM,eAAe,CAAC;AACtF,OAAO,EACL,eAAe,EACf,aAAa,EACb,gBAAgB,EAGhB,YAAY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AAC,CAAC,SAAS,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;gCACtF,OAAO,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE;6BAC1D;yBACF;wBACD;4BACE,IAAI,EAAE,0DAA0D;4BAChE,UAAU,EAAE,YAAY;4BACxB,IAAI,EAAE,WAAW,UAAU,CAAC,GAAG,OAAO,GAAG,CAAC,UAAU,UAAU,CAAC,SAAS,CAAC,KAAK,UAAU,CAAC,GAAG,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC,KAAK,QAAQ,CAAC,QAAQ,CAAC,iBAAiB,EAAE,CAAC,KAAK;4BACxK,SAAS,EAAE,CAAC,GAAG,UAAU,eAAe,CAAC,CAAC,SAAS,EAAE,CAAC;4BACtD,UAAU,EAAE;gCACV,gBAAgB,EAAE,GAAG,SAAS,0DAA0D;gCACxF,KAAK,EAAE,GAAG,SAAS,QAAQ,CAAC,CAAC,QAAQ,UAAU,CAAC,CAAC,SAAS,EAAE;gCAC5D,WAAW,EAAE,QAAQ,CAAC,iBAAiB,EAAE;6BAC1C;yBACF;qBACF;iBACF,CAAC;YACJ,CAAC;;;;yCApEA,aAAa,EAAE;YAChB,wLAAA,aAAa,6DAeZ;;;QApDD;;WAEG;QACI,aAAU,GAAG,qBAAsB;;;SAJ/B,WAAW"}
@@ -0,0 +1,51 @@
1
+ import type { HttpRequest, HttpResponseInit, InvocationContext } from "@azure/functions";
2
+ import { Service, ServiceParameters } from "@webda/core";
3
+ /** Non-HTTP bindings dispatch to services implementing this contract. */
4
+ export interface AzureEventsHandler {
5
+ /**
6
+ * Handle azure event
7
+ */
8
+ handleAzureEvent(source: "servicebus" | "blob" | "timer", event: unknown, context: InvocationContext): Promise<boolean>;
9
+ }
10
+ /** Azure Functions HTTP adapter settings. */
11
+ export declare class AzureFunctionServerParameters extends ServiceParameters {
12
+ /**
13
+ * Request ID header
14
+ */
15
+ requestIdHeader: string;
16
+ }
17
+ /** Run Webda routes and event handlers inside the Azure Functions v4 runtime.
18
+ * @WebdaModda
19
+ */
20
+ export declare class AzureFunctionServer extends Service<AzureFunctionServerParameters> {
21
+ /**
22
+ * Parameters
23
+ */
24
+ static Parameters: typeof AzureFunctionServerParameters;
25
+ /**
26
+ * Execute an Azure HTTP request through the Webda router.
27
+ * @param request - Azure Functions HTTP request
28
+ * @param invocation - Azure invocation metadata
29
+ * @returns The handle request result
30
+ */
31
+ handleRequest(request: HttpRequest, invocation: InvocationContext): Promise<HttpResponseInit>;
32
+ /**
33
+ * Resolve the client address from the rightmost X-Forwarded-For entry, without any port. Never throws.
34
+ * @param headers - the request headers
35
+ * @returns the address, undefined if unknown or invalid
36
+ */
37
+ protected getClientIp(headers: Record<string, string>): string | undefined;
38
+ /**
39
+ * Dispatch an Azure binding event to configured handler services.
40
+ * @param source - Azure binding event source
41
+ * @param event - Received event payload
42
+ * @param context - Webda or Azure invocation context
43
+ */
44
+ handleEvent(source: "servicebus" | "blob" | "timer", event: unknown, context: InvocationContext): Promise<void>;
45
+ /**
46
+ * Execute only the declared cron matching the exported identifier, through its operation
47
+ * @param id - Secret name or exported cron identifier
48
+ */
49
+ handleCron(id: string): Promise<void>;
50
+ }
51
+ //# sourceMappingURL=functionserver.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functionserver.service.d.ts","sources":["../../src/services/functionserver.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAIzF,OAAO,EAML,OAAO,EACP,iBAAiB,EAMlB,MAAM,aAAa,CAAC;AAErB,yEAAyE;AACzE,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,gBAAgB,CACd,MAAM,EAAE,YAAY,GAAG,MAAM,GAAG,OAAO,EACvC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,OAAO,CAAC,CAAC;CACrB;AAED,6CAA6C;AAC7C,qBAAa,6BAA8B,SAAQ,iBAAiB;IAClE;;OAEG;IACH,eAAe,SAAkB;CAClC;AAmED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,OAAO,CAAC,6BAA6B,CAAC;IAC7E;;OAEG;IACH,MAAM,CAAC,UAAU,uCAAiC;IAElD;;;;;OAKG;IACG,aAAa,CAAC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAoGlG;IAED;;;;OAIG;IACH,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,SAAS,CAiBzE;IAED;;;;;OAKG;IACG,WAAW,CACf,MAAM,EAAE,YAAY,GAAG,MAAM,GAAG,OAAO,EACvC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,IAAI,CAAC,CASf;IAED;;;OAGG;IACG,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAI1C;CACF"}