@azure/arm-resourcesbicep 1.0.0-alpha.20250910.1
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/CHANGELOG.md +7 -0
- package/LICENSE +21 -0
- package/README.md +115 -0
- package/dist/browser/api/bicepContext.d.ts +19 -0
- package/dist/browser/api/bicepContext.js +38 -0
- package/dist/browser/api/bicepContext.js.map +1 -0
- package/dist/browser/api/decompileOperationGroup/index.d.ts +3 -0
- package/dist/browser/api/decompileOperationGroup/index.js +4 -0
- package/dist/browser/api/decompileOperationGroup/index.js.map +1 -0
- package/dist/browser/api/decompileOperationGroup/operations.d.ts +9 -0
- package/dist/browser/api/decompileOperationGroup/operations.js +37 -0
- package/dist/browser/api/decompileOperationGroup/operations.js.map +1 -0
- package/dist/browser/api/decompileOperationGroup/options.d.ts +5 -0
- package/dist/browser/api/decompileOperationGroup/options.js +4 -0
- package/dist/browser/api/decompileOperationGroup/options.js.map +1 -0
- package/dist/browser/api/index.d.ts +2 -0
- package/dist/browser/api/index.js +4 -0
- package/dist/browser/api/index.js.map +1 -0
- package/dist/browser/bicepClient.d.ts +15 -0
- package/dist/browser/bicepClient.js +25 -0
- package/dist/browser/bicepClient.js.map +1 -0
- package/dist/browser/classic/decompileOperationGroup/index.d.ts +10 -0
- package/dist/browser/classic/decompileOperationGroup/index.js +14 -0
- package/dist/browser/classic/decompileOperationGroup/index.js.map +1 -0
- package/dist/browser/classic/index.d.ts +2 -0
- package/dist/browser/classic/index.js +4 -0
- package/dist/browser/classic/index.js.map +1 -0
- package/dist/browser/index.d.ts +6 -0
- package/dist/browser/index.js +5 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/logger.d.ts +2 -0
- package/dist/browser/logger.js +5 -0
- package/dist/browser/logger.js.map +1 -0
- package/dist/browser/models/index.d.ts +2 -0
- package/dist/browser/models/index.js +4 -0
- package/dist/browser/models/index.js.map +1 -0
- package/dist/browser/models/models.d.ts +59 -0
- package/dist/browser/models/models.js +61 -0
- package/dist/browser/models/models.js.map +1 -0
- package/dist/browser/package.json +3 -0
- package/dist/browser/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/browser/static-helpers/urlTemplate.js +169 -0
- package/dist/browser/static-helpers/urlTemplate.js.map +1 -0
- package/dist/commonjs/api/bicepContext.d.ts +19 -0
- package/dist/commonjs/api/bicepContext.js +41 -0
- package/dist/commonjs/api/bicepContext.js.map +1 -0
- package/dist/commonjs/api/decompileOperationGroup/index.d.ts +3 -0
- package/dist/commonjs/api/decompileOperationGroup/index.js +8 -0
- package/dist/commonjs/api/decompileOperationGroup/index.js.map +1 -0
- package/dist/commonjs/api/decompileOperationGroup/operations.d.ts +9 -0
- package/dist/commonjs/api/decompileOperationGroup/operations.js +42 -0
- package/dist/commonjs/api/decompileOperationGroup/operations.js.map +1 -0
- package/dist/commonjs/api/decompileOperationGroup/options.d.ts +5 -0
- package/dist/commonjs/api/decompileOperationGroup/options.js +5 -0
- package/dist/commonjs/api/decompileOperationGroup/options.js.map +1 -0
- package/dist/commonjs/api/index.d.ts +2 -0
- package/dist/commonjs/api/index.js +8 -0
- package/dist/commonjs/api/index.js.map +1 -0
- package/dist/commonjs/bicepClient.d.ts +15 -0
- package/dist/commonjs/bicepClient.js +29 -0
- package/dist/commonjs/bicepClient.js.map +1 -0
- package/dist/commonjs/classic/decompileOperationGroup/index.d.ts +10 -0
- package/dist/commonjs/classic/decompileOperationGroup/index.js +17 -0
- package/dist/commonjs/classic/decompileOperationGroup/index.js.map +1 -0
- package/dist/commonjs/classic/index.d.ts +2 -0
- package/dist/commonjs/classic/index.js +5 -0
- package/dist/commonjs/classic/index.js.map +1 -0
- package/dist/commonjs/index.d.ts +6 -0
- package/dist/commonjs/index.js +10 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/logger.d.ts +2 -0
- package/dist/commonjs/logger.js +8 -0
- package/dist/commonjs/logger.js.map +1 -0
- package/dist/commonjs/models/index.d.ts +2 -0
- package/dist/commonjs/models/index.js +8 -0
- package/dist/commonjs/models/index.js.map +1 -0
- package/dist/commonjs/models/models.d.ts +59 -0
- package/dist/commonjs/models/models.js +73 -0
- package/dist/commonjs/models/models.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/commonjs/static-helpers/urlTemplate.js +172 -0
- package/dist/commonjs/static-helpers/urlTemplate.js.map +1 -0
- package/dist/commonjs/tsdoc-metadata.json +11 -0
- package/dist/esm/api/bicepContext.d.ts +19 -0
- package/dist/esm/api/bicepContext.js +38 -0
- package/dist/esm/api/bicepContext.js.map +1 -0
- package/dist/esm/api/decompileOperationGroup/index.d.ts +3 -0
- package/dist/esm/api/decompileOperationGroup/index.js +4 -0
- package/dist/esm/api/decompileOperationGroup/index.js.map +1 -0
- package/dist/esm/api/decompileOperationGroup/operations.d.ts +9 -0
- package/dist/esm/api/decompileOperationGroup/operations.js +37 -0
- package/dist/esm/api/decompileOperationGroup/operations.js.map +1 -0
- package/dist/esm/api/decompileOperationGroup/options.d.ts +5 -0
- package/dist/esm/api/decompileOperationGroup/options.js +4 -0
- package/dist/esm/api/decompileOperationGroup/options.js.map +1 -0
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/api/index.js +4 -0
- package/dist/esm/api/index.js.map +1 -0
- package/dist/esm/bicepClient.d.ts +15 -0
- package/dist/esm/bicepClient.js +25 -0
- package/dist/esm/bicepClient.js.map +1 -0
- package/dist/esm/classic/decompileOperationGroup/index.d.ts +10 -0
- package/dist/esm/classic/decompileOperationGroup/index.js +14 -0
- package/dist/esm/classic/decompileOperationGroup/index.js.map +1 -0
- package/dist/esm/classic/index.d.ts +2 -0
- package/dist/esm/classic/index.js +4 -0
- package/dist/esm/classic/index.js.map +1 -0
- package/dist/esm/index.d.ts +6 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/logger.d.ts +2 -0
- package/dist/esm/logger.js +5 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/models/index.d.ts +2 -0
- package/dist/esm/models/index.js +4 -0
- package/dist/esm/models/index.js.map +1 -0
- package/dist/esm/models/models.d.ts +59 -0
- package/dist/esm/models/models.js +61 -0
- package/dist/esm/models/models.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/esm/static-helpers/urlTemplate.js +169 -0
- package/dist/esm/static-helpers/urlTemplate.js.map +1 -0
- package/dist/react-native/api/bicepContext.d.ts +19 -0
- package/dist/react-native/api/bicepContext.js +38 -0
- package/dist/react-native/api/bicepContext.js.map +1 -0
- package/dist/react-native/api/decompileOperationGroup/index.d.ts +3 -0
- package/dist/react-native/api/decompileOperationGroup/index.js +4 -0
- package/dist/react-native/api/decompileOperationGroup/index.js.map +1 -0
- package/dist/react-native/api/decompileOperationGroup/operations.d.ts +9 -0
- package/dist/react-native/api/decompileOperationGroup/operations.js +37 -0
- package/dist/react-native/api/decompileOperationGroup/operations.js.map +1 -0
- package/dist/react-native/api/decompileOperationGroup/options.d.ts +5 -0
- package/dist/react-native/api/decompileOperationGroup/options.js +4 -0
- package/dist/react-native/api/decompileOperationGroup/options.js.map +1 -0
- package/dist/react-native/api/index.d.ts +2 -0
- package/dist/react-native/api/index.js +4 -0
- package/dist/react-native/api/index.js.map +1 -0
- package/dist/react-native/bicepClient.d.ts +15 -0
- package/dist/react-native/bicepClient.js +25 -0
- package/dist/react-native/bicepClient.js.map +1 -0
- package/dist/react-native/classic/decompileOperationGroup/index.d.ts +10 -0
- package/dist/react-native/classic/decompileOperationGroup/index.js +14 -0
- package/dist/react-native/classic/decompileOperationGroup/index.js.map +1 -0
- package/dist/react-native/classic/index.d.ts +2 -0
- package/dist/react-native/classic/index.js +4 -0
- package/dist/react-native/classic/index.js.map +1 -0
- package/dist/react-native/index.d.ts +6 -0
- package/dist/react-native/index.js +5 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/logger.d.ts +2 -0
- package/dist/react-native/logger.js +5 -0
- package/dist/react-native/logger.js.map +1 -0
- package/dist/react-native/models/index.d.ts +2 -0
- package/dist/react-native/models/index.js +4 -0
- package/dist/react-native/models/index.js.map +1 -0
- package/dist/react-native/models/models.d.ts +59 -0
- package/dist/react-native/models/models.js +61 -0
- package/dist/react-native/models/models.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/dist/react-native/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/react-native/static-helpers/urlTemplate.js +169 -0
- package/dist/react-native/static-helpers/urlTemplate.js.map +1 -0
- package/package.json +192 -0
- package/review/arm-resourcesbicep-api-decompileOperationGroup-node.api.md +19 -0
- package/review/arm-resourcesbicep-api-node.api.md +27 -0
- package/review/arm-resourcesbicep-models-node.api.md +51 -0
- package/review/arm-resourcesbicep-node.api.md +77 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
// ---------------------
|
|
4
|
+
// helpers
|
|
5
|
+
// ---------------------
|
|
6
|
+
function encodeComponent(val, reserved, op) {
|
|
7
|
+
return (reserved ?? op === "+") || op === "#"
|
|
8
|
+
? encodeReservedComponent(val)
|
|
9
|
+
: encodeRFC3986URIComponent(val);
|
|
10
|
+
}
|
|
11
|
+
function encodeReservedComponent(str) {
|
|
12
|
+
return str
|
|
13
|
+
.split(/(%[0-9A-Fa-f]{2})/g)
|
|
14
|
+
.map((part) => (!/%[0-9A-Fa-f]/.test(part) ? encodeURI(part) : part))
|
|
15
|
+
.join("");
|
|
16
|
+
}
|
|
17
|
+
function encodeRFC3986URIComponent(str) {
|
|
18
|
+
return encodeURIComponent(str).replace(/[!'()*]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`);
|
|
19
|
+
}
|
|
20
|
+
function isDefined(val) {
|
|
21
|
+
return val !== undefined && val !== null;
|
|
22
|
+
}
|
|
23
|
+
function getNamedAndIfEmpty(op) {
|
|
24
|
+
return [!!op && [";", "?", "&"].includes(op), !!op && ["?", "&"].includes(op) ? "=" : ""];
|
|
25
|
+
}
|
|
26
|
+
function getFirstOrSep(op, isFirst = false) {
|
|
27
|
+
if (isFirst) {
|
|
28
|
+
return !op || op === "+" ? "" : op;
|
|
29
|
+
}
|
|
30
|
+
else if (!op || op === "+" || op === "#") {
|
|
31
|
+
return ",";
|
|
32
|
+
}
|
|
33
|
+
else if (op === "?") {
|
|
34
|
+
return "&";
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
return op;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function getExpandedValue(option) {
|
|
41
|
+
let isFirst = option.isFirst;
|
|
42
|
+
const { op, varName, varValue: value, reserved } = option;
|
|
43
|
+
const vals = [];
|
|
44
|
+
const [named, ifEmpty] = getNamedAndIfEmpty(op);
|
|
45
|
+
if (Array.isArray(value)) {
|
|
46
|
+
for (const val of value.filter(isDefined)) {
|
|
47
|
+
// prepare the following parts: separator, varName, value
|
|
48
|
+
vals.push(`${getFirstOrSep(op, isFirst)}`);
|
|
49
|
+
if (named && varName) {
|
|
50
|
+
vals.push(`${encodeURIComponent(varName)}`);
|
|
51
|
+
val === "" ? vals.push(ifEmpty) : vals.push("=");
|
|
52
|
+
}
|
|
53
|
+
vals.push(encodeComponent(val, reserved, op));
|
|
54
|
+
isFirst = false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
else if (typeof value === "object") {
|
|
58
|
+
for (const key of Object.keys(value)) {
|
|
59
|
+
const val = value[key];
|
|
60
|
+
if (!isDefined(val)) {
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
// prepare the following parts: separator, key, value
|
|
64
|
+
vals.push(`${getFirstOrSep(op, isFirst)}`);
|
|
65
|
+
if (key) {
|
|
66
|
+
vals.push(`${encodeURIComponent(key)}`);
|
|
67
|
+
named && val === "" ? vals.push(ifEmpty) : vals.push("=");
|
|
68
|
+
}
|
|
69
|
+
vals.push(encodeComponent(val, reserved, op));
|
|
70
|
+
isFirst = false;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return vals.join("");
|
|
74
|
+
}
|
|
75
|
+
function getNonExpandedValue(option) {
|
|
76
|
+
const { op, varName, varValue: value, isFirst, reserved } = option;
|
|
77
|
+
const vals = [];
|
|
78
|
+
const first = getFirstOrSep(op, isFirst);
|
|
79
|
+
const [named, ifEmpty] = getNamedAndIfEmpty(op);
|
|
80
|
+
if (named && varName) {
|
|
81
|
+
vals.push(encodeComponent(varName, reserved, op));
|
|
82
|
+
if (value === "") {
|
|
83
|
+
if (!ifEmpty) {
|
|
84
|
+
vals.push(ifEmpty);
|
|
85
|
+
}
|
|
86
|
+
return !vals.join("") ? undefined : `${first}${vals.join("")}`;
|
|
87
|
+
}
|
|
88
|
+
vals.push("=");
|
|
89
|
+
}
|
|
90
|
+
const items = [];
|
|
91
|
+
if (Array.isArray(value)) {
|
|
92
|
+
for (const val of value.filter(isDefined)) {
|
|
93
|
+
items.push(encodeComponent(val, reserved, op));
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
else if (typeof value === "object") {
|
|
97
|
+
for (const key of Object.keys(value)) {
|
|
98
|
+
if (!isDefined(value[key])) {
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
items.push(encodeRFC3986URIComponent(key));
|
|
102
|
+
items.push(encodeComponent(value[key], reserved, op));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
vals.push(items.join(","));
|
|
106
|
+
return !vals.join(",") ? undefined : `${first}${vals.join("")}`;
|
|
107
|
+
}
|
|
108
|
+
function getVarValue(option) {
|
|
109
|
+
const { op, varName, modifier, isFirst, reserved, varValue: value } = option;
|
|
110
|
+
if (!isDefined(value)) {
|
|
111
|
+
return undefined;
|
|
112
|
+
}
|
|
113
|
+
else if (["string", "number", "boolean"].includes(typeof value)) {
|
|
114
|
+
let val = value.toString();
|
|
115
|
+
const [named, ifEmpty] = getNamedAndIfEmpty(op);
|
|
116
|
+
const vals = [getFirstOrSep(op, isFirst)];
|
|
117
|
+
if (named && varName) {
|
|
118
|
+
// No need to encode varName considering it is already encoded
|
|
119
|
+
vals.push(varName);
|
|
120
|
+
val === "" ? vals.push(ifEmpty) : vals.push("=");
|
|
121
|
+
}
|
|
122
|
+
if (modifier && modifier !== "*") {
|
|
123
|
+
val = val.substring(0, parseInt(modifier, 10));
|
|
124
|
+
}
|
|
125
|
+
vals.push(encodeComponent(val, reserved, op));
|
|
126
|
+
return vals.join("");
|
|
127
|
+
}
|
|
128
|
+
else if (modifier === "*") {
|
|
129
|
+
return getExpandedValue(option);
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
return getNonExpandedValue(option);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
// ---------------------------------------------------------------------------------------------------
|
|
136
|
+
// This is an implementation of RFC 6570 URI Template: https://datatracker.ietf.org/doc/html/rfc6570.
|
|
137
|
+
// ---------------------------------------------------------------------------------------------------
|
|
138
|
+
export function expandUrlTemplate(template, context, option) {
|
|
139
|
+
return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, (_, expr, text) => {
|
|
140
|
+
if (!expr) {
|
|
141
|
+
return encodeReservedComponent(text);
|
|
142
|
+
}
|
|
143
|
+
let op;
|
|
144
|
+
if (["+", "#", ".", "/", ";", "?", "&"].includes(expr[0])) {
|
|
145
|
+
((op = expr[0]), (expr = expr.slice(1)));
|
|
146
|
+
}
|
|
147
|
+
const varList = expr.split(/,/g);
|
|
148
|
+
const result = [];
|
|
149
|
+
for (const varSpec of varList) {
|
|
150
|
+
const varMatch = /([^:\*]*)(?::(\d+)|(\*))?/.exec(varSpec);
|
|
151
|
+
if (!varMatch || !varMatch[1]) {
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
const varValue = getVarValue({
|
|
155
|
+
isFirst: result.length === 0,
|
|
156
|
+
op,
|
|
157
|
+
varValue: context[varMatch[1]],
|
|
158
|
+
varName: varMatch[1],
|
|
159
|
+
modifier: varMatch[2] || varMatch[3],
|
|
160
|
+
reserved: option?.allowReserved,
|
|
161
|
+
});
|
|
162
|
+
if (varValue) {
|
|
163
|
+
result.push(varValue);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return result.join("");
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=urlTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"urlTemplate.js","sourceRoot":"","sources":["../../../src/static-helpers/urlTemplate.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAmBlC,wBAAwB;AACxB,UAAU;AACV,wBAAwB;AACxB,SAAS,eAAe,CAAC,GAAW,EAAE,QAAkB,EAAE,EAAW;IACnE,OAAO,CAAC,QAAQ,IAAI,EAAE,KAAK,GAAG,CAAC,IAAI,EAAE,KAAK,GAAG;QAC3C,CAAC,CAAC,uBAAuB,CAAC,GAAG,CAAC;QAC9B,CAAC,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC;AACrC,CAAC;AAED,SAAS,uBAAuB,CAAC,GAAW;IAC1C,OAAO,GAAG;SACP,KAAK,CAAC,oBAAoB,CAAC;SAC3B,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;SACpE,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC;AAED,SAAS,yBAAyB,CAAC,GAAW;IAC5C,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAC,OAAO,CACpC,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,EAAE,CACxD,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// interfaces\n//---------------------\ninterface ValueOptions {\n isFirst: boolean; // is first value in the expression\n op?: string; // operator\n varValue?: any; // variable value\n varName?: string; // variable name\n modifier?: string; // modifier e.g *\n reserved?: boolean; // if true we'll keep reserved words with not encoding\n}\n\nexport interface UrlTemplateOptions {\n // if set to true, reserved characters will not be encoded\n allowReserved?: boolean;\n}\n\n// ---------------------\n// helpers\n// ---------------------\nfunction encodeComponent(val: string, reserved?: boolean, op?: string) {\n return (reserved ?? op === \"+\") || op === \"#\"\n ? encodeReservedComponent(val)\n : encodeRFC3986URIComponent(val);\n}\n\nfunction encodeReservedComponent(str: string) {\n return str\n .split(/(%[0-9A-Fa-f]{2})/g)\n .map((part) => (!/%[0-9A-Fa-f]/.test(part) ? encodeURI(part) : part))\n .join(\"\");\n}\n\nfunction encodeRFC3986URIComponent(str: string) {\n return encodeURIComponent(str).replace(\n /[!'()*]/g,\n (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`,\n );\n}\n\nfunction isDefined(val: any) {\n return val !== undefined && val !== null;\n}\n\nfunction getNamedAndIfEmpty(op?: string): [boolean, string] {\n return [!!op && [\";\", \"?\", \"&\"].includes(op), !!op && [\"?\", \"&\"].includes(op) ? \"=\" : \"\"];\n}\n\nfunction getFirstOrSep(op?: string, isFirst = false) {\n if (isFirst) {\n return !op || op === \"+\" ? \"\" : op;\n } else if (!op || op === \"+\" || op === \"#\") {\n return \",\";\n } else if (op === \"?\") {\n return \"&\";\n } else {\n return op;\n }\n}\n\nfunction getExpandedValue(option: ValueOptions) {\n let isFirst = option.isFirst;\n const { op, varName, varValue: value, reserved } = option;\n const vals: string[] = [];\n const [named, ifEmpty] = getNamedAndIfEmpty(op);\n\n if (Array.isArray(value)) {\n for (const val of value.filter(isDefined)) {\n // prepare the following parts: separator, varName, value\n vals.push(`${getFirstOrSep(op, isFirst)}`);\n if (named && varName) {\n vals.push(`${encodeURIComponent(varName)}`);\n val === \"\" ? vals.push(ifEmpty) : vals.push(\"=\");\n }\n vals.push(encodeComponent(val, reserved, op));\n isFirst = false;\n }\n } else if (typeof value === \"object\") {\n for (const key of Object.keys(value)) {\n const val = value[key];\n if (!isDefined(val)) {\n continue;\n }\n // prepare the following parts: separator, key, value\n vals.push(`${getFirstOrSep(op, isFirst)}`);\n if (key) {\n vals.push(`${encodeURIComponent(key)}`);\n named && val === \"\" ? vals.push(ifEmpty) : vals.push(\"=\");\n }\n vals.push(encodeComponent(val, reserved, op));\n isFirst = false;\n }\n }\n return vals.join(\"\");\n}\n\nfunction getNonExpandedValue(option: ValueOptions) {\n const { op, varName, varValue: value, isFirst, reserved } = option;\n const vals: string[] = [];\n const first = getFirstOrSep(op, isFirst);\n const [named, ifEmpty] = getNamedAndIfEmpty(op);\n if (named && varName) {\n vals.push(encodeComponent(varName, reserved, op));\n if (value === \"\") {\n if (!ifEmpty) {\n vals.push(ifEmpty);\n }\n return !vals.join(\"\") ? undefined : `${first}${vals.join(\"\")}`;\n }\n vals.push(\"=\");\n }\n\n const items = [];\n if (Array.isArray(value)) {\n for (const val of value.filter(isDefined)) {\n items.push(encodeComponent(val, reserved, op));\n }\n } else if (typeof value === \"object\") {\n for (const key of Object.keys(value)) {\n if (!isDefined(value[key])) {\n continue;\n }\n items.push(encodeRFC3986URIComponent(key));\n items.push(encodeComponent(value[key], reserved, op));\n }\n }\n vals.push(items.join(\",\"));\n return !vals.join(\",\") ? undefined : `${first}${vals.join(\"\")}`;\n}\n\nfunction getVarValue(option: ValueOptions): string | undefined {\n const { op, varName, modifier, isFirst, reserved, varValue: value } = option;\n\n if (!isDefined(value)) {\n return undefined;\n } else if ([\"string\", \"number\", \"boolean\"].includes(typeof value)) {\n let val = value.toString();\n const [named, ifEmpty] = getNamedAndIfEmpty(op);\n const vals: string[] = [getFirstOrSep(op, isFirst)];\n if (named && varName) {\n // No need to encode varName considering it is already encoded\n vals.push(varName);\n val === \"\" ? vals.push(ifEmpty) : vals.push(\"=\");\n }\n if (modifier && modifier !== \"*\") {\n val = val.substring(0, parseInt(modifier, 10));\n }\n vals.push(encodeComponent(val, reserved, op));\n return vals.join(\"\");\n } else if (modifier === \"*\") {\n return getExpandedValue(option);\n } else {\n return getNonExpandedValue(option);\n }\n}\n\n// ---------------------------------------------------------------------------------------------------\n// This is an implementation of RFC 6570 URI Template: https://datatracker.ietf.org/doc/html/rfc6570.\n// ---------------------------------------------------------------------------------------------------\nexport function expandUrlTemplate(\n template: string,\n context: Record<string, any>,\n option?: UrlTemplateOptions,\n): string {\n return template.replace(/\\{([^\\{\\}]+)\\}|([^\\{\\}]+)/g, (_, expr, text) => {\n if (!expr) {\n return encodeReservedComponent(text);\n }\n let op;\n if ([\"+\", \"#\", \".\", \"/\", \";\", \"?\", \"&\"].includes(expr[0])) {\n ((op = expr[0]), (expr = expr.slice(1)));\n }\n const varList = expr.split(/,/g);\n const result = [];\n for (const varSpec of varList) {\n const varMatch = /([^:\\*]*)(?::(\\d+)|(\\*))?/.exec(varSpec);\n if (!varMatch || !varMatch[1]) {\n continue;\n }\n const varValue = getVarValue({\n isFirst: result.length === 0,\n op,\n varValue: context[varMatch[1]],\n varName: varMatch[1],\n modifier: varMatch[2] || varMatch[3],\n reserved: option?.allowReserved,\n });\n if (varValue) {\n result.push(varValue);\n }\n }\n return result.join(\"\");\n });\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Client, ClientOptions } from "@azure-rest/core-client";
|
|
2
|
+
import { TokenCredential } from "@azure/core-auth";
|
|
3
|
+
/** Bicep Client */
|
|
4
|
+
export interface BicepContext extends Client {
|
|
5
|
+
/** The API version to use for this operation. */
|
|
6
|
+
/** Known values of {@link KnownVersions} that the service accepts. */
|
|
7
|
+
apiVersion: string;
|
|
8
|
+
/** The ID of the target subscription. The value must be an UUID. */
|
|
9
|
+
subscriptionId: string;
|
|
10
|
+
}
|
|
11
|
+
/** Optional parameters for the client. */
|
|
12
|
+
export interface BicepClientOptionalParams extends ClientOptions {
|
|
13
|
+
/** The API version to use for this operation. */
|
|
14
|
+
/** Known values of {@link KnownVersions} that the service accepts. */
|
|
15
|
+
apiVersion?: string;
|
|
16
|
+
}
|
|
17
|
+
/** Bicep Client */
|
|
18
|
+
export declare function createBicep(credential: TokenCredential, subscriptionId: string, options?: BicepClientOptionalParams): BicepContext;
|
|
19
|
+
//# sourceMappingURL=bicepContext.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.createBicep = createBicep;
|
|
6
|
+
const logger_js_1 = require("../logger.js");
|
|
7
|
+
const core_client_1 = require("@azure-rest/core-client");
|
|
8
|
+
/** Bicep Client */
|
|
9
|
+
function createBicep(credential, subscriptionId, options = {}) {
|
|
10
|
+
const endpointUrl = options.endpoint ?? options.baseUrl ?? "https://management.azure.com";
|
|
11
|
+
const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;
|
|
12
|
+
const userAgentInfo = `azsdk-js-arm-resourcesbicep/1.0.0-beta.1`;
|
|
13
|
+
const userAgentPrefix = prefixFromOptions
|
|
14
|
+
? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}`
|
|
15
|
+
: `azsdk-js-api ${userAgentInfo}`;
|
|
16
|
+
const { apiVersion: _, ...updatedOptions } = {
|
|
17
|
+
...options,
|
|
18
|
+
userAgentOptions: { userAgentPrefix },
|
|
19
|
+
loggingOptions: { logger: options.loggingOptions?.logger ?? logger_js_1.logger.info },
|
|
20
|
+
credentials: {
|
|
21
|
+
scopes: options.credentials?.scopes ?? [`${endpointUrl}/.default`],
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
const clientContext = (0, core_client_1.getClient)(endpointUrl, credential, updatedOptions);
|
|
25
|
+
clientContext.pipeline.removePolicy({ name: "ApiVersionPolicy" });
|
|
26
|
+
const apiVersion = options.apiVersion ?? "2023-11-01";
|
|
27
|
+
clientContext.pipeline.addPolicy({
|
|
28
|
+
name: "ClientApiVersionPolicy",
|
|
29
|
+
sendRequest: (req, next) => {
|
|
30
|
+
// Use the apiVersion defined in request url directly
|
|
31
|
+
// Append one if there is no apiVersion and we have one at client options
|
|
32
|
+
const url = new URL(req.url);
|
|
33
|
+
if (!url.searchParams.get("api-version")) {
|
|
34
|
+
req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${apiVersion}`;
|
|
35
|
+
}
|
|
36
|
+
return next(req);
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
return { ...clientContext, apiVersion, subscriptionId };
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=bicepContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bicepContext.js","sourceRoot":"","sources":["../../../src/api/bicepContext.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAwBlC,kCAsCC;AA5DD,4CAAsC;AAEtC,yDAA2E;AAmB3E,mBAAmB;AACnB,SAAgB,WAAW,CACzB,UAA2B,EAC3B,cAAsB,EACtB,UAAqC,EAAE;IAEvC,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,OAAO,IAAI,8BAA8B,CAAC;IAC1F,MAAM,iBAAiB,GAAG,OAAO,EAAE,gBAAgB,EAAE,eAAe,CAAC;IACrE,MAAM,aAAa,GAAG,0CAA0C,CAAC;IACjE,MAAM,eAAe,GAAG,iBAAiB;QACvC,CAAC,CAAC,GAAG,iBAAiB,iBAAiB,aAAa,EAAE;QACtD,CAAC,CAAC,gBAAgB,aAAa,EAAE,CAAC;IACpC,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,GAAG;QAC3C,GAAG,OAAO;QACV,gBAAgB,EAAE,EAAE,eAAe,EAAE;QACrC,cAAc,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,cAAc,EAAE,MAAM,IAAI,kBAAM,CAAC,IAAI,EAAE;QACzE,WAAW,EAAE;YACX,MAAM,EAAE,OAAO,CAAC,WAAW,EAAE,MAAM,IAAI,CAAC,GAAG,WAAW,WAAW,CAAC;SACnE;KACF,CAAC;IACF,MAAM,aAAa,GAAG,IAAA,uBAAS,EAAC,WAAW,EAAE,UAAU,EAAE,cAAc,CAAC,CAAC;IACzE,aAAa,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAClE,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,YAAY,CAAC;IACtD,aAAa,CAAC,QAAQ,CAAC,SAAS,CAAC;QAC/B,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACzB,qDAAqD;YACrD,yEAAyE;YACzE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;gBACzC,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IACH,OAAO,EAAE,GAAG,aAAa,EAAE,UAAU,EAAE,cAAc,EAAkB,CAAC;AAC1E,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { logger } from \"../logger.js\";\nimport { KnownVersions } from \"../models/models.js\";\nimport { Client, ClientOptions, getClient } from \"@azure-rest/core-client\";\nimport { TokenCredential } from \"@azure/core-auth\";\n\n/** Bicep Client */\nexport interface BicepContext extends Client {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion: string;\n /** The ID of the target subscription. The value must be an UUID. */\n subscriptionId: string;\n}\n\n/** Optional parameters for the client. */\nexport interface BicepClientOptionalParams extends ClientOptions {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion?: string;\n}\n\n/** Bicep Client */\nexport function createBicep(\n credential: TokenCredential,\n subscriptionId: string,\n options: BicepClientOptionalParams = {},\n): BicepContext {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? \"https://management.azure.com\";\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentInfo = `azsdk-js-arm-resourcesbicep/1.0.0-beta.1`;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}`\n : `azsdk-js-api ${userAgentInfo}`;\n const { apiVersion: _, ...updatedOptions } = {\n ...options,\n userAgentOptions: { userAgentPrefix },\n loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info },\n credentials: {\n scopes: options.credentials?.scopes ?? [`${endpointUrl}/.default`],\n },\n };\n const clientContext = getClient(endpointUrl, credential, updatedOptions);\n clientContext.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n const apiVersion = options.apiVersion ?? \"2023-11-01\";\n clientContext.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\")) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n return { ...clientContext, apiVersion, subscriptionId } as BicepContext;\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.bicep = void 0;
|
|
6
|
+
var operations_js_1 = require("./operations.js");
|
|
7
|
+
Object.defineProperty(exports, "bicep", { enumerable: true, get: function () { return operations_js_1.bicep; } });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/decompileOperationGroup/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,iDAAwC;AAA/B,sGAAA,KAAK,OAAA","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { bicep } from \"./operations.js\";\nexport { DecompileOperationGroupBicepOptionalParams } from \"./options.js\";\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BicepContext as Client } from "../index.js";
|
|
2
|
+
import { DecompileOperationRequest, DecompileOperationSuccessResponse } from "../../models/models.js";
|
|
3
|
+
import { DecompileOperationGroupBicepOptionalParams } from "./options.js";
|
|
4
|
+
import { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client";
|
|
5
|
+
export declare function _bicepSend(context: Client, decompileOperationRequest: DecompileOperationRequest, options?: DecompileOperationGroupBicepOptionalParams): StreamableMethod;
|
|
6
|
+
export declare function _bicepDeserialize(result: PathUncheckedResponse): Promise<DecompileOperationSuccessResponse>;
|
|
7
|
+
/** Decompiles an ARM json template into a Bicep template */
|
|
8
|
+
export declare function bicep(context: Client, decompileOperationRequest: DecompileOperationRequest, options?: DecompileOperationGroupBicepOptionalParams): Promise<DecompileOperationSuccessResponse>;
|
|
9
|
+
//# sourceMappingURL=operations.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports._bicepSend = _bicepSend;
|
|
6
|
+
exports._bicepDeserialize = _bicepDeserialize;
|
|
7
|
+
exports.bicep = bicep;
|
|
8
|
+
const models_js_1 = require("../../models/models.js");
|
|
9
|
+
const urlTemplate_js_1 = require("../../static-helpers/urlTemplate.js");
|
|
10
|
+
const core_client_1 = require("@azure-rest/core-client");
|
|
11
|
+
function _bicepSend(context, decompileOperationRequest, options = { requestOptions: {} }) {
|
|
12
|
+
const path = (0, urlTemplate_js_1.expandUrlTemplate)("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/decompileBicep{?api%2Dversion}", {
|
|
13
|
+
subscriptionId: context.subscriptionId,
|
|
14
|
+
"api%2Dversion": context.apiVersion,
|
|
15
|
+
}, {
|
|
16
|
+
allowReserved: options?.requestOptions?.skipUrlEncoding,
|
|
17
|
+
});
|
|
18
|
+
return context.path(path).post({
|
|
19
|
+
...(0, core_client_1.operationOptionsToRequestParameters)(options),
|
|
20
|
+
contentType: "application/json",
|
|
21
|
+
headers: {
|
|
22
|
+
accept: "application/json",
|
|
23
|
+
...options.requestOptions?.headers,
|
|
24
|
+
},
|
|
25
|
+
body: (0, models_js_1.decompileOperationRequestSerializer)(decompileOperationRequest),
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
async function _bicepDeserialize(result) {
|
|
29
|
+
const expectedStatuses = ["200"];
|
|
30
|
+
if (!expectedStatuses.includes(result.status)) {
|
|
31
|
+
const error = (0, core_client_1.createRestError)(result);
|
|
32
|
+
error.details = (0, models_js_1.errorResponseDeserializer)(result.body);
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
return (0, models_js_1.decompileOperationSuccessResponseDeserializer)(result.body);
|
|
36
|
+
}
|
|
37
|
+
/** Decompiles an ARM json template into a Bicep template */
|
|
38
|
+
async function bicep(context, decompileOperationRequest, options = { requestOptions: {} }) {
|
|
39
|
+
const result = await _bicepSend(context, decompileOperationRequest, options);
|
|
40
|
+
return _bicepDeserialize(result);
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../src/api/decompileOperationGroup/operations.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAmBlC,gCAwBC;AAED,8CAWC;AAGD,sBAOC;AA/DD,sDAMgC;AAEhC,wEAAwE;AACxE,yDAKiC;AAEjC,SAAgB,UAAU,CACxB,OAAe,EACf,yBAAoD,EACpD,UAAsD,EAAE,cAAc,EAAE,EAAE,EAAE;IAE5E,MAAM,IAAI,GAAG,IAAA,kCAAiB,EAC5B,8FAA8F,EAC9F;QACE,cAAc,EAAE,OAAO,CAAC,cAAc;QACtC,eAAe,EAAE,OAAO,CAAC,UAAU;KACpC,EACD;QACE,aAAa,EAAE,OAAO,EAAE,cAAc,EAAE,eAAe;KACxD,CACF,CAAC;IACF,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;QAC7B,GAAG,IAAA,iDAAmC,EAAC,OAAO,CAAC;QAC/C,WAAW,EAAE,kBAAkB;QAC/B,OAAO,EAAE;YACP,MAAM,EAAE,kBAAkB;YAC1B,GAAG,OAAO,CAAC,cAAc,EAAE,OAAO;SACnC;QACD,IAAI,EAAE,IAAA,+CAAmC,EAAC,yBAAyB,CAAC;KACrE,CAAC,CAAC;AACL,CAAC;AAEM,KAAK,UAAU,iBAAiB,CACrC,MAA6B;IAE7B,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;IACjC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9C,MAAM,KAAK,GAAG,IAAA,6BAAe,EAAC,MAAM,CAAC,CAAC;QACtC,KAAK,CAAC,OAAO,GAAG,IAAA,qCAAyB,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACvD,MAAM,KAAK,CAAC;IACd,CAAC;IAED,OAAO,IAAA,yDAA6C,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACpE,CAAC;AAED,4DAA4D;AACrD,KAAK,UAAU,KAAK,CACzB,OAAe,EACf,yBAAoD,EACpD,UAAsD,EAAE,cAAc,EAAE,EAAE,EAAE;IAE5E,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,EAAE,yBAAyB,EAAE,OAAO,CAAC,CAAC;IAC7E,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { BicepContext as Client } from \"../index.js\";\nimport {\n DecompileOperationRequest,\n decompileOperationRequestSerializer,\n DecompileOperationSuccessResponse,\n decompileOperationSuccessResponseDeserializer,\n errorResponseDeserializer,\n} from \"../../models/models.js\";\nimport { DecompileOperationGroupBicepOptionalParams } from \"./options.js\";\nimport { expandUrlTemplate } from \"../../static-helpers/urlTemplate.js\";\nimport {\n StreamableMethod,\n PathUncheckedResponse,\n createRestError,\n operationOptionsToRequestParameters,\n} from \"@azure-rest/core-client\";\n\nexport function _bicepSend(\n context: Client,\n decompileOperationRequest: DecompileOperationRequest,\n options: DecompileOperationGroupBicepOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/subscriptions/{subscriptionId}/providers/Microsoft.Resources/decompileBicep{?api%2Dversion}\",\n {\n subscriptionId: context.subscriptionId,\n \"api%2Dversion\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n contentType: \"application/json\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: decompileOperationRequestSerializer(decompileOperationRequest),\n });\n}\n\nexport async function _bicepDeserialize(\n result: PathUncheckedResponse,\n): Promise<DecompileOperationSuccessResponse> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n const error = createRestError(result);\n error.details = errorResponseDeserializer(result.body);\n throw error;\n }\n\n return decompileOperationSuccessResponseDeserializer(result.body);\n}\n\n/** Decompiles an ARM json template into a Bicep template */\nexport async function bicep(\n context: Client,\n decompileOperationRequest: DecompileOperationRequest,\n options: DecompileOperationGroupBicepOptionalParams = { requestOptions: {} },\n): Promise<DecompileOperationSuccessResponse> {\n const result = await _bicepSend(context, decompileOperationRequest, options);\n return _bicepDeserialize(result);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../../src/api/decompileOperationGroup/options.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { OperationOptions } from \"@azure-rest/core-client\";\n\n/** Optional parameters. */\nexport interface DecompileOperationGroupBicepOptionalParams extends OperationOptions {}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.createBicep = void 0;
|
|
6
|
+
var bicepContext_js_1 = require("./bicepContext.js");
|
|
7
|
+
Object.defineProperty(exports, "createBicep", { enumerable: true, get: function () { return bicepContext_js_1.createBicep; } });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,qDAAyF;AAAhF,8GAAA,WAAW,OAAA","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { createBicep, BicepContext, BicepClientOptionalParams } from \"./bicepContext.js\";\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BicepClientOptionalParams } from "./api/index.js";
|
|
2
|
+
import { DecompileOperationGroupOperations } from "./classic/decompileOperationGroup/index.js";
|
|
3
|
+
import { Pipeline } from "@azure/core-rest-pipeline";
|
|
4
|
+
import { TokenCredential } from "@azure/core-auth";
|
|
5
|
+
export { BicepClientOptionalParams } from "./api/bicepContext.js";
|
|
6
|
+
export declare class BicepClient {
|
|
7
|
+
private _client;
|
|
8
|
+
/** The pipeline used by this client to make requests */
|
|
9
|
+
readonly pipeline: Pipeline;
|
|
10
|
+
/** Bicep Client */
|
|
11
|
+
constructor(credential: TokenCredential, subscriptionId: string, options?: BicepClientOptionalParams);
|
|
12
|
+
/** The operation groups for decompileOperationGroup */
|
|
13
|
+
readonly decompileOperationGroup: DecompileOperationGroupOperations;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=bicepClient.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.BicepClient = void 0;
|
|
6
|
+
const index_js_1 = require("./api/index.js");
|
|
7
|
+
const index_js_2 = require("./classic/decompileOperationGroup/index.js");
|
|
8
|
+
class BicepClient {
|
|
9
|
+
_client;
|
|
10
|
+
/** The pipeline used by this client to make requests */
|
|
11
|
+
pipeline;
|
|
12
|
+
/** Bicep Client */
|
|
13
|
+
constructor(credential, subscriptionId, options = {}) {
|
|
14
|
+
const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;
|
|
15
|
+
const userAgentPrefix = prefixFromOptions
|
|
16
|
+
? `${prefixFromOptions} azsdk-js-client`
|
|
17
|
+
: `azsdk-js-client`;
|
|
18
|
+
this._client = (0, index_js_1.createBicep)(credential, subscriptionId, {
|
|
19
|
+
...options,
|
|
20
|
+
userAgentOptions: { userAgentPrefix },
|
|
21
|
+
});
|
|
22
|
+
this.pipeline = this._client.pipeline;
|
|
23
|
+
this.decompileOperationGroup = (0, index_js_2._getDecompileOperationGroupOperations)(this._client);
|
|
24
|
+
}
|
|
25
|
+
/** The operation groups for decompileOperationGroup */
|
|
26
|
+
decompileOperationGroup;
|
|
27
|
+
}
|
|
28
|
+
exports.BicepClient = BicepClient;
|
|
29
|
+
//# sourceMappingURL=bicepClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bicepClient.js","sourceRoot":"","sources":["../../src/bicepClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,6CAAsF;AACtF,yEAGoD;AAMpD,MAAa,WAAW;IACd,OAAO,CAAe;IAC9B,wDAAwD;IACxC,QAAQ,CAAW;IAEnC,mBAAmB;IACnB,YACE,UAA2B,EAC3B,cAAsB,EACtB,UAAqC,EAAE;QAEvC,MAAM,iBAAiB,GAAG,OAAO,EAAE,gBAAgB,EAAE,eAAe,CAAC;QACrE,MAAM,eAAe,GAAG,iBAAiB;YACvC,CAAC,CAAC,GAAG,iBAAiB,kBAAkB;YACxC,CAAC,CAAC,iBAAiB,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAA,sBAAW,EAAC,UAAU,EAAE,cAAc,EAAE;YACrD,GAAG,OAAO;YACV,gBAAgB,EAAE,EAAE,eAAe,EAAE;SACtC,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;QACtC,IAAI,CAAC,uBAAuB,GAAG,IAAA,gDAAqC,EAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrF,CAAC;IAED,uDAAuD;IACvC,uBAAuB,CAAoC;CAC5E;AAzBD,kCAyBC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createBicep, BicepContext, BicepClientOptionalParams } from \"./api/index.js\";\nimport {\n DecompileOperationGroupOperations,\n _getDecompileOperationGroupOperations,\n} from \"./classic/decompileOperationGroup/index.js\";\nimport { Pipeline } from \"@azure/core-rest-pipeline\";\nimport { TokenCredential } from \"@azure/core-auth\";\n\nexport { BicepClientOptionalParams } from \"./api/bicepContext.js\";\n\nexport class BicepClient {\n private _client: BicepContext;\n /** The pipeline used by this client to make requests */\n public readonly pipeline: Pipeline;\n\n /** Bicep Client */\n constructor(\n credential: TokenCredential,\n subscriptionId: string,\n options: BicepClientOptionalParams = {},\n ) {\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-client`\n : `azsdk-js-client`;\n this._client = createBicep(credential, subscriptionId, {\n ...options,\n userAgentOptions: { userAgentPrefix },\n });\n this.pipeline = this._client.pipeline;\n this.decompileOperationGroup = _getDecompileOperationGroupOperations(this._client);\n }\n\n /** The operation groups for decompileOperationGroup */\n public readonly decompileOperationGroup: DecompileOperationGroupOperations;\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BicepContext } from "../../api/bicepContext.js";
|
|
2
|
+
import { DecompileOperationRequest, DecompileOperationSuccessResponse } from "../../models/models.js";
|
|
3
|
+
import { DecompileOperationGroupBicepOptionalParams } from "../../api/decompileOperationGroup/options.js";
|
|
4
|
+
/** Interface representing a DecompileOperationGroup operations. */
|
|
5
|
+
export interface DecompileOperationGroupOperations {
|
|
6
|
+
/** Decompiles an ARM json template into a Bicep template */
|
|
7
|
+
bicep: (decompileOperationRequest: DecompileOperationRequest, options?: DecompileOperationGroupBicepOptionalParams) => Promise<DecompileOperationSuccessResponse>;
|
|
8
|
+
}
|
|
9
|
+
export declare function _getDecompileOperationGroupOperations(context: BicepContext): DecompileOperationGroupOperations;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports._getDecompileOperationGroupOperations = _getDecompileOperationGroupOperations;
|
|
6
|
+
const operations_js_1 = require("../../api/decompileOperationGroup/operations.js");
|
|
7
|
+
function _getDecompileOperationGroup(context) {
|
|
8
|
+
return {
|
|
9
|
+
bicep: (decompileOperationRequest, options) => (0, operations_js_1.bicep)(context, decompileOperationRequest, options),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function _getDecompileOperationGroupOperations(context) {
|
|
13
|
+
return {
|
|
14
|
+
..._getDecompileOperationGroup(context),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/classic/decompileOperationGroup/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA4BlC,sFAMC;AA1BD,mFAAwE;AAWxE,SAAS,2BAA2B,CAAC,OAAqB;IACxD,OAAO;QACL,KAAK,EAAE,CACL,yBAAoD,EACpD,OAAoD,EACpD,EAAE,CAAC,IAAA,qBAAK,EAAC,OAAO,EAAE,yBAAyB,EAAE,OAAO,CAAC;KACxD,CAAC;AACJ,CAAC;AAED,SAAgB,qCAAqC,CACnD,OAAqB;IAErB,OAAO;QACL,GAAG,2BAA2B,CAAC,OAAO,CAAC;KACxC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { BicepContext } from \"../../api/bicepContext.js\";\nimport {\n DecompileOperationRequest,\n DecompileOperationSuccessResponse,\n} from \"../../models/models.js\";\nimport { DecompileOperationGroupBicepOptionalParams } from \"../../api/decompileOperationGroup/options.js\";\nimport { bicep } from \"../../api/decompileOperationGroup/operations.js\";\n\n/** Interface representing a DecompileOperationGroup operations. */\nexport interface DecompileOperationGroupOperations {\n /** Decompiles an ARM json template into a Bicep template */\n bicep: (\n decompileOperationRequest: DecompileOperationRequest,\n options?: DecompileOperationGroupBicepOptionalParams,\n ) => Promise<DecompileOperationSuccessResponse>;\n}\n\nfunction _getDecompileOperationGroup(context: BicepContext) {\n return {\n bicep: (\n decompileOperationRequest: DecompileOperationRequest,\n options?: DecompileOperationGroupBicepOptionalParams,\n ) => bicep(context, decompileOperationRequest, options),\n };\n}\n\nexport function _getDecompileOperationGroupOperations(\n context: BicepContext,\n): DecompileOperationGroupOperations {\n return {\n ..._getDecompileOperationGroup(context),\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/classic/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { DecompileOperationGroupOperations } from \"./decompileOperationGroup/index.js\";\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { BicepClient } from "./bicepClient.js";
|
|
2
|
+
export { DecompileOperationRequest, DecompileOperationSuccessResponse, FileDefinition, ErrorResponse, ErrorDetail, ErrorAdditionalInfo, KnownVersions, } from "./models/index.js";
|
|
3
|
+
export { BicepClientOptionalParams } from "./api/index.js";
|
|
4
|
+
export { DecompileOperationGroupBicepOptionalParams } from "./api/decompileOperationGroup/index.js";
|
|
5
|
+
export { DecompileOperationGroupOperations } from "./classic/index.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.KnownVersions = exports.BicepClient = void 0;
|
|
6
|
+
var bicepClient_js_1 = require("./bicepClient.js");
|
|
7
|
+
Object.defineProperty(exports, "BicepClient", { enumerable: true, get: function () { return bicepClient_js_1.BicepClient; } });
|
|
8
|
+
var index_js_1 = require("./models/index.js");
|
|
9
|
+
Object.defineProperty(exports, "KnownVersions", { enumerable: true, get: function () { return index_js_1.KnownVersions; } });
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,mDAA+C;AAAtC,6GAAA,WAAW,OAAA;AACpB,8CAQ2B;AADzB,yGAAA,aAAa,OAAA","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { BicepClient } from \"./bicepClient.js\";\nexport {\n DecompileOperationRequest,\n DecompileOperationSuccessResponse,\n FileDefinition,\n ErrorResponse,\n ErrorDetail,\n ErrorAdditionalInfo,\n KnownVersions,\n} from \"./models/index.js\";\nexport { BicepClientOptionalParams } from \"./api/index.js\";\nexport { DecompileOperationGroupBicepOptionalParams } from \"./api/decompileOperationGroup/index.js\";\nexport { DecompileOperationGroupOperations } from \"./classic/index.js\";\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.logger = void 0;
|
|
6
|
+
const logger_1 = require("@azure/logger");
|
|
7
|
+
exports.logger = (0, logger_1.createClientLogger)("arm-resourcesbicep");
|
|
8
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,0CAAmD;AACtC,QAAA,MAAM,GAAG,IAAA,2BAAkB,EAAC,oBAAoB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createClientLogger } from \"@azure/logger\";\nexport const logger = createClientLogger(\"arm-resourcesbicep\");\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.KnownVersions = void 0;
|
|
6
|
+
var models_js_1 = require("./models.js");
|
|
7
|
+
Object.defineProperty(exports, "KnownVersions", { enumerable: true, get: function () { return models_js_1.KnownVersions; } });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,yCAQqB;AADnB,0GAAA,aAAa,OAAA","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport {\n DecompileOperationRequest,\n DecompileOperationSuccessResponse,\n FileDefinition,\n ErrorResponse,\n ErrorDetail,\n ErrorAdditionalInfo,\n KnownVersions,\n} from \"./models.js\";\n"]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** The body of the request for the decompileBicep operation */
|
|
2
|
+
export interface DecompileOperationRequest {
|
|
3
|
+
/** The ARM json template to be decompiled into a Bicep file */
|
|
4
|
+
template: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function decompileOperationRequestSerializer(item: DecompileOperationRequest): any;
|
|
7
|
+
/** The response of the decompileBicep operation */
|
|
8
|
+
export interface DecompileOperationSuccessResponse {
|
|
9
|
+
/** An array of key-value pairs containing the entryPoint string as the key for the Bicep file decompiled from the ARM json template */
|
|
10
|
+
files: FileDefinition[];
|
|
11
|
+
/** The file path to the main Bicep file generated from the decompiled ARM json template. */
|
|
12
|
+
entryPoint: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function decompileOperationSuccessResponseDeserializer(item: any): DecompileOperationSuccessResponse;
|
|
15
|
+
export declare function fileDefinitionArrayDeserializer(result: Array<FileDefinition>): any[];
|
|
16
|
+
/** The definition of a file along with its contents */
|
|
17
|
+
export interface FileDefinition {
|
|
18
|
+
/** The file path of the Bicep file. */
|
|
19
|
+
path?: string;
|
|
20
|
+
/** The contents of the Bicep file. */
|
|
21
|
+
contents?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function fileDefinitionDeserializer(item: any): FileDefinition;
|
|
24
|
+
/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. */
|
|
25
|
+
export interface ErrorResponse {
|
|
26
|
+
/** The error object. */
|
|
27
|
+
error?: ErrorDetail;
|
|
28
|
+
}
|
|
29
|
+
export declare function errorResponseDeserializer(item: any): ErrorResponse;
|
|
30
|
+
/** The error detail. */
|
|
31
|
+
export interface ErrorDetail {
|
|
32
|
+
/** The error code. */
|
|
33
|
+
readonly code?: string;
|
|
34
|
+
/** The error message. */
|
|
35
|
+
readonly message?: string;
|
|
36
|
+
/** The error target. */
|
|
37
|
+
readonly target?: string;
|
|
38
|
+
/** The error details. */
|
|
39
|
+
readonly details?: ErrorDetail[];
|
|
40
|
+
/** The error additional info. */
|
|
41
|
+
readonly additionalInfo?: ErrorAdditionalInfo[];
|
|
42
|
+
}
|
|
43
|
+
export declare function errorDetailDeserializer(item: any): ErrorDetail;
|
|
44
|
+
export declare function errorDetailArrayDeserializer(result: Array<ErrorDetail>): any[];
|
|
45
|
+
export declare function errorAdditionalInfoArrayDeserializer(result: Array<ErrorAdditionalInfo>): any[];
|
|
46
|
+
/** The resource management error additional info. */
|
|
47
|
+
export interface ErrorAdditionalInfo {
|
|
48
|
+
/** The additional info type. */
|
|
49
|
+
readonly type?: string;
|
|
50
|
+
/** The additional info. */
|
|
51
|
+
readonly info?: any;
|
|
52
|
+
}
|
|
53
|
+
export declare function errorAdditionalInfoDeserializer(item: any): ErrorAdditionalInfo;
|
|
54
|
+
/** The available API versions. */
|
|
55
|
+
export declare enum KnownVersions {
|
|
56
|
+
/** The 2023-11-01 API version. */
|
|
57
|
+
V20231101 = "2023-11-01"
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=models.d.ts.map
|