@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.
- package/LICENSE +166 -0
- package/README.md +248 -2
- package/lib/auth.d.ts +30 -0
- package/lib/auth.d.ts.map +1 -0
- package/lib/auth.js +70 -0
- package/lib/auth.js.map +1 -0
- package/lib/deployers/arm.service.d.ts +108 -0
- package/lib/deployers/arm.service.d.ts.map +1 -0
- package/lib/deployers/arm.service.js +280 -0
- package/lib/deployers/arm.service.js.map +1 -0
- package/lib/deployers/containerapps.service.d.ts +156 -0
- package/lib/deployers/containerapps.service.d.ts.map +1 -0
- package/lib/deployers/containerapps.service.js +455 -0
- package/lib/deployers/containerapps.service.js.map +1 -0
- package/lib/deployers/functions-entrypoint.d.ts +48 -0
- package/lib/deployers/functions-entrypoint.d.ts.map +1 -0
- package/lib/deployers/functions-entrypoint.js +78 -0
- package/lib/deployers/functions-entrypoint.js.map +1 -0
- package/lib/deployers/functions.service.d.ts +66 -0
- package/lib/deployers/functions.service.d.ts.map +1 -0
- package/lib/deployers/functions.service.js +322 -0
- package/lib/deployers/functions.service.js.map +1 -0
- package/lib/deployers/functionspackager.service.d.ts +43 -0
- package/lib/deployers/functionspackager.service.d.ts.map +1 -0
- package/lib/deployers/functionspackager.service.js +151 -0
- package/lib/deployers/functionspackager.service.js.map +1 -0
- package/lib/index.d.ts +15 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +18 -0
- package/lib/index.js.map +1 -0
- package/lib/services/azure-parameters.d.ts +41 -0
- package/lib/services/azure-parameters.d.ts.map +1 -0
- package/lib/services/azure-parameters.js +43 -0
- package/lib/services/azure-parameters.js.map +1 -0
- package/lib/services/blob.service.d.ts +157 -0
- package/lib/services/blob.service.d.ts.map +1 -0
- package/lib/services/blob.service.js +428 -0
- package/lib/services/blob.service.js.map +1 -0
- package/lib/services/contributors.d.ts +47 -0
- package/lib/services/contributors.d.ts.map +1 -0
- package/lib/services/contributors.js +2 -0
- package/lib/services/contributors.js.map +1 -0
- package/lib/services/cosmos.service.d.ts +211 -0
- package/lib/services/cosmos.service.d.ts.map +1 -0
- package/lib/services/cosmos.service.js +554 -0
- package/lib/services/cosmos.service.js.map +1 -0
- package/lib/services/functionserver.service.d.ts +42 -0
- package/lib/services/functionserver.service.d.ts.map +1 -0
- package/lib/services/functionserver.service.js +223 -0
- package/lib/services/functionserver.service.js.map +1 -0
- package/lib/services/keyvault.service.d.ts +91 -0
- package/lib/services/keyvault.service.d.ts.map +1 -0
- package/lib/services/keyvault.service.js +225 -0
- package/lib/services/keyvault.service.js.map +1 -0
- package/lib/services/monitorlogger.service.d.ts +66 -0
- package/lib/services/monitorlogger.service.d.ts.map +1 -0
- package/lib/services/monitorlogger.service.js +131 -0
- package/lib/services/monitorlogger.service.js.map +1 -0
- package/lib/services/servicebus.service.d.ts +128 -0
- package/lib/services/servicebus.service.d.ts.map +1 -0
- package/lib/services/servicebus.service.js +324 -0
- package/lib/services/servicebus.service.js.map +1 -0
- package/lib/template.d.ts +53 -0
- package/lib/template.d.ts.map +1 -0
- package/lib/template.js +74 -0
- package/lib/template.js.map +1 -0
- package/package.json +77 -3
- package/webda.module.json +1817 -0
package/lib/template.js
ADDED
|
@@ -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.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.js","sources":["../src/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAWzC;;;GAGG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO;QACL,OAAO,EAAE,iFAAiF;QAC1F,cAAc,EAAE,SAAS;QACzB,UAAU,EAAE,EAAE;QACd,SAAS,EAAE,EAAE;QACb,OAAO,EAAE,EAAE;KACZ,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC;AAC1C,CAAC;AACD;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAa;IACpC,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;AAC/F,CAAC;AACD;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,GAAG,KAAe;IACzD,OAAO,eAAe,CAAC,IAAI,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
|
-
"
|
|
5
|
-
"
|
|
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
|
}
|