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

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 +30 -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 +108 -0
  8. package/lib/deployers/arm.service.d.ts.map +1 -0
  9. package/lib/deployers/arm.service.js +280 -0
  10. package/lib/deployers/arm.service.js.map +1 -0
  11. package/lib/deployers/containerapps.service.d.ts +156 -0
  12. package/lib/deployers/containerapps.service.d.ts.map +1 -0
  13. package/lib/deployers/containerapps.service.js +455 -0
  14. package/lib/deployers/containerapps.service.js.map +1 -0
  15. package/lib/deployers/functions-entrypoint.d.ts +48 -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 +66 -0
  20. package/lib/deployers/functions.service.d.ts.map +1 -0
  21. package/lib/deployers/functions.service.js +322 -0
  22. package/lib/deployers/functions.service.js.map +1 -0
  23. package/lib/deployers/functionspackager.service.d.ts +43 -0
  24. package/lib/deployers/functionspackager.service.d.ts.map +1 -0
  25. package/lib/deployers/functionspackager.service.js +151 -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 +41 -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 +157 -0
  36. package/lib/services/blob.service.d.ts.map +1 -0
  37. package/lib/services/blob.service.js +428 -0
  38. package/lib/services/blob.service.js.map +1 -0
  39. package/lib/services/contributors.d.ts +47 -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 +211 -0
  44. package/lib/services/cosmos.service.d.ts.map +1 -0
  45. package/lib/services/cosmos.service.js +554 -0
  46. package/lib/services/cosmos.service.js.map +1 -0
  47. package/lib/services/functionserver.service.d.ts +42 -0
  48. package/lib/services/functionserver.service.d.ts.map +1 -0
  49. package/lib/services/functionserver.service.js +223 -0
  50. package/lib/services/functionserver.service.js.map +1 -0
  51. package/lib/services/keyvault.service.d.ts +91 -0
  52. package/lib/services/keyvault.service.d.ts.map +1 -0
  53. package/lib/services/keyvault.service.js +225 -0
  54. package/lib/services/keyvault.service.js.map +1 -0
  55. package/lib/services/monitorlogger.service.d.ts +66 -0
  56. package/lib/services/monitorlogger.service.d.ts.map +1 -0
  57. package/lib/services/monitorlogger.service.js +131 -0
  58. package/lib/services/monitorlogger.service.js.map +1 -0
  59. package/lib/services/servicebus.service.d.ts +128 -0
  60. package/lib/services/servicebus.service.d.ts.map +1 -0
  61. package/lib/services/servicebus.service.js +324 -0
  62. package/lib/services/servicebus.service.js.map +1 -0
  63. package/lib/template.d.ts +53 -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 +1817 -0
@@ -0,0 +1,428 @@
1
+ import { BlobSASPermissions, BlobServiceClient, generateBlobSASQueryParameters, newPipeline, StorageSharedKeyCredential } from "@azure/storage-blob";
2
+ import { CloudBinary, CloudBinaryParameters, SecretString, useModelId, WebdaError, normalizeHashes, normalizeHash } from "@webda/core";
3
+ import { ContentExistsError, ContentNotFoundError, parseContentUrl, toReadable } from "@webda/utils";
4
+ import { createHash, randomUUID } from "node:crypto";
5
+ import { posix } from "node:path";
6
+ import { getAzureCredential, loadAzureParameters } from "./azure-parameters.js";
7
+ /** Blob storage settings. Shared keys are optional; managed identity is preferred. */
8
+ export class AzureBlobBinaryParameters extends CloudBinaryParameters {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.createContainer = false;
12
+ this.pendingTimeout = 3600;
13
+ }
14
+ /**
15
+ * Perform load.
16
+ * @override
17
+ */
18
+ load(params = {}) {
19
+ super.load(params);
20
+ return loadAzureParameters(this);
21
+ }
22
+ }
23
+ /** Blob-backed binaries with verified direct uploads and exact ownership markers.
24
+ * @WebdaModda
25
+ */
26
+ export class AzureBlobBinary extends CloudBinary {
27
+ constructor() {
28
+ super(...arguments);
29
+ this.schemes = ["azure", "azblob"];
30
+ }
31
+ /**
32
+ * Perform init.
33
+ * @override
34
+ */
35
+ async init() {
36
+ const p = this.parameters;
37
+ if (p.connectionString !== undefined) {
38
+ this.client = BlobServiceClient.fromConnectionString(SecretString.from(p.connectionString, "connectionString"));
39
+ if (p.endpoint)
40
+ this.client = new BlobServiceClient(p.endpoint, this.client.credential);
41
+ }
42
+ else {
43
+ if (!p.account)
44
+ throw new WebdaError.BadRequest("Azure Blob storage requires account or connectionString");
45
+ this.client = new BlobServiceClient(p.endpoint ?? `https://${p.account}.blob.core.windows.net`, getAzureCredential(p));
46
+ }
47
+ if (p.serviceVersion) {
48
+ if (!/^\d{4}-\d{2}-\d{2}$/.test(p.serviceVersion))
49
+ throw new WebdaError.BadRequest("Invalid Azure Blob serviceVersion");
50
+ const pipeline = newPipeline(this.client.credential);
51
+ pipeline.factories.push({
52
+ create(next) {
53
+ return {
54
+ sendRequest(request) {
55
+ request.headers.set("x-ms-version", p.serviceVersion);
56
+ return next.sendRequest(request);
57
+ }
58
+ };
59
+ }
60
+ });
61
+ this.client = new BlobServiceClient(this.client.url, pipeline);
62
+ }
63
+ if (p.createContainer)
64
+ await this.client.getContainerClient(p.container).createIfNotExists();
65
+ await super.init();
66
+ return this;
67
+ }
68
+ /**
69
+ * Perform get content bucket.
70
+ * @override
71
+ */
72
+ getContentBucket() {
73
+ return this.parameters.container;
74
+ }
75
+ /**
76
+ * Resolve a content URL to a configured Blob SDK client.
77
+ * @param url - Content URL
78
+ * @returns The blob result
79
+ */
80
+ blob(url) {
81
+ const target = parseContentUrl(url, this.parameters.container);
82
+ // A content URL cannot redirect this client's credentials to another endpoint.
83
+ if (target.endpoint || target.credential)
84
+ throw new WebdaError.BadRequest("Use configured Azure Blob endpoint and credentials");
85
+ return this.client.getContainerClient(target.bucket ?? this.parameters.container).getBlockBlobClient(target.key);
86
+ }
87
+ /**
88
+ * Perform get content.
89
+ * @override
90
+ */
91
+ async getContent(url, options) {
92
+ try {
93
+ const range = options?.range;
94
+ const response = await this.blob(url).download(range?.start, range?.end === undefined ? undefined : range.end - (range?.start ?? 0) + 1);
95
+ return response.readableStreamBody;
96
+ }
97
+ catch (error) {
98
+ if (error.statusCode === 404)
99
+ throw new ContentNotFoundError(url);
100
+ throw error;
101
+ }
102
+ }
103
+ /**
104
+ * Perform put content.
105
+ * @override
106
+ */
107
+ async putContent(url, body, options) {
108
+ try {
109
+ const result = await this.blob(url).uploadStream(toReadable(body), undefined, undefined, {
110
+ blobHTTPHeaders: { blobContentType: options?.contentType ?? "application/octet-stream" },
111
+ metadata: options?.metadata,
112
+ conditions: options?.ifNotExists ? { ifNoneMatch: "*" } : undefined
113
+ });
114
+ return {
115
+ url,
116
+ size: options?.contentLength,
117
+ etag: result.etag,
118
+ contentType: options?.contentType,
119
+ metadata: options?.metadata,
120
+ lastModified: result.lastModified
121
+ };
122
+ }
123
+ catch (error) {
124
+ if (options?.ifNotExists && [409, 412].includes(error.statusCode))
125
+ throw new ContentExistsError(url);
126
+ throw error;
127
+ }
128
+ }
129
+ /**
130
+ * Perform head content.
131
+ * @override
132
+ */
133
+ async headContent(url) {
134
+ try {
135
+ const info = await this.blob(url).getProperties();
136
+ return {
137
+ url,
138
+ size: info.contentLength,
139
+ contentType: info.contentType,
140
+ etag: info.etag,
141
+ metadata: info.metadata,
142
+ lastModified: info.lastModified
143
+ };
144
+ }
145
+ catch (error) {
146
+ if (error.statusCode === 404)
147
+ return undefined;
148
+ throw error;
149
+ }
150
+ }
151
+ /**
152
+ * Perform delete content.
153
+ * @override
154
+ */
155
+ async deleteContent(url) {
156
+ await this.blob(url).deleteIfExists();
157
+ }
158
+ /**
159
+ * Perform _get.
160
+ * @override
161
+ */
162
+ async _get(info) {
163
+ this.checkHash(info.hash);
164
+ return this.getContent(this.getContentUrl(this._getKey(info.hash)));
165
+ }
166
+ /**
167
+ * Perform get signed url from map.
168
+ * @override
169
+ */
170
+ async getSignedUrlFromMap(map, expires, _context) {
171
+ this.checkHash(map.hash);
172
+ return this.getSignedUrl(this._getKey(map.hash), "r", expires);
173
+ }
174
+ /**
175
+ * Issue narrowly scoped SAS credentials. Direct uploads only create isolated staging blobs.
176
+ * @param key - Object key within the container
177
+ * @param permissions - Permissions granted by the SAS
178
+ * @param expires - SAS lifetime in seconds
179
+ * @returns The signed url result
180
+ */
181
+ async getSignedUrl(key, permissions = "r", expires = this.parameters.urlExpiry) {
182
+ if (!Number.isFinite(expires) || expires <= 0 || expires > 7 * 86400 - 600)
183
+ throw new WebdaError.BadRequest("SAS expiry must be positive and less than seven days");
184
+ const startsOn = new Date(Date.now() - 300000), expiresOn = new Date(Date.now() + expires * 1000);
185
+ const values = {
186
+ containerName: this.parameters.container,
187
+ blobName: key,
188
+ permissions: BlobSASPermissions.parse(permissions),
189
+ startsOn,
190
+ expiresOn,
191
+ version: this.parameters.serviceVersion
192
+ };
193
+ const credential = this.client.credential;
194
+ const sas = credential instanceof StorageSharedKeyCredential
195
+ ? generateBlobSASQueryParameters(values, credential)
196
+ : generateBlobSASQueryParameters(values, await this.client.getUserDelegationKey(startsOn, expiresOn), this.client.accountName);
197
+ return `${this.client.getContainerClient(this.parameters.container).getBlobClient(key).url}?${sas.toString()}`;
198
+ }
199
+ /**
200
+ * Validate a hash before using it in a storage key.
201
+ * @param hash - Normalized content hash
202
+ * @returns The check hash result
203
+ */
204
+ checkHash(hash) {
205
+ if (!hash || !/^[0-9a-f]{32}$/.test(hash))
206
+ throw new WebdaError.BadRequest("Invalid binary hash");
207
+ }
208
+ /**
209
+ * Build an injective ownership marker from the model, attribute and key.
210
+ * @param model - Model class or model identifier
211
+ * @param property - Binary or model attribute
212
+ * @param uuid - Owner primary key
213
+ * @returns The marker result
214
+ */
215
+ marker(model, property, uuid) {
216
+ return ("@" +
217
+ [model, property, uuid]
218
+ .map(part => [...Buffer.from(part)]
219
+ .map(byte => {
220
+ const character = String.fromCharCode(byte);
221
+ return /[A-Za-z0-9.:@-]/.test(character)
222
+ ? character
223
+ : `~${byte.toString(16).toUpperCase().padStart(2, "0")}`;
224
+ })
225
+ .join(""))
226
+ .join("_"));
227
+ }
228
+ /**
229
+ * Build the private pending-upload record key.
230
+ * @param object - Model owning the binary
231
+ * @param property - Binary or model attribute
232
+ * @param hash - Normalized content hash
233
+ * @returns The pending key result
234
+ */
235
+ pendingKey(object, property, hash) {
236
+ return posix.join(this.parameters.prefix ?? "", "_pending", hash, this.marker(useModelId(object.constructor), property, object.getUUID()));
237
+ }
238
+ /**
239
+ * Persist an exact ownership marker and attach the verified file.
240
+ * @param object - Model owning the binary
241
+ * @param property - Binary or model attribute
242
+ * @param info - Binary metadata or increment specification
243
+ */
244
+ async attach(object, property, info) {
245
+ const model = useModelId(object.constructor);
246
+ await this.putContent(this.getContentUrl(this._getKey(info.hash, this.marker(model, property, object.getUUID()))), "", { metadata: { webdamodel: model } });
247
+ await this.uploadSuccess(object, property, info);
248
+ }
249
+ /**
250
+ * Perform store.
251
+ * @override
252
+ */
253
+ async store(object, property, file) {
254
+ this.checkMap(object, property);
255
+ const computed = await this.verifiedHashes(file);
256
+ const url = this.getContentUrl(this._getKey(computed.hash));
257
+ try {
258
+ await this.putContent(url, await file.get(), {
259
+ ifNotExists: true,
260
+ metadata: { ...file.metadata, webdaproof: computed.challenge },
261
+ contentType: file.mimetype,
262
+ contentLength: file.size
263
+ });
264
+ }
265
+ catch (error) {
266
+ if (!(error instanceof ContentExistsError))
267
+ throw error;
268
+ }
269
+ const stored = await this.headContent(url);
270
+ if (stored?.metadata?.webdaproof !== computed.challenge)
271
+ throw new WebdaError.Conflict("Stored binary proof does not match");
272
+ await this.attach(object, property, { ...file.toBinaryFileInfo(), size: stored.size });
273
+ }
274
+ /**
275
+ * Perform put redirect url.
276
+ * @override
277
+ */
278
+ async putRedirectUrl(object, property, info, context) {
279
+ info = normalizeHashes(info ?? (await context?.getInput()));
280
+ this.checkHash(info?.hash);
281
+ if (!info?.challenge || !/^[0-9a-f]{32}$/.test(info.challenge))
282
+ throw new WebdaError.BadRequest("Upload challenge is required");
283
+ this.checkMap(object, property);
284
+ const stored = await this.headContent(this.getContentUrl(this._getKey(info.hash)));
285
+ if (stored?.metadata?.webdaproof === info.challenge) {
286
+ if (this.parameters.maxUploadSize !== undefined && stored.size > this.parameters.maxUploadSize)
287
+ throw new WebdaError.BadRequest("File too big");
288
+ await this.attach(object, property, { ...info, size: stored.size });
289
+ return undefined;
290
+ }
291
+ const stagingKey = posix.join(this.parameters.prefix ?? "", "_staging", randomUUID());
292
+ const pending = { info, stagingKey, created: Date.now() };
293
+ await this.putContent(this.getContentUrl(this.pendingKey(object, property, info.hash)), JSON.stringify(pending), {
294
+ contentType: "application/json"
295
+ });
296
+ return {
297
+ url: await this.getSignedUrl(stagingKey, "c"),
298
+ method: "PUT",
299
+ headers: {
300
+ "x-ms-blob-type": "BlockBlob",
301
+ "Content-Type": "application/octet-stream",
302
+ "Content-MD5": Buffer.from(info.hash, "hex").toString("base64")
303
+ }
304
+ };
305
+ }
306
+ /**
307
+ * Verify the bytes before copying them to the content hash and attaching them to the owner.
308
+ * @override
309
+ */
310
+ async completeUpload(object, property, hash) {
311
+ hash = normalizeHash(hash);
312
+ this.checkHash(hash);
313
+ this.checkMap(object, property);
314
+ if (this.isLinked(object, property, hash, await this.getStoredValue(object, property)))
315
+ return;
316
+ const pendingUrl = this.getContentUrl(this.pendingKey(object, property, hash));
317
+ const pendingBlob = this.blob(pendingUrl);
318
+ let response;
319
+ try {
320
+ response = await pendingBlob.download();
321
+ }
322
+ catch (error) {
323
+ if (error.statusCode === 404)
324
+ throw new WebdaError.NotFound("No pending upload");
325
+ throw error;
326
+ }
327
+ const chunks = [];
328
+ for await (const chunk of response.readableStreamBody)
329
+ chunks.push(Buffer.from(chunk));
330
+ const pending = JSON.parse(Buffer.concat(chunks).toString());
331
+ if (Date.now() - pending.created > this.parameters.pendingTimeout * 1000)
332
+ throw new WebdaError.PreconditionFailed("Pending upload expired");
333
+ const stagingUrl = this.getContentUrl(pending.stagingKey);
334
+ const head = await this.headContent(stagingUrl);
335
+ if (!head)
336
+ throw new WebdaError.PreconditionFailed("Upload not found");
337
+ const max = this.parameters.maxUploadSize;
338
+ if ((pending.info.size !== undefined && pending.info.size !== head.size) || (max !== undefined && head.size > max))
339
+ throw new WebdaError.BadRequest("Uploaded size does not match");
340
+ const md5 = createHash("md5"), proof = createHash("md5").update("WEBDA");
341
+ const stagingBlob = this.blob(stagingUrl);
342
+ const read = async () => (await stagingBlob.download(0, undefined, { conditions: { ifMatch: head.etag } })).readableStreamBody;
343
+ for await (const chunk of await read()) {
344
+ md5.update(chunk);
345
+ proof.update(chunk);
346
+ }
347
+ const challenge = proof.digest("hex");
348
+ if (md5.digest("hex") !== hash || challenge !== pending.info.challenge)
349
+ throw new WebdaError.BadRequest("Uploaded content does not match the challenge");
350
+ const url = this.getContentUrl(this._getKey(hash));
351
+ try {
352
+ await this.putContent(url, await read(), {
353
+ ifNotExists: true,
354
+ metadata: { ...pending.info.metadata, webdaproof: challenge },
355
+ contentType: pending.info.mimetype,
356
+ contentLength: head.size
357
+ });
358
+ }
359
+ catch (error) {
360
+ if (!(error instanceof ContentExistsError))
361
+ throw error;
362
+ }
363
+ if ((await this.headContent(url))?.metadata?.webdaproof !== challenge)
364
+ throw new WebdaError.Conflict("Stored binary proof does not match");
365
+ await this.attach(object, property, { ...pending.info, hash, size: head.size });
366
+ await pendingBlob.delete({ conditions: { ifMatch: response.etag } });
367
+ await this.deleteContent(stagingUrl);
368
+ }
369
+ /**
370
+ * Perform get usage count.
371
+ * @override
372
+ */
373
+ async getUsageCount(hash) {
374
+ let count = 0;
375
+ for await (const blob of this.client
376
+ .getContainerClient(this.parameters.container)
377
+ .listBlobsFlat({ prefix: this._getKey(hash, "") + "/" })) {
378
+ if (blob.name !== this._getKey(hash))
379
+ count++;
380
+ }
381
+ return count;
382
+ }
383
+ /**
384
+ * Perform _clean usage.
385
+ * @override
386
+ */
387
+ async _cleanUsage(hash, uuid, attribute, model) {
388
+ if (!attribute || !model)
389
+ return;
390
+ await this.deleteContent(this.getContentUrl(this._getKey(hash, this.marker(model, attribute, uuid))));
391
+ if ((await this.getUsageCount(hash)) === 0)
392
+ await this.deleteContent(this.getContentUrl(this._getKey(hash)));
393
+ }
394
+ /**
395
+ * Describe the Azure resources and identity permissions required by this service.
396
+ * @param deployer - Deployment scope and identity helpers
397
+ * @returns The azure resources result
398
+ */
399
+ getAzureResources(deployer) {
400
+ if (!this.parameters.account)
401
+ return {};
402
+ const name = `${this.parameters.account}/default/${this.parameters.container}`;
403
+ const scope = `/subscriptions/${deployer.resources.subscriptionId}/resourceGroups/${deployer.resources.resourceGroup}/providers/Microsoft.Storage/storageAccounts/${this.parameters.account}/blobServices/default/containers/${this.parameters.container}`;
404
+ return {
405
+ resources: [
406
+ {
407
+ type: "Microsoft.Storage/storageAccounts/blobServices/containers",
408
+ apiVersion: "2023-05-01",
409
+ name,
410
+ properties: { publicAccess: "None" }
411
+ }
412
+ ],
413
+ roleAssignments: [
414
+ {
415
+ scope,
416
+ roleDefinitionId: `/subscriptions/${deployer.resources.subscriptionId}/providers/Microsoft.Authorization/roleDefinitions/ba92f5b4-2d11-453d-a403-e96b0029c9fe`
417
+ },
418
+ {
419
+ scope: scope.split("/blobServices/")[0],
420
+ roleDefinitionId: `/subscriptions/${deployer.resources.subscriptionId}/providers/Microsoft.Authorization/roleDefinitions/db58b8e5-c6ad-4a2a-8342-4190687cbf4a`
421
+ }
422
+ ],
423
+ env: { AZURE_STORAGE_ACCOUNT: this.parameters.account }
424
+ };
425
+ }
426
+ }
427
+ AzureBlobBinary.Parameters = AzureBlobBinaryParameters;
428
+ //# sourceMappingURL=blob.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blob.service.js","sources":["../../src/services/blob.service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,8BAA8B,EAC9B,WAAW,EACX,0BAA0B,EAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAIL,WAAW,EACX,qBAAqB,EAGrB,YAAY,EACZ,UAAU,EACV,UAAU,EACV,eAAe,EACf,aAAa,EACd,MAAM,aAAa,CAAC;AACrB,OAAO,EAEL,kBAAkB,EAGlB,oBAAoB,EAEpB,eAAe,EACf,UAAU,EACX,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAA0B,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAGxG,sFAAsF;AACtF,MAAM,OAAO,yBAA0B,SAAQ,qBAAqB;IAApE;;QASE,oBAAe,GAAG,KAAK,CAAC;QAGxB,mBAAc,GAAG,IAAI,CAAC;IAUxB,CAAC;IARC;;;OAGG;IACH,IAAI,CAAC,MAAM,GAAQ,EAAE;QACnB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnB,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;CACF;AAQD;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,WAAsC;IAA3E;;QAEW,YAAO,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IA0azC,CAAC;IAvaC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AU,EAAE,YAAY;oBACxB,IAAI;oBACJ,UAAU,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE;iBACrC;aACF;YACD,eAAe,EAAE;gBACf;oBACE,KAAK;oBACL,gBAAgB,EAAE,kBAAkB,QAAQ,CAAC,SAAS,CAAC,cAAc,yFAAyF;iBAC/J;gBACD;oBACE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;oBACvC,gBAAgB,EAAE,kBAAkB,QAAQ,CAAC,SAAS,CAAC,cAAc,yFAAyF;iBAC/J;aACF;YACD,GAAG,EAAE,EAAE,qBAAqB,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE;SACxD,CAAC;IACJ,CAAC;CACF;AA3aQ,0BAAU,GAAG,yBAAyB,AAA5B,CAA6B"}
@@ -0,0 +1,47 @@
1
+ /** Minimal deployer contract given to contributors, without importing a concrete Azure deployer. */
2
+ export interface AzureDeployerInfo {
3
+ /** Resolved deployment scope and location; other deployer parameters can coexist. */
4
+ resources: {
5
+ resourceGroup: string;
6
+ location: string;
7
+ subscriptionId: string;
8
+ };
9
+ /**
10
+ * Merge deployment tags and resource-specific tags.
11
+ * @param tags - resource-specific tags
12
+ * @returns merged resource tags
13
+ */
14
+ getDefaultTags(tags?: Record<string, string>): Record<string, string>;
15
+ /** @returns ARM expression identifying the application's managed identity principal */
16
+ getAppPrincipalId(): string;
17
+ }
18
+ /** A role that the deployer must grant to the application's managed identity, at the given resource scope. */
19
+ export interface AzureRoleAssignment {
20
+ /** Role definition resource identifier or ARM expression. */
21
+ roleDefinitionId: string;
22
+ /** Resource scope identifier or ARM expression. */
23
+ scope: string;
24
+ }
25
+ /** ARM resources and runtime settings contributed by one application service. */
26
+ export interface AzureResourceContribution {
27
+ /** ARM resource declarations. */
28
+ resources?: Record<string, unknown>[];
29
+ /** Variables for the application and jobs; secret values are references, rather than inline secrets. */
30
+ env?: Record<string, string | {
31
+ secretRef: string;
32
+ }>;
33
+ /** ARM template outputs. */
34
+ outputs?: Record<string, unknown>;
35
+ /** Roles granted to the application's managed identity by the deployer. */
36
+ roleAssignments?: AzureRoleAssignment[];
37
+ }
38
+ /** Allow a service to contribute to an Azure deployment template without depending on its implementation. */
39
+ export interface AzureContributor {
40
+ /**
41
+ * Describe resources, settings and managed-identity roles, without deploying them.
42
+ * @param deployer - current deployment scope and template helpers
43
+ * @returns contribution merged by the deployer
44
+ */
45
+ getAzureResources(deployer: AzureDeployerInfo): AzureResourceContribution;
46
+ }
47
+ //# sourceMappingURL=contributors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contributors.d.ts","sources":["../../src/services/contributors.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,MAAM,WAAW,iBAAiB;IAChC,qFAAqF;IACrF,SAAS,EAAE;QACT,aAAa,EAAE,MAAM,CAAC;QACtB,QAAQ,EAAE,MAAM,CAAC;QACjB,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;IACF;;;;OAIG;IACH,cAAc,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtE,uFAAuF;IACvF,iBAAiB,IAAI,MAAM,CAAC;CAC7B;AAED,8GAA8G;AAC9G,MAAM,WAAW,mBAAmB;IAClC,6DAA6D;IAC7D,gBAAgB,EAAE,MAAM,CAAC;IACzB,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,iFAAiF;AACjF,MAAM,WAAW,yBAAyB;IACxC,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACtC,wGAAwG;IACxG,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrD,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,2EAA2E;IAC3E,eAAe,CAAC,EAAE,mBAAmB,EAAE,CAAC;CACzC;AAED,6GAA6G;AAC7G,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,iBAAiB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,yBAAyB,CAAC;CAC3E"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=contributors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contributors.js","sources":["../../src/services/contributors.ts"],"names":[],"mappings":""}