@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,74 @@
1
+ import { WebdaError } from "@webda/core";
2
+ /**
3
+ * Create an empty ARM deployment template.
4
+ * @returns The azure template result
5
+ */
6
+ export function createAzureTemplate() {
7
+ return {
8
+ $schema: "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
9
+ contentVersion: "1.0.0.0",
10
+ parameters: {},
11
+ resources: [],
12
+ outputs: {}
13
+ };
14
+ }
15
+ /**
16
+ * Quote a literal embedded inside an ARM expression.
17
+ * @param value - Value to convert or protect
18
+ * @returns The arm literal result
19
+ */
20
+ export function armLiteral(value) {
21
+ return `'${value.replace(/'/g, "''")}'`;
22
+ }
23
+ /**
24
+ * Strip the brackets of an expression, or quote a literal for a larger expression.
25
+ * @param value - Value to convert or protect
26
+ * @returns The arm value result
27
+ */
28
+ export function armValue(value) {
29
+ return value.startsWith("[") && value.endsWith("]") ? value.slice(1, -1) : armLiteral(value);
30
+ }
31
+ /**
32
+ * Construct a resource identifier without interpolating unescaped names.
33
+ * @param type - ARM resource type
34
+ * @param names - Resource name segments
35
+ * @returns The resource id result
36
+ */
37
+ export function resourceId(type, ...names) {
38
+ return `[resourceId(${[type, ...names].map(armLiteral).join(", ")})]`;
39
+ }
40
+ /**
41
+ * Resource identifier for a role assignment at a resource scope.
42
+ * @param resource - ARM resource declaration
43
+ * @returns The role assignment id result
44
+ */
45
+ export function roleAssignmentId(resource) {
46
+ return `[extensionResourceId(${armValue(resource.scope)}, 'Microsoft.Authorization/roleAssignments', ${armValue(resource.name)})]`;
47
+ }
48
+ /**
49
+ * Azure Container Apps uses five cron fields; sub-minute schedules cannot be represented.
50
+ * @param cron - Cron expression
51
+ * @returns The container apps schedule result
52
+ */
53
+ export function containerAppsSchedule(cron) {
54
+ const fields = cron.trim().split(/\s+/);
55
+ if (fields.length === 6 && fields[0] === "0")
56
+ fields.shift();
57
+ if (fields.length !== 5)
58
+ throw new WebdaError.BadRequest("Container Apps cron must use five fields, or six with seconds set to 0");
59
+ return fields.join(" ");
60
+ }
61
+ /**
62
+ * Functions timers use six-field NCRONTAB with seconds first.
63
+ * @param cron - Cron expression
64
+ * @returns The functions schedule result
65
+ */
66
+ export function functionsSchedule(cron) {
67
+ const fields = cron.trim().split(/\s+/);
68
+ if (fields.length === 5)
69
+ fields.unshift("0");
70
+ if (fields.length !== 6)
71
+ throw new WebdaError.BadRequest("Functions cron requires five or six fields");
72
+ return fields.join(" ");
73
+ }
74
+ //# sourceMappingURL=template.js.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K,CAAC,KAAK,CAAC,CAAC;IACxC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG;QAAE,MAAM,CAAC,KAAK,EAAE,CAAC;IAC7D,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QACrB,MAAM,IAAI,UAAU,CAAC,UAAU,CAAC,wEAAwE,CAAC,CAAC;IAC5G,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC1B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACxC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC7C,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,UAAU,CAAC,4CAA4C,CAAC,CAAC;IACvG,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC1B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,80 @@
1
1
  {
2
2
  "name": "@webda/azure",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "4.0.0-beta.13",
4
+ "description": "Azure services and deployers for Webda",
5
+ "main": "lib/index.js",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/loopingz/webda.io.git",
9
+ "directory": "packages/azure"
10
+ },
11
+ "keywords": [
12
+ "webda",
13
+ "modda"
14
+ ],
15
+ "files": [
16
+ "lib",
17
+ "webda.module.json",
18
+ "package.json"
19
+ ],
20
+ "author": "loopingz",
21
+ "license": "LGPL-3.0-only",
22
+ "bugs": {
23
+ "url": "https://github.com/loopingz/webda.io/issues"
24
+ },
25
+ "homepage": "https://github.com/loopingz/webda.io#readme",
26
+ "dependencies": {
27
+ "@azure/arm-resources": "^8.0.0",
28
+ "@azure/arm-resourcesdeployments": "^2.0.0",
29
+ "@azure/core-auth": "^1.11.0",
30
+ "@azure/cosmos": "^4.10.1",
31
+ "@azure/functions": "^4.17.0",
32
+ "@azure/identity": "^4.14.1",
33
+ "@azure/keyvault-keys": "^4.10.2",
34
+ "@azure/keyvault-secrets": "^4.12.0",
35
+ "@azure/monitor-ingestion": "^1.2.0",
36
+ "@azure/service-bus": "^7.10.0",
37
+ "@azure/storage-blob": "^12.34.0",
38
+ "@webda/core": "4.0.0-beta.13",
39
+ "@webda/oci": "4.0.0-beta.13",
40
+ "@webda/models": "4.0.0-beta.13",
41
+ "@webda/ql": "4.0.0-beta.10",
42
+ "@webda/utils": "4.0.0-beta.12",
43
+ "@webda/workout": "4.0.0-beta.7"
44
+ },
45
+ "publishConfig": {
46
+ "access": "public"
47
+ },
48
+ "devDependencies": {
49
+ "@types/node": "26.6.6",
50
+ "@vitest/coverage-v8": "^5.1.0",
51
+ "typescript": "7.1.0-dev.20261102.1",
52
+ "vite": "^7.3.7",
53
+ "vitest": "^5.1.0",
54
+ "@webda/compiler": "^4.0.0-beta.13",
55
+ "@webda/test": "4.0.0-beta.9"
56
+ },
57
+ "type": "module",
58
+ "engines": {
59
+ "node": ">=22.0.0"
60
+ },
61
+ "nx": {
62
+ "implicitDependencies": [
63
+ "@webda/core"
64
+ ]
65
+ },
66
+ "typings": "lib/index.d.ts",
67
+ "webda": {
68
+ "namespace": "Webda"
69
+ },
70
+ "scripts": {
71
+ "build": "webdac build",
72
+ "build:watch": "webdac build --watch",
73
+ "pretest": "npm run build",
74
+ "lint": "eslint",
75
+ "lint:fix": "eslint --fix",
76
+ "test": "vitest run",
77
+ "format": "prettier --check src/**/*",
78
+ "format:fix": "prettier --write src/**/*"
79
+ }
6
80
  }