@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
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Deployer, SecretString } from "@webda/core";
|
|
2
|
+
import { AzureTemplate } from "../template.js";
|
|
3
|
+
import { AzureArmDeployer, AzureArmDeployerParameters, AzureDeployResult } from "./arm.service.js";
|
|
4
|
+
import { AzureFunctionsPackageOptions } from "./functionspackager.service.js";
|
|
5
|
+
import type { AzureTrigger } from "./functions-entrypoint.js";
|
|
6
|
+
/** Azure Functions Flex Consumption unit settings. */
|
|
7
|
+
export declare class AzureFunctionsDeployerParameters extends AzureArmDeployerParameters implements AzureFunctionsPackageOptions {
|
|
8
|
+
functionApp: string;
|
|
9
|
+
storageAccount: string;
|
|
10
|
+
plan?: string;
|
|
11
|
+
zipPath: string;
|
|
12
|
+
memory: number;
|
|
13
|
+
maximumInstanceCount: number;
|
|
14
|
+
appSettings: Record<string, string | SecretString>;
|
|
15
|
+
triggers?: AzureTrigger[];
|
|
16
|
+
deploymentTimeout: number;
|
|
17
|
+
}
|
|
18
|
+
/** Deploy a Node 22 Functions application with Flex Consumption OneDeploy.
|
|
19
|
+
* @WebdaModda
|
|
20
|
+
*/
|
|
21
|
+
export declare class AzureFunctionsDeployer extends AzureArmDeployer<AzureFunctionsDeployerParameters> implements Deployer {
|
|
22
|
+
static Parameters: typeof AzureFunctionsDeployerParameters;
|
|
23
|
+
/**
|
|
24
|
+
* Write the generated ARM template for review.
|
|
25
|
+
* @param output - Optional template output path
|
|
26
|
+
* @returns Generated ARM template
|
|
27
|
+
*/
|
|
28
|
+
generate(output?: string): Promise<AzureTemplate>;
|
|
29
|
+
/**
|
|
30
|
+
* Build the Functions archive for this deployment unit.
|
|
31
|
+
* @returns The package application result
|
|
32
|
+
*/
|
|
33
|
+
packageApplication(): Promise<import("./functionspackager.service.js").AzureFunctionsPackageResult>;
|
|
34
|
+
/**
|
|
35
|
+
* Return the application resource identifier.
|
|
36
|
+
* @returns The app resource id result
|
|
37
|
+
*/
|
|
38
|
+
getAppResourceId(): string;
|
|
39
|
+
/**
|
|
40
|
+
* Return the managed identity resource identifier.
|
|
41
|
+
* @returns The identity resource id result
|
|
42
|
+
*/
|
|
43
|
+
protected getIdentityResourceId(): string;
|
|
44
|
+
/**
|
|
45
|
+
* Return the ARM expression for the application principal.
|
|
46
|
+
* @returns The app principal id result
|
|
47
|
+
*/
|
|
48
|
+
getAppPrincipalId(): string;
|
|
49
|
+
/**
|
|
50
|
+
* Generate the deployment template without contacting Azure.
|
|
51
|
+
* @returns ARM template without secret values
|
|
52
|
+
*/
|
|
53
|
+
generateTemplate(): AzureTemplate;
|
|
54
|
+
/**
|
|
55
|
+
* Flex Consumption accepts OneDeploy packages at /api/publish.
|
|
56
|
+
* @param zipPath - Path of the Functions deployment archive
|
|
57
|
+
* @param scmHost - Trusted Azure SCM hostname
|
|
58
|
+
*/
|
|
59
|
+
publish(zipPath: string, scmHost: string): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Publish and deploy the application, returning its endpoints.
|
|
62
|
+
* @returns The deploy result
|
|
63
|
+
*/
|
|
64
|
+
deploy(): Promise<AzureDeployResult>;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=functions.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"functions.service.d.ts","sources":["../../src/deployers/functions.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,QAAQ,EAAE,YAAY,EAA8B,MAAM,aAAa,CAAC;AAGvG,OAAO,EAAY,aAAa,EAAgC,MAAM,gBAAgB,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACnG,OAAO,EAAE,4BAA4B,EAA+B,MAAM,gCAAgC,CAAC;AAC3G,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,sDAAsD;AACtD,qBAAa,gCACX,SAAQ,0BACR,YAAW,4BAA4B;IAEvC,WAAW,EAAG,MAAM,CAAC;IACrB,cAAc,EAAG,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,SAA8B;IACrC,MAAM,SAAQ;IACd,oBAAoB,SAAO;IAC3B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAAC,CAAM;IACxD,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,iBAAiB,SAAU;CAC5B;AAED;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,gBAAgB,CAAC,gCAAgC,CAAE,YAAW,QAAQ;IAChH,MAAM,CAAC,UAAU,0CAAoC;IAErD;;;;OAIG;IAEG,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAEtD;IAED;;;OAGG;IAEG,kBAAkB,kFAYvB;IACD;;;OAGG;IACH,gBAAgB,IAAI,MAAM,CAEzB;IACD;;;OAGG;IACH,SAAS,CAAC,qBAAqB,IAAI,MAAM,CAExC;IACD;;;OAGG;IACH,iBAAiB,IAAI,MAAM,CAE1B;IAED;;;OAGG;IACH,gBAAgB,IAAI,aAAa,CAmIhC;IAED;;;;OAIG;IACG,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAyC7D;IAED;;;OAGG;IAEG,MAAM,IAAI,OAAO,CAAC,iBAAiB,CAAC,CASzC;CACF"}
|
|
@@ -0,0 +1,322 @@
|
|
|
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 { Command, CronService, SecretString, useApplication, WebdaError } from "@webda/core";
|
|
36
|
+
import { readFileSync } from "node:fs";
|
|
37
|
+
import { AzureAuth } from "../auth.js";
|
|
38
|
+
import { armValue, resourceId, roleAssignmentId } from "../template.js";
|
|
39
|
+
import { AzureArmDeployer, AzureArmDeployerParameters } from "./arm.service.js";
|
|
40
|
+
import { createAzureFunctionsPackage } from "./functionspackager.service.js";
|
|
41
|
+
/** Azure Functions Flex Consumption unit settings. */
|
|
42
|
+
export class AzureFunctionsDeployerParameters extends AzureArmDeployerParameters {
|
|
43
|
+
constructor() {
|
|
44
|
+
super(...arguments);
|
|
45
|
+
this.zipPath = "dist/azure-functions.zip";
|
|
46
|
+
this.memory = 2048;
|
|
47
|
+
this.maximumInstanceCount = 100;
|
|
48
|
+
this.appSettings = {};
|
|
49
|
+
this.deploymentTimeout = 600000;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/** Deploy a Node 22 Functions application with Flex Consumption OneDeploy.
|
|
53
|
+
* @WebdaModda
|
|
54
|
+
*/
|
|
55
|
+
let AzureFunctionsDeployer = (() => {
|
|
56
|
+
var _a;
|
|
57
|
+
let _classSuper = AzureArmDeployer;
|
|
58
|
+
let _instanceExtraInitializers = [];
|
|
59
|
+
let _generate_decorators;
|
|
60
|
+
let _packageApplication_decorators;
|
|
61
|
+
let _deploy_decorators;
|
|
62
|
+
return _a = class AzureFunctionsDeployer extends _classSuper {
|
|
63
|
+
/**
|
|
64
|
+
* Write the generated ARM template for review.
|
|
65
|
+
* @param output - Optional template output path
|
|
66
|
+
* @returns Generated ARM template
|
|
67
|
+
*/
|
|
68
|
+
async generate(output) {
|
|
69
|
+
return super.generate(output);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Build the Functions archive for this deployment unit.
|
|
73
|
+
* @returns The package application result
|
|
74
|
+
*/
|
|
75
|
+
async packageApplication() {
|
|
76
|
+
const p = this.getResolvedParameters();
|
|
77
|
+
const crons = CronService.resolveCrons().map(cron => ({
|
|
78
|
+
id: CronService.getExportId(cron),
|
|
79
|
+
schedule: cron.cron
|
|
80
|
+
}));
|
|
81
|
+
return createAzureFunctionsPackage(useApplication(), {
|
|
82
|
+
zipPath: p.zipPath,
|
|
83
|
+
package: p.package,
|
|
84
|
+
triggers: p.triggers,
|
|
85
|
+
crons
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Return the application resource identifier.
|
|
90
|
+
* @returns The app resource id result
|
|
91
|
+
*/
|
|
92
|
+
getAppResourceId() {
|
|
93
|
+
return resourceId("Microsoft.Web/sites", this.resources.functionApp);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Return the managed identity resource identifier.
|
|
97
|
+
* @returns The identity resource id result
|
|
98
|
+
*/
|
|
99
|
+
getIdentityResourceId() {
|
|
100
|
+
return resourceId("Microsoft.ManagedIdentity/userAssignedIdentities", `${this.resources.functionApp}-identity`);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Return the ARM expression for the application principal.
|
|
104
|
+
* @returns The app principal id result
|
|
105
|
+
*/
|
|
106
|
+
getAppPrincipalId() {
|
|
107
|
+
return `[reference(${armValue(this.getIdentityResourceId())}, '2023-01-31').principalId]`;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Generate the deployment template without contacting Azure.
|
|
111
|
+
* @returns ARM template without secret values
|
|
112
|
+
*/
|
|
113
|
+
generateTemplate() {
|
|
114
|
+
this.prepare();
|
|
115
|
+
const p = this.resources;
|
|
116
|
+
if (!/^[a-z0-9]{3,24}$/.test(p.storageAccount) || !/^[a-zA-Z0-9][a-zA-Z0-9-]{0,58}[a-zA-Z0-9]$/.test(p.functionApp))
|
|
117
|
+
throw new WebdaError.BadRequest("Functions requires valid functionApp and storageAccount names");
|
|
118
|
+
if (![512, 2048, 4096].includes(p.memory) ||
|
|
119
|
+
!Number.isInteger(p.maximumInstanceCount) ||
|
|
120
|
+
p.maximumInstanceCount < 40 ||
|
|
121
|
+
p.maximumInstanceCount > 1000)
|
|
122
|
+
throw new WebdaError.BadRequest("Invalid Functions Flex memory or instance count");
|
|
123
|
+
const storage = resourceId("Microsoft.Storage/storageAccounts", p.storageAccount), planName = p.plan ?? `${p.functionApp}-plan`;
|
|
124
|
+
this.addResource({
|
|
125
|
+
type: "Microsoft.ManagedIdentity/userAssignedIdentities",
|
|
126
|
+
apiVersion: "2023-01-31",
|
|
127
|
+
name: `${p.functionApp}-identity`,
|
|
128
|
+
location: p.location,
|
|
129
|
+
tags: this.getDefaultTags()
|
|
130
|
+
});
|
|
131
|
+
this.addResource({
|
|
132
|
+
type: "Microsoft.Storage/storageAccounts",
|
|
133
|
+
apiVersion: "2023-05-01",
|
|
134
|
+
name: p.storageAccount,
|
|
135
|
+
location: p.location,
|
|
136
|
+
kind: "StorageV2",
|
|
137
|
+
sku: { name: "Standard_LRS" },
|
|
138
|
+
tags: this.getDefaultTags(),
|
|
139
|
+
properties: {
|
|
140
|
+
supportsHttpsTrafficOnly: true,
|
|
141
|
+
minimumTlsVersion: "TLS1_2",
|
|
142
|
+
allowBlobPublicAccess: false,
|
|
143
|
+
allowSharedKeyAccess: false
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
this.addResource({
|
|
147
|
+
type: "Microsoft.Storage/storageAccounts/blobServices/containers",
|
|
148
|
+
apiVersion: "2023-05-01",
|
|
149
|
+
name: `${p.storageAccount}/default/deployments`,
|
|
150
|
+
dependsOn: [storage],
|
|
151
|
+
properties: { publicAccess: "None" }
|
|
152
|
+
});
|
|
153
|
+
this.addResource({
|
|
154
|
+
type: "Microsoft.Web/serverfarms",
|
|
155
|
+
apiVersion: "2024-04-01",
|
|
156
|
+
name: planName,
|
|
157
|
+
location: p.location,
|
|
158
|
+
kind: "functionapp",
|
|
159
|
+
sku: { tier: "FlexConsumption", name: "FC1" },
|
|
160
|
+
properties: { reserved: true },
|
|
161
|
+
tags: this.getDefaultTags()
|
|
162
|
+
});
|
|
163
|
+
this.Resources();
|
|
164
|
+
for (const role of ["b7e6dc6d-f1e8-4753-8033-0f276bb0955b", "974c5e8b-45b9-4653-ba55-5f855dd0fb88"])
|
|
165
|
+
this.roles.push({
|
|
166
|
+
scope: storage,
|
|
167
|
+
roleDefinitionId: `/subscriptions/${p.subscriptionId}/providers/Microsoft.Authorization/roleDefinitions/${role}`
|
|
168
|
+
});
|
|
169
|
+
this.grantRoles();
|
|
170
|
+
const clientId = `[reference(${armValue(this.getIdentityResourceId())}, '2023-01-31').clientId]`;
|
|
171
|
+
const settings = {
|
|
172
|
+
...this.contributedEnv,
|
|
173
|
+
FUNCTIONS_WORKER_RUNTIME: "node",
|
|
174
|
+
AzureWebJobsStorage__accountName: p.storageAccount,
|
|
175
|
+
AzureWebJobsStorage__credential: "managedidentity",
|
|
176
|
+
AzureWebJobsStorage__clientId: clientId,
|
|
177
|
+
AZURE_CLIENT_ID: clientId,
|
|
178
|
+
...p.appSettings
|
|
179
|
+
};
|
|
180
|
+
const appSettings = Object.entries(settings).map(([name, value]) => {
|
|
181
|
+
if (typeof value === "object" && !(value instanceof SecretString))
|
|
182
|
+
throw new WebdaError.BadRequest("Functions contributor settings must use Key Vault references or appSettings SecretString values");
|
|
183
|
+
return { name, value: value instanceof SecretString ? this.secureParameter(value) : value };
|
|
184
|
+
});
|
|
185
|
+
this.addResource({
|
|
186
|
+
type: "Microsoft.Web/sites",
|
|
187
|
+
apiVersion: "2024-04-01",
|
|
188
|
+
name: p.functionApp,
|
|
189
|
+
location: p.location,
|
|
190
|
+
kind: "functionapp,linux",
|
|
191
|
+
tags: this.getDefaultTags(),
|
|
192
|
+
identity: {
|
|
193
|
+
type: "SystemAssigned, UserAssigned",
|
|
194
|
+
userAssignedIdentities: { [this.getIdentityResourceId()]: {} }
|
|
195
|
+
},
|
|
196
|
+
dependsOn: [
|
|
197
|
+
storage,
|
|
198
|
+
this.getIdentityResourceId(),
|
|
199
|
+
resourceId("Microsoft.Web/serverfarms", planName),
|
|
200
|
+
resourceId("Microsoft.Storage/storageAccounts/blobServices/containers", p.storageAccount, "default", "deployments"),
|
|
201
|
+
...this.template.resources
|
|
202
|
+
.filter(resource => resource.type === "Microsoft.Authorization/roleAssignments")
|
|
203
|
+
.map(roleAssignmentId)
|
|
204
|
+
],
|
|
205
|
+
properties: {
|
|
206
|
+
serverFarmId: resourceId("Microsoft.Web/serverfarms", planName),
|
|
207
|
+
httpsOnly: true,
|
|
208
|
+
siteConfig: { appSettings, minTlsVersion: "1.2" },
|
|
209
|
+
functionAppConfig: {
|
|
210
|
+
runtime: { name: "node", version: "22" },
|
|
211
|
+
scaleAndConcurrency: { instanceMemoryMB: p.memory, maximumInstanceCount: p.maximumInstanceCount },
|
|
212
|
+
deployment: {
|
|
213
|
+
storage: {
|
|
214
|
+
type: "blobContainer",
|
|
215
|
+
value: `https://${p.storageAccount}.blob.core.windows.net/deployments`,
|
|
216
|
+
authentication: {
|
|
217
|
+
type: "UserAssignedIdentity",
|
|
218
|
+
userAssignedIdentityResourceId: this.getIdentityResourceId()
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
this.template.outputs.fqdn = {
|
|
226
|
+
type: "string",
|
|
227
|
+
value: `[reference(${armValue(this.getAppResourceId())}, '2024-04-01').defaultHostName]`
|
|
228
|
+
};
|
|
229
|
+
this.template.outputs.hostNames = {
|
|
230
|
+
type: "array",
|
|
231
|
+
value: `[reference(${armValue(this.getAppResourceId())}, '2024-04-01').enabledHostNames]`
|
|
232
|
+
};
|
|
233
|
+
return this.template;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Flex Consumption accepts OneDeploy packages at /api/publish.
|
|
237
|
+
* @param zipPath - Path of the Functions deployment archive
|
|
238
|
+
* @param scmHost - Trusted Azure SCM hostname
|
|
239
|
+
*/
|
|
240
|
+
async publish(zipPath, scmHost) {
|
|
241
|
+
if (!/^[a-zA-Z0-9-]+\.scm\.(?:[a-zA-Z0-9-]+\.)?azurewebsites\.net$/.test(scmHost))
|
|
242
|
+
throw new WebdaError.BadRequest("Invalid Azure Functions SCM hostname");
|
|
243
|
+
const auth = new AzureAuth(this.resources);
|
|
244
|
+
const headers = { Authorization: `Bearer ${await auth.getArmToken()}`, "Content-Type": "application/zip" };
|
|
245
|
+
const origin = `https://${scmHost}`;
|
|
246
|
+
const deadline = Date.now() + this.resources.deploymentTimeout;
|
|
247
|
+
try {
|
|
248
|
+
let response = await fetch(`${origin}/api/publish?type=zip&remoteBuild=false`, {
|
|
249
|
+
method: "POST",
|
|
250
|
+
headers,
|
|
251
|
+
body: readFileSync(zipPath),
|
|
252
|
+
redirect: "error",
|
|
253
|
+
signal: AbortSignal.timeout(this.resources.deploymentTimeout)
|
|
254
|
+
});
|
|
255
|
+
if (!response.ok)
|
|
256
|
+
throw new Error();
|
|
257
|
+
let location = response.headers.get("location");
|
|
258
|
+
if (response.status === 202 && !location)
|
|
259
|
+
throw new Error();
|
|
260
|
+
while (location) {
|
|
261
|
+
const url = new URL(location, origin);
|
|
262
|
+
if (url.origin !== origin || url.username || url.password || Date.now() >= deadline)
|
|
263
|
+
throw new Error();
|
|
264
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
265
|
+
response = await fetch(url, {
|
|
266
|
+
headers: { Authorization: `Bearer ${await auth.getArmToken()}` },
|
|
267
|
+
redirect: "error",
|
|
268
|
+
signal: AbortSignal.timeout(Math.max(1, deadline - Date.now()))
|
|
269
|
+
});
|
|
270
|
+
if (!response.ok)
|
|
271
|
+
throw new Error();
|
|
272
|
+
if (response.status === 202)
|
|
273
|
+
continue;
|
|
274
|
+
const status = (await response.json());
|
|
275
|
+
if (status.failed || status.status === 3)
|
|
276
|
+
throw new Error();
|
|
277
|
+
if (status.status === 4 || status.complete === true)
|
|
278
|
+
break;
|
|
279
|
+
if (status.status === undefined)
|
|
280
|
+
throw new Error();
|
|
281
|
+
location = response.headers.get("location") ?? location;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
catch {
|
|
285
|
+
throw new WebdaError.CodeError("AZURE_FUNCTIONS_PUBLISH_FAILED", "Azure Functions OneDeploy failed; inspect the deployment status in the Azure portal");
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Publish and deploy the application, returning its endpoints.
|
|
290
|
+
* @returns The deploy result
|
|
291
|
+
*/
|
|
292
|
+
async deploy() {
|
|
293
|
+
this.generateTemplate();
|
|
294
|
+
this.writeTemplate();
|
|
295
|
+
const packaged = await this.packageApplication();
|
|
296
|
+
const outputs = await this.sendTemplate();
|
|
297
|
+
const scm = outputs.hostNames?.value?.find(host => host.includes(".scm."));
|
|
298
|
+
if (!scm)
|
|
299
|
+
throw new WebdaError.CodeError("AZURE_FUNCTIONS_SCM", "ARM did not return a Functions SCM hostname");
|
|
300
|
+
await this.publish(packaged.zipPath, scm);
|
|
301
|
+
return (this.result = { fqdn: outputs.fqdn?.value, outputs });
|
|
302
|
+
}
|
|
303
|
+
constructor() {
|
|
304
|
+
super(...arguments);
|
|
305
|
+
__runInitializers(this, _instanceExtraInitializers);
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
(() => {
|
|
309
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
310
|
+
_generate_decorators = [Command("azure template", { description: "Generate the Functions ARM template" })];
|
|
311
|
+
_packageApplication_decorators = [Command("azure package", { description: "Package the application for Azure Functions" })];
|
|
312
|
+
_deploy_decorators = [Command("deploy", { description: "Package and deploy to Azure Functions Flex Consumption" })];
|
|
313
|
+
__esDecorate(_a, null, _generate_decorators, { kind: "method", name: "generate", static: false, private: false, access: { has: obj => "generate" in obj, get: obj => obj.generate }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
314
|
+
__esDecorate(_a, null, _packageApplication_decorators, { kind: "method", name: "packageApplication", static: false, private: false, access: { has: obj => "packageApplication" in obj, get: obj => obj.packageApplication }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
315
|
+
__esDecorate(_a, null, _deploy_decorators, { kind: "method", name: "deploy", static: false, private: false, access: { has: obj => "deploy" in obj, get: obj => obj.deploy }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
316
|
+
if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
317
|
+
})(),
|
|
318
|
+
_a.Parameters = AzureFunctionsDeployerParameters,
|
|
319
|
+
_a;
|
|
320
|
+
})();
|
|
321
|
+
export { AzureFunctionsDeployer };
|
|
322
|
+
//# sourceMappingURL=functions.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"functions.service.js","sources":["../../src/deployers/functions.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAY,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,a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CAAC;8CASjF,OAAO,CAAC,eAAe,EAAE,EAAE,WAAW,EAAE,6CAA6C,EAAE,CAAC;kCAiOxF,OAAO,CAAC,QAAQ,EAAE,EAAE,WAAW,EAAE,wDAAwD,EAAE,CAAC;YAzO7F,yKAAM,QAAQ,6DAEb;YAOD,uMAAM,kBAAkB,6DAYvB;YAqND,mKAAM,MAAM,6DASX;;;QA3PM,aAAU,GAAG,gCAAiC;;;SAD1C,sBAAsB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Application, Deployer, PackageOptions, Service, ServiceParameters } from "@webda/core";
|
|
2
|
+
import type { AzureTrigger } from "./functions-entrypoint.js";
|
|
3
|
+
export interface AzureFunctionsPackageOptions {
|
|
4
|
+
zipPath?: string;
|
|
5
|
+
package?: PackageOptions;
|
|
6
|
+
crons?: {
|
|
7
|
+
id: string;
|
|
8
|
+
schedule: string;
|
|
9
|
+
}[];
|
|
10
|
+
triggers?: AzureTrigger[];
|
|
11
|
+
}
|
|
12
|
+
export interface AzureFunctionsPackageResult {
|
|
13
|
+
zipPath: string;
|
|
14
|
+
files: number;
|
|
15
|
+
size: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Package a Webda application for the Azure Functions Node v4 programming model.
|
|
19
|
+
* @param application - Webda application to package
|
|
20
|
+
* @param options - Encryption or packaging options
|
|
21
|
+
* @returns Archive path, size and file count
|
|
22
|
+
*/
|
|
23
|
+
export declare function createAzureFunctionsPackage(application: Application, options?: AzureFunctionsPackageOptions): Promise<AzureFunctionsPackageResult>;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
export declare class AzureFunctionsPackagerParameters extends ServiceParameters implements AzureFunctionsPackageOptions {
|
|
28
|
+
zipPath: string;
|
|
29
|
+
package?: PackageOptions;
|
|
30
|
+
triggers?: AzureTrigger[];
|
|
31
|
+
}
|
|
32
|
+
/** Build a reproducible Azure Functions deployment archive.
|
|
33
|
+
* @WebdaModda
|
|
34
|
+
*/
|
|
35
|
+
export declare class AzureFunctionsPackager extends Service<AzureFunctionsPackagerParameters> implements Deployer {
|
|
36
|
+
static Parameters: typeof AzureFunctionsPackagerParameters;
|
|
37
|
+
/**
|
|
38
|
+
* Create the Functions archive with the declared cron timers.
|
|
39
|
+
* @returns The package result
|
|
40
|
+
*/
|
|
41
|
+
package(): Promise<AzureFunctionsPackageResult>;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=functionspackager.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"functionspackager.service.d.ts","sources":["../../src/deployers/functionspackager.service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAGX,QAAQ,EAIR,cAAc,EAEd,OAAO,EACP,iBAAiB,EAIlB,MAAM,aAAa,CAAC;AAIrB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,MAAM,WAAW,4BAA4B;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,KAAK,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC3C,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;CAC3B;AACD,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,wBAAsB,2BAA2B,CAC/C,WAAW,EAAE,WAAW,EACxB,OAAO,GAAE,4BAAiC,GACzC,OAAO,CAAC,2BAA2B,CAAC,CAkEtC;AAED;;GAEG;AACH,qBAAa,gCAAiC,SAAQ,iBAAkB,YAAW,4BAA4B;IAC7G,OAAO,SAA8B;IACrC,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;CAC3B;AAED;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,OAAO,CAAC,gCAAgC,CAAE,YAAW,QAAQ;IACvG,MAAM,CAAC,UAAU,0CAAoC;IAErD;;;OAGG;IAEG,OAAO,IAAI,OAAO,CAAC,2BAA2B,CAAC,CAOpD;CACF"}
|
|
@@ -0,0 +1,151 @@
|
|
|
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 { Command, CronService, getDeploymentVariables, PACKAGED_CONFIGURATION, packageApplication, resolveDeploymentVariables, Service, ServiceParameters, useApplication, writeZip } from "@webda/core";
|
|
36
|
+
import { readFileSync, statSync } from "node:fs";
|
|
37
|
+
import { relative, resolve, sep } from "node:path";
|
|
38
|
+
import { functionsSchedule } from "../template.js";
|
|
39
|
+
/**
|
|
40
|
+
* Package a Webda application for the Azure Functions Node v4 programming model.
|
|
41
|
+
* @param application - Webda application to package
|
|
42
|
+
* @param options - Encryption or packaging options
|
|
43
|
+
* @returns Archive path, size and file count
|
|
44
|
+
*/
|
|
45
|
+
export async function createAzureFunctionsPackage(application, options = {}) {
|
|
46
|
+
const zipPath = resolve(application.applicationPath, options.zipPath ?? "dist/azure-functions.zip");
|
|
47
|
+
const packaged = await packageApplication(application, {
|
|
48
|
+
...options.package,
|
|
49
|
+
ignores: [...(options.package?.ignores ?? []), relative(application.applicationPath, zipPath).split(sep)[0]],
|
|
50
|
+
modules: {
|
|
51
|
+
includes: [...new Set(["@webda/azure", "@azure/functions", ...(options.package?.modules?.includes ?? [])])],
|
|
52
|
+
excludes: options.package?.modules?.excludes
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
const configuration = packaged.configuration;
|
|
56
|
+
// Packaging can be called for an app that has not loaded this module. Install the generated server
|
|
57
|
+
// definition in its cached modules so the default adapter resolves during packaged boot.
|
|
58
|
+
const manifest = JSON.parse(readFileSync(new URL("../../webda.module.json", import.meta.url), "utf8"));
|
|
59
|
+
const modules = (configuration.cachedModules ?? (configuration.cachedModules = {}));
|
|
60
|
+
modules.moddas ?? (modules.moddas = {});
|
|
61
|
+
if (!modules.moddas["Webda/AzureFunctionServer"]) {
|
|
62
|
+
const definition = { ...manifest.moddas["Webda/AzureFunctionServer"] };
|
|
63
|
+
for (const key of ["Import", "Configuration"])
|
|
64
|
+
definition[key] = `node_modules/@webda/azure/${definition[key]}`;
|
|
65
|
+
modules.moddas["Webda/AzureFunctionServer"] = definition;
|
|
66
|
+
}
|
|
67
|
+
configuration.services ?? (configuration.services = {});
|
|
68
|
+
if (!Object.values(configuration.services).some(service => ["AzureFunctionServer", "Webda/AzureFunctionServer"].includes(service?.type)))
|
|
69
|
+
configuration.services.AzureFunctionServer = { type: "Webda/AzureFunctionServer" };
|
|
70
|
+
const crons = (options.crons ?? []).map(cron => ({ ...cron, schedule: functionsSchedule(cron.schedule) }));
|
|
71
|
+
const triggers = (options.triggers ?? []).map(trigger => trigger.type === "timer" ? { ...trigger, schedule: functionsSchedule(trigger.schedule) } : trigger);
|
|
72
|
+
const entries = [];
|
|
73
|
+
for (const file of packaged.files) {
|
|
74
|
+
if (["host.json", "webda-functions.mjs", "local.settings.json"].includes(file.target))
|
|
75
|
+
continue;
|
|
76
|
+
if (file.target === PACKAGED_CONFIGURATION)
|
|
77
|
+
entries.push({ target: file.target, content: JSON.stringify(configuration, null, 2) });
|
|
78
|
+
else if (file.target === "package.json") {
|
|
79
|
+
const descriptor = JSON.parse(file.content ?? readFileSync(file.source, "utf8"));
|
|
80
|
+
// Dependencies are already packaged; prevent a host-side install of workspace/dev references.
|
|
81
|
+
delete descriptor.devDependencies;
|
|
82
|
+
delete descriptor.scripts;
|
|
83
|
+
delete descriptor.workspaces;
|
|
84
|
+
delete descriptor.packageManager;
|
|
85
|
+
descriptor.main = "webda-functions.mjs";
|
|
86
|
+
entries.push({ target: "package.json", content: JSON.stringify(descriptor, null, 2) });
|
|
87
|
+
}
|
|
88
|
+
else
|
|
89
|
+
entries.push(file);
|
|
90
|
+
}
|
|
91
|
+
entries.push({
|
|
92
|
+
target: "host.json",
|
|
93
|
+
content: JSON.stringify({
|
|
94
|
+
version: "2.0",
|
|
95
|
+
extensions: { http: { routePrefix: "" } },
|
|
96
|
+
extensionBundle: { id: "Microsoft.Azure.Functions.ExtensionBundle", version: "[4.*, 5.0.0)" }
|
|
97
|
+
}, null, 2)
|
|
98
|
+
});
|
|
99
|
+
entries.push({
|
|
100
|
+
target: "webda-functions.mjs",
|
|
101
|
+
content: `import "@webda/azure";\nimport { registerAzureFunctions } from "@webda/azure/lib/deployers/functions-entrypoint.js";\nregisterAzureFunctions(${JSON.stringify(crons)}, ${JSON.stringify(triggers)});\n`
|
|
102
|
+
});
|
|
103
|
+
writeZip(zipPath, entries);
|
|
104
|
+
return { zipPath, files: entries.length, size: statSync(zipPath).size };
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
*
|
|
108
|
+
*/
|
|
109
|
+
export class AzureFunctionsPackagerParameters extends ServiceParameters {
|
|
110
|
+
constructor() {
|
|
111
|
+
super(...arguments);
|
|
112
|
+
this.zipPath = "dist/azure-functions.zip";
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/** Build a reproducible Azure Functions deployment archive.
|
|
116
|
+
* @WebdaModda
|
|
117
|
+
*/
|
|
118
|
+
let AzureFunctionsPackager = (() => {
|
|
119
|
+
var _a;
|
|
120
|
+
let _classSuper = Service;
|
|
121
|
+
let _instanceExtraInitializers = [];
|
|
122
|
+
let _package_decorators;
|
|
123
|
+
return _a = class AzureFunctionsPackager extends _classSuper {
|
|
124
|
+
/**
|
|
125
|
+
* Create the Functions archive with the declared cron timers.
|
|
126
|
+
* @returns The package result
|
|
127
|
+
*/
|
|
128
|
+
async package() {
|
|
129
|
+
const options = resolveDeploymentVariables(this.parameters, getDeploymentVariables(this));
|
|
130
|
+
const crons = CronService.resolveCrons().map(cron => ({
|
|
131
|
+
id: CronService.getExportId(cron),
|
|
132
|
+
schedule: cron.cron
|
|
133
|
+
}));
|
|
134
|
+
return createAzureFunctionsPackage(useApplication(), { ...options, crons });
|
|
135
|
+
}
|
|
136
|
+
constructor() {
|
|
137
|
+
super(...arguments);
|
|
138
|
+
__runInitializers(this, _instanceExtraInitializers);
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
(() => {
|
|
142
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
143
|
+
_package_decorators = [Command("azure package", { description: "Package the application for Azure Functions" })];
|
|
144
|
+
__esDecorate(_a, null, _package_decorators, { kind: "method", name: "package", static: false, private: false, access: { has: obj => "package" in obj, get: obj => obj.package }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
145
|
+
if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
146
|
+
})(),
|
|
147
|
+
_a.Parameters = AzureFunctionsPackagerParameters,
|
|
148
|
+
_a;
|
|
149
|
+
})();
|
|
150
|
+
export { AzureFunctionsPackager };
|
|
151
|
+
//# sourceMappingURL=functionspackager.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"functionspackager.service.js","sources":["../../src/deployers/functionspackager.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAEL,OAAO,EACP,WAAW,EAEX,sBAAsB,EACtB,sBAAsB,EACtB,kBAAkB,EAElB,0BAA0B,EAC1B,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,QAAQ,EAET,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE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D1C,sBAAsB"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from "./services/azure-parameters.js";
|
|
2
|
+
export * from "./services/contributors.js";
|
|
3
|
+
export * from "./services/keyvault.service.js";
|
|
4
|
+
export * from "./services/monitorlogger.service.js";
|
|
5
|
+
export * from "./services/servicebus.service.js";
|
|
6
|
+
export * from "./services/blob.service.js";
|
|
7
|
+
export * from "./services/cosmos.service.js";
|
|
8
|
+
export * from "./services/functionserver.service.js";
|
|
9
|
+
export * from "./auth.js";
|
|
10
|
+
export * from "./template.js";
|
|
11
|
+
export * from "./deployers/arm.service.js";
|
|
12
|
+
export * from "./deployers/containerapps.service.js";
|
|
13
|
+
export * from "./deployers/functionspackager.service.js";
|
|
14
|
+
export * from "./deployers/functions.service.js";
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC;AACpD,cAAc,kCAAkC,CAAC;AACjD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sCAAsC,CAAC;AACrD,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sCAAsC,CAAC;AACrD,cAAc,0CAA0C,CAAC;AACzD,cAAc,kCAAkC,CAAC"}
|