@azure/provisioning-core 0.1.0-alpha.20261014.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.
Files changed (152) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +62 -0
  3. package/dist/constructs/built-in-resources/resource-group.d.ts +50 -0
  4. package/dist/constructs/built-in-resources/resource-group.d.ts.map +1 -0
  5. package/dist/constructs/built-in-resources/resource-group.js +97 -0
  6. package/dist/constructs/built-in-resources/resource-group.js.map +1 -0
  7. package/dist/constructs/output.d.ts +80 -0
  8. package/dist/constructs/output.d.ts.map +1 -0
  9. package/dist/constructs/output.js +76 -0
  10. package/dist/constructs/output.js.map +1 -0
  11. package/dist/constructs/parameter.d.ts +77 -0
  12. package/dist/constructs/parameter.d.ts.map +1 -0
  13. package/dist/constructs/parameter.js +93 -0
  14. package/dist/constructs/parameter.js.map +1 -0
  15. package/dist/constructs/provisioning-component.d.ts +91 -0
  16. package/dist/constructs/provisioning-component.d.ts.map +1 -0
  17. package/dist/constructs/provisioning-component.js +150 -0
  18. package/dist/constructs/provisioning-component.js.map +1 -0
  19. package/dist/constructs/resource/resource-proxy.d.ts +134 -0
  20. package/dist/constructs/resource/resource-proxy.d.ts.map +1 -0
  21. package/dist/constructs/resource/resource-proxy.js +523 -0
  22. package/dist/constructs/resource/resource-proxy.js.map +1 -0
  23. package/dist/constructs/resource/resource-query.d.ts +23 -0
  24. package/dist/constructs/resource/resource-query.d.ts.map +1 -0
  25. package/dist/constructs/resource/resource-query.js +71 -0
  26. package/dist/constructs/resource/resource-query.js.map +1 -0
  27. package/dist/constructs/resource/resource-registry.d.ts +99 -0
  28. package/dist/constructs/resource/resource-registry.d.ts.map +1 -0
  29. package/dist/constructs/resource/resource-registry.js +51 -0
  30. package/dist/constructs/resource/resource-registry.js.map +1 -0
  31. package/dist/constructs/resource/resource-type-registry.d.ts +46 -0
  32. package/dist/constructs/resource/resource-type-registry.d.ts.map +1 -0
  33. package/dist/constructs/resource/resource-type-registry.js +156 -0
  34. package/dist/constructs/resource/resource-type-registry.js.map +1 -0
  35. package/dist/constructs/resource/resource-utils.d.ts +60 -0
  36. package/dist/constructs/resource/resource-utils.d.ts.map +1 -0
  37. package/dist/constructs/resource/resource-utils.js +77 -0
  38. package/dist/constructs/resource/resource-utils.js.map +1 -0
  39. package/dist/constructs/resource/resource.d.ts +460 -0
  40. package/dist/constructs/resource/resource.d.ts.map +1 -0
  41. package/dist/constructs/resource/resource.js +584 -0
  42. package/dist/constructs/resource/resource.js.map +1 -0
  43. package/dist/constructs/stack.d.ts +110 -0
  44. package/dist/constructs/stack.d.ts.map +1 -0
  45. package/dist/constructs/stack.js +110 -0
  46. package/dist/constructs/stack.js.map +1 -0
  47. package/dist/constructs/variable.d.ts +63 -0
  48. package/dist/constructs/variable.d.ts.map +1 -0
  49. package/dist/constructs/variable.js +74 -0
  50. package/dist/constructs/variable.js.map +1 -0
  51. package/dist/deployment-context/deployment-context.d.ts +27 -0
  52. package/dist/deployment-context/deployment-context.d.ts.map +1 -0
  53. package/dist/deployment-context/deployment-context.js +4 -0
  54. package/dist/deployment-context/deployment-context.js.map +1 -0
  55. package/dist/expression/ast-nodes.d.ts +100 -0
  56. package/dist/expression/ast-nodes.d.ts.map +1 -0
  57. package/dist/expression/ast-nodes.js +127 -0
  58. package/dist/expression/ast-nodes.js.map +1 -0
  59. package/dist/expression/expressions.d.ts +164 -0
  60. package/dist/expression/expressions.d.ts.map +1 -0
  61. package/dist/expression/expressions.js +211 -0
  62. package/dist/expression/expressions.js.map +1 -0
  63. package/dist/fn.d.ts +194 -0
  64. package/dist/fn.d.ts.map +1 -0
  65. package/dist/fn.js +353 -0
  66. package/dist/fn.js.map +1 -0
  67. package/dist/index.d.ts +25 -0
  68. package/dist/index.d.ts.map +1 -0
  69. package/dist/index.js +19 -0
  70. package/dist/index.js.map +1 -0
  71. package/dist/internal-loop.d.ts +14 -0
  72. package/dist/internal-loop.d.ts.map +1 -0
  73. package/dist/internal-loop.js +16 -0
  74. package/dist/internal-loop.js.map +1 -0
  75. package/dist/internal.d.ts +13 -0
  76. package/dist/internal.d.ts.map +1 -0
  77. package/dist/internal.js +10 -0
  78. package/dist/internal.js.map +1 -0
  79. package/dist/naming/naming-policy.d.ts +56 -0
  80. package/dist/naming/naming-policy.d.ts.map +1 -0
  81. package/dist/naming/naming-policy.js +99 -0
  82. package/dist/naming/naming-policy.js.map +1 -0
  83. package/dist/naming/naming-rules.d.ts +15 -0
  84. package/dist/naming/naming-rules.d.ts.map +1 -0
  85. package/dist/naming/naming-rules.js +15 -0
  86. package/dist/naming/naming-rules.js.map +1 -0
  87. package/dist/serialization/contract/generated/ast.d.ts +508 -0
  88. package/dist/serialization/contract/generated/ast.d.ts.map +1 -0
  89. package/dist/serialization/contract/generated/ast.js +23 -0
  90. package/dist/serialization/contract/generated/ast.js.map +1 -0
  91. package/dist/serialization/contract/index.d.ts +2 -0
  92. package/dist/serialization/contract/index.d.ts.map +1 -0
  93. package/dist/serialization/contract/index.js +4 -0
  94. package/dist/serialization/contract/index.js.map +1 -0
  95. package/dist/serialization/index.d.ts +4 -0
  96. package/dist/serialization/index.d.ts.map +1 -0
  97. package/dist/serialization/index.js +5 -0
  98. package/dist/serialization/index.js.map +1 -0
  99. package/dist/serialization/json/deserialize.d.ts +24 -0
  100. package/dist/serialization/json/deserialize.d.ts.map +1 -0
  101. package/dist/serialization/json/deserialize.js +476 -0
  102. package/dist/serialization/json/deserialize.js.map +1 -0
  103. package/dist/serialization/json/encoding.d.ts +4 -0
  104. package/dist/serialization/json/encoding.d.ts.map +1 -0
  105. package/dist/serialization/json/encoding.js +323 -0
  106. package/dist/serialization/json/encoding.js.map +1 -0
  107. package/dist/serialization/json/expression.d.ts +32 -0
  108. package/dist/serialization/json/expression.d.ts.map +1 -0
  109. package/dist/serialization/json/expression.js +490 -0
  110. package/dist/serialization/json/expression.js.map +1 -0
  111. package/dist/serialization/json/lower.d.ts +41 -0
  112. package/dist/serialization/json/lower.d.ts.map +1 -0
  113. package/dist/serialization/json/lower.js +343 -0
  114. package/dist/serialization/json/lower.js.map +1 -0
  115. package/dist/serialization/json/pluralize-config.d.ts +3 -0
  116. package/dist/serialization/json/pluralize-config.d.ts.map +1 -0
  117. package/dist/serialization/json/pluralize-config.js +7 -0
  118. package/dist/serialization/json/pluralize-config.js.map +1 -0
  119. package/dist/serialization/json/serialize.d.ts +12 -0
  120. package/dist/serialization/json/serialize.d.ts.map +1 -0
  121. package/dist/serialization/json/serialize.js +399 -0
  122. package/dist/serialization/json/serialize.js.map +1 -0
  123. package/dist/serialization/json/util.d.ts +2 -0
  124. package/dist/serialization/json/util.d.ts.map +1 -0
  125. package/dist/serialization/json/util.js +19 -0
  126. package/dist/serialization/json/util.js.map +1 -0
  127. package/dist/serialization/utils.d.ts +3 -0
  128. package/dist/serialization/utils.d.ts.map +1 -0
  129. package/dist/serialization/utils.js +146 -0
  130. package/dist/serialization/utils.js.map +1 -0
  131. package/dist/shape/shape-registry.d.ts +51 -0
  132. package/dist/shape/shape-registry.d.ts.map +1 -0
  133. package/dist/shape/shape-registry.js +41 -0
  134. package/dist/shape/shape-registry.js.map +1 -0
  135. package/dist/shape/shape.d.ts +407 -0
  136. package/dist/shape/shape.d.ts.map +1 -0
  137. package/dist/shape/shape.js +425 -0
  138. package/dist/shape/shape.js.map +1 -0
  139. package/dist/shape/value-encoding.d.ts +121 -0
  140. package/dist/shape/value-encoding.d.ts.map +1 -0
  141. package/dist/shape/value-encoding.js +32 -0
  142. package/dist/shape/value-encoding.js.map +1 -0
  143. package/dist/tsconfig.tsbuildinfo +1 -0
  144. package/dist/types.d.ts +9 -0
  145. package/dist/types.d.ts.map +1 -0
  146. package/dist/types.js +4 -0
  147. package/dist/types.js.map +1 -0
  148. package/dist/util.d.ts +33 -0
  149. package/dist/util.d.ts.map +1 -0
  150. package/dist/util.js +78 -0
  151. package/dist/util.js.map +1 -0
  152. package/package.json +49 -0
package/dist/fn.d.ts ADDED
@@ -0,0 +1,194 @@
1
+ import { type Expression, type ExpressionOrValue } from "./expression/expressions.js";
2
+ /** Adds two numbers as a deploy-time expression. */
3
+ export declare function add(left: ExpressionOrValue<number>, right: ExpressionOrValue<number>): Expression<number>;
4
+ /** Subtracts the right operand from the left at deployment time. */
5
+ export declare function sub(left: ExpressionOrValue<number>, right: ExpressionOrValue<number>): Expression<number>;
6
+ /** Multiplies two numbers at deployment time. */
7
+ export declare function mul(left: ExpressionOrValue<number>, right: ExpressionOrValue<number>): Expression<number>;
8
+ /** Divides the left operand by the right at deployment time. */
9
+ export declare function div(left: ExpressionOrValue<number>, right: ExpressionOrValue<number>): Expression<number>;
10
+ /** Returns the remainder of dividing the left operand by the right. */
11
+ export declare function mod(left: ExpressionOrValue<number>, right: ExpressionOrValue<number>): Expression<number>;
12
+ /** Negates a number at deployment time. */
13
+ export declare function neg(value: ExpressionOrValue<number>): Expression<number>;
14
+ /** Tests whether two values are equal at deployment time. */
15
+ export declare function eq(left: ExpressionOrValue<unknown>, right: ExpressionOrValue<unknown>): Expression<boolean>;
16
+ /** Tests whether two values differ at deployment time. */
17
+ export declare function neq(left: ExpressionOrValue<unknown>, right: ExpressionOrValue<unknown>): Expression<boolean>;
18
+ /** Tests whether the left value is greater than the right value. */
19
+ export declare function gt(left: ExpressionOrValue<unknown>, right: ExpressionOrValue<unknown>): Expression<boolean>;
20
+ /** Tests whether the left value is less than the right value. */
21
+ export declare function lt(left: ExpressionOrValue<unknown>, right: ExpressionOrValue<unknown>): Expression<boolean>;
22
+ /** Tests whether the left value is greater than or equal to the right value. */
23
+ export declare function gte(left: ExpressionOrValue<unknown>, right: ExpressionOrValue<unknown>): Expression<boolean>;
24
+ /** Tests whether the left value is less than or equal to the right value. */
25
+ export declare function lte(left: ExpressionOrValue<unknown>, right: ExpressionOrValue<unknown>): Expression<boolean>;
26
+ /**
27
+ * Logical AND. Accepts 1 … N operands and folds left:
28
+ * `and(a, b, c)` → `(a && b) && c`
29
+ *
30
+ * A single operand is returned as an `Expression<boolean>` (identity).
31
+ */
32
+ export declare function and(...conditions: ExpressionOrValue<boolean>[]): Expression<boolean>;
33
+ /**
34
+ * Logical OR. Accepts 1 … N operands and folds left:
35
+ * `or(a, b, c)` → `(a || b) || c`
36
+ */
37
+ export declare function or(...conditions: ExpressionOrValue<boolean>[]): Expression<boolean>;
38
+ /** Negates a Boolean value at deployment time. */
39
+ export declare function not(value: ExpressionOrValue<boolean>): Expression<boolean>;
40
+ /** Selects one of two values based on a deploy-time condition. */
41
+ export declare function cond<T>(condition: ExpressionOrValue<boolean>, trueValue: ExpressionOrValue<T>, falseValue: ExpressionOrValue<T>): Expression<T>;
42
+ /** Returns the left value unless it is null, otherwise the right value. */
43
+ export declare function coalesce<T>(left: ExpressionOrValue<T>, right: ExpressionOrValue<T>): Expression<T>;
44
+ /** Concatenates strings and expressions in a tagged template. */
45
+ export declare function concat(strings: TemplateStringsArray, ...values: ExpressionOrValue<string>[]): Expression<string>;
46
+ /** Concatenates string values and expressions at deployment time. */
47
+ export declare function concat(...values: ExpressionOrValue<string>[]): Expression<string>;
48
+ /** Returns the first `count` characters of a string. */
49
+ export declare function take(value: ExpressionOrValue<string>, count: ExpressionOrValue<number>): Expression<string>;
50
+ /** Converts a string to lowercase at deployment time. */
51
+ export declare function toLower(value: ExpressionOrValue<string>): Expression<string>;
52
+ /** Converts a string to uppercase at deployment time. */
53
+ export declare function toUpper(value: ExpressionOrValue<string>): Expression<string>;
54
+ /** Returns part of a string, optionally starting at `start` for `count` characters. */
55
+ export declare function substring(value: ExpressionOrValue<string>, start?: ExpressionOrValue<number>, count?: ExpressionOrValue<number>): Expression<string>;
56
+ /** Replaces occurrences of `oldValue` with `newValue` in a string. */
57
+ export declare function replace(value: ExpressionOrValue<string>, oldValue: ExpressionOrValue<string>, newValue: ExpressionOrValue<string>): Expression<string>;
58
+ /** Splits a string into an array at each occurrence of `delimiter`. */
59
+ export declare function split(value: ExpressionOrValue<string>, delimiter: ExpressionOrValue<string>): Expression<string[]>;
60
+ /** Joins array elements into a string separated by `delimiter`. */
61
+ export declare function join(values: ExpressionOrValue<unknown[]>, delimiter: ExpressionOrValue<string>): Expression<string>;
62
+ /** Removes leading and trailing whitespace from a string. */
63
+ export declare function trim(value: ExpressionOrValue<string>): Expression<string>;
64
+ /** Tests whether a string begins with `prefix`. */
65
+ export declare function startsWith(value: ExpressionOrValue<string>, prefix: ExpressionOrValue<string>): Expression<boolean>;
66
+ /** Tests whether a string ends with `suffix`. */
67
+ export declare function endsWith(value: ExpressionOrValue<string>, suffix: ExpressionOrValue<string>): Expression<boolean>;
68
+ /** Encodes a string as Base64 at deployment time. */
69
+ export declare function base64(value: ExpressionOrValue<string>): Expression<string>;
70
+ /** Decodes Base64-encoded JSON into a value at deployment time. */
71
+ export declare function base64ToJson(value: ExpressionOrValue<string>): Expression<unknown>;
72
+ /** Formats a string using indexed placeholders and the supplied values. */
73
+ export declare function format(formatString: ExpressionOrValue<string>, ...values: ExpressionOrValue<unknown>[]): Expression<string>;
74
+ /** Returns the last index of `searchString` within a string. */
75
+ export declare function lastIndexOf(value: ExpressionOrValue<string>, searchString: ExpressionOrValue<string>): Expression<number>;
76
+ /** Creates a deterministic string from the supplied values. */
77
+ export declare function uniqueString(...values: ExpressionOrValue<string>[]): Expression<string>;
78
+ /** Creates a deterministic GUID from the supplied values. */
79
+ export declare function guid(...values: ExpressionOrValue<string>[]): Expression<string>;
80
+ /** Constructs a resource ID at the current deployment scope. */
81
+ export declare function resourceId(type: ExpressionOrValue<string>, ...names: ExpressionOrValue<string>[]): Expression<string>;
82
+ /** Constructs an ID for a subscription-scoped resource. */
83
+ export declare function subscriptionResourceId(type: ExpressionOrValue<string>, ...names: ExpressionOrValue<string>[]): Expression<string>;
84
+ /** Constructs an extension resource ID relative to `baseId`. */
85
+ export declare function extensionResourceId(baseId: ExpressionOrValue<string>, type: ExpressionOrValue<string>, ...names: ExpressionOrValue<string>[]): Expression<string>;
86
+ /** Converts a value to an integer at deployment time. */
87
+ export declare function int(value: ExpressionOrValue<unknown>): Expression<number>;
88
+ /** Returns the smallest of the supplied numbers. */
89
+ export declare function min(...values: ExpressionOrValue<number>[]): Expression<number>;
90
+ /** Returns the largest of the supplied numbers. */
91
+ export declare function max(...values: ExpressionOrValue<number>[]): Expression<number>;
92
+ /** Returns the length of a string, array, or object at deployment time. */
93
+ export declare function length(value: ExpressionOrValue<unknown>): Expression<number>;
94
+ /** Tests whether a string, array, or object is empty. */
95
+ export declare function empty(value: ExpressionOrValue<unknown>): Expression<boolean>;
96
+ /** Returns the first element of an array. */
97
+ export declare function first<T>(arr: ExpressionOrValue<T[]>): Expression<T>;
98
+ /** Returns the last element of an array. */
99
+ export declare function last<T>(arr: ExpressionOrValue<T[]>): Expression<T>;
100
+ /** Tests whether a string, array, or object contains a value or key. */
101
+ export declare function contains(container: ExpressionOrValue<unknown>, value: ExpressionOrValue<unknown>): Expression<boolean>;
102
+ /** Returns the first index of `value` in an array, or -1 if absent. */
103
+ export declare function indexOf<T>(arr: ExpressionOrValue<T[]>, value: ExpressionOrValue<T>): Expression<number>;
104
+ /** Flattens one level of nested arrays. */
105
+ export declare function flatten<T>(arr: ExpressionOrValue<T[][]>): Expression<T[]>;
106
+ /** Returns the intersection of two arrays or objects. */
107
+ export declare function intersect<T, U>(a: ExpressionOrValue<T>, b: ExpressionOrValue<U>): Expression<T & U>;
108
+ /** Returns the union of two arrays, with elements from either input. */
109
+ export declare function union<TElement, UElement>(a: ExpressionOrValue<readonly TElement[]>, b: ExpressionOrValue<readonly UElement[]>): Expression<(TElement | UElement)[]>;
110
+ /** Returns the union of two objects, with properties from both inputs. */
111
+ export declare function union<T extends object, U extends object>(a: T extends readonly unknown[] ? never : ExpressionOrValue<T>, b: U extends readonly unknown[] ? never : ExpressionOrValue<U>): Expression<T & U>;
112
+ /** Skips the first `count` elements of an array. */
113
+ export declare function skip<T>(arr: ExpressionOrValue<T[]>, count: ExpressionOrValue<number>): Expression<T[]>;
114
+ /** Returns an array's elements in reverse order. */
115
+ export declare function reverse<T>(arr: ExpressionOrValue<T[]>): Expression<T[]>;
116
+ /** Parses JSON text into a deploy-time value. */
117
+ export declare function json(value: ExpressionOrValue<string>): Expression<unknown>;
118
+ /** Returns the property names of an object. */
119
+ export declare function objectKeys(obj: ExpressionOrValue<object>): Expression<string[]>;
120
+ /** Returns an object's key/value pairs as an array. */
121
+ export declare function items(obj: ExpressionOrValue<object>): Expression<unknown[]>;
122
+ /**
123
+ * Typed shape of Bicep's `subscription()` runtime function. Only the
124
+ * properties currently surfaced are listed; extend as needed.
125
+ */
126
+ export interface SubscriptionScope {
127
+ readonly subscriptionId: string;
128
+ readonly tenantId: string;
129
+ }
130
+ /**
131
+ * Typed shape of Bicep's `resourceGroup()` runtime function. Only the
132
+ * properties currently surfaced are listed; extend as needed.
133
+ */
134
+ export interface ResourceGroupScope {
135
+ readonly name: string;
136
+ readonly location: string;
137
+ readonly id: string;
138
+ }
139
+ /**
140
+ * Typed shape of Bicep's `tenant()` runtime function. Only the properties
141
+ * currently surfaced are listed; extend as needed.
142
+ */
143
+ export interface TenantScope {
144
+ readonly tenantId: string;
145
+ readonly id: string;
146
+ }
147
+ /**
148
+ * Typed shape of Bicep's `managementGroup()` runtime function. Only the
149
+ * properties currently surfaced are listed; extend as needed.
150
+ */
151
+ export interface ManagementGroupScope {
152
+ readonly name: string;
153
+ readonly id: string;
154
+ }
155
+ /**
156
+ * Bicep `subscription()` / `subscription(subscriptionId)`.
157
+ *
158
+ * - Zero-arg form returns details about the current subscription.
159
+ * - One-arg form returns a scope object for setting `scope:` on a module
160
+ * or extension resource.
161
+ */
162
+ export declare function subscription(): Expression<SubscriptionScope>;
163
+ export declare function subscription(subscriptionId: ExpressionOrValue<string>): Expression<SubscriptionScope>;
164
+ /**
165
+ * Bicep `resourceGroup()` / `resourceGroup(name)` /
166
+ * `resourceGroup(subscriptionId, name)`.
167
+ *
168
+ * - Zero-arg form returns details about the current resource group.
169
+ * - One- and two-arg forms return a scope object for setting `scope:` on a
170
+ * module or extension resource.
171
+ */
172
+ export declare function resourceGroup(): Expression<ResourceGroupScope>;
173
+ export declare function resourceGroup(name: ExpressionOrValue<string>): Expression<ResourceGroupScope>;
174
+ export declare function resourceGroup(subscriptionId: ExpressionOrValue<string>, name: ExpressionOrValue<string>): Expression<ResourceGroupScope>;
175
+ /**
176
+ * Bicep `tenant()`. Returns details about the current tenant (or a scope
177
+ * object when placed in `scope:`). Takes no arguments.
178
+ */
179
+ export declare function tenant(): Expression<TenantScope>;
180
+ /**
181
+ * Bicep `managementGroup()` / `managementGroup(identifier)`.
182
+ *
183
+ * - Zero-arg form is only valid in management-group-scope deployments and
184
+ * returns details about the current management group.
185
+ * - One-arg form returns a scope object for setting `scope:` on a module
186
+ * or extension resource.
187
+ */
188
+ export declare function managementGroup(): Expression<ManagementGroupScope>;
189
+ export declare function managementGroup(identifier: ExpressionOrValue<string>): Expression<ManagementGroupScope>;
190
+ /** Bicep `deployment()`. Returns information about the current deployment. */
191
+ export declare function deployment(): Expression<unknown>;
192
+ /** Bicep `environment()`. Returns information about the Azure environment. */
193
+ export declare function environment(): Expression<unknown>;
194
+ //# sourceMappingURL=fn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fn.d.ts","sourceRoot":"","sources":["../src/fn.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,iBAAiB,EAMvB,MAAM,6BAA6B,CAAC;AAKrC,oDAAoD;AACpD,wBAAgB,GAAG,CACjB,IAAI,EAAE,iBAAiB,CAAC,MAAM,CAAC,EAC/B,KAAK,EAAE,iBAAiB,CAAC,MAAM,CAAC,GAC/B,UAAU,CAAC,MAAM,CAAC,CAEpB;AAED,oEAAoE;AACpE,wBAAgB,GAAG,CACjB,IAAI,EAAE,iBAAiB,CAAC,MAAM,CAAC,EAC/B,KAAK,EAAE,iBAAiB,CAAC,MAAM,CAAC,GAC/B,UAAU,CAAC,MAAM,CAAC,CAEpB;AAED,iDAAiD;AAC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AU,CAAC,OAAO,CAAC,CAEjD"}
package/dist/fn.js ADDED
@@ -0,0 +1,353 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { createBinaryExpression, createFunctionCallExpression, createTernaryExpression, createUnaryExpression, isExpression, } from "./expression/expressions.js";
4
+ // ---------------------------------------------------------------------------
5
+ // Arithmetic operators
6
+ // ---------------------------------------------------------------------------
7
+ /** Adds two numbers as a deploy-time expression. */
8
+ export function add(left, right) {
9
+ return createBinaryExpression("+", left, right);
10
+ }
11
+ /** Subtracts the right operand from the left at deployment time. */
12
+ export function sub(left, right) {
13
+ return createBinaryExpression("-", left, right);
14
+ }
15
+ /** Multiplies two numbers at deployment time. */
16
+ export function mul(left, right) {
17
+ return createBinaryExpression("*", left, right);
18
+ }
19
+ /** Divides the left operand by the right at deployment time. */
20
+ export function div(left, right) {
21
+ return createBinaryExpression("/", left, right);
22
+ }
23
+ /** Returns the remainder of dividing the left operand by the right. */
24
+ export function mod(left, right) {
25
+ return createBinaryExpression("%", left, right);
26
+ }
27
+ /** Negates a number at deployment time. */
28
+ export function neg(value) {
29
+ return createUnaryExpression("-", value);
30
+ }
31
+ // ---------------------------------------------------------------------------
32
+ // Comparison operators
33
+ // ---------------------------------------------------------------------------
34
+ /** Tests whether two values are equal at deployment time. */
35
+ export function eq(left, right) {
36
+ return createBinaryExpression("==", left, right);
37
+ }
38
+ /** Tests whether two values differ at deployment time. */
39
+ export function neq(left, right) {
40
+ return createBinaryExpression("!=", left, right);
41
+ }
42
+ /** Tests whether the left value is greater than the right value. */
43
+ export function gt(left, right) {
44
+ return createBinaryExpression(">", left, right);
45
+ }
46
+ /** Tests whether the left value is less than the right value. */
47
+ export function lt(left, right) {
48
+ return createBinaryExpression("<", left, right);
49
+ }
50
+ /** Tests whether the left value is greater than or equal to the right value. */
51
+ export function gte(left, right) {
52
+ return createBinaryExpression(">=", left, right);
53
+ }
54
+ /** Tests whether the left value is less than or equal to the right value. */
55
+ export function lte(left, right) {
56
+ return createBinaryExpression("<=", left, right);
57
+ }
58
+ // ---------------------------------------------------------------------------
59
+ // Boolean operators
60
+ // ---------------------------------------------------------------------------
61
+ /**
62
+ * Logical AND. Accepts 1 … N operands and folds left:
63
+ * `and(a, b, c)` → `(a && b) && c`
64
+ *
65
+ * A single operand is returned as an `Expression<boolean>` (identity).
66
+ */
67
+ export function and(...conditions) {
68
+ if (conditions.length === 0) {
69
+ throw new Error("and() requires at least one argument");
70
+ }
71
+ if (conditions.length === 1) {
72
+ const c = conditions[0];
73
+ if (isExpression(c))
74
+ return c;
75
+ return createUnaryExpression("!", createUnaryExpression("!", c));
76
+ }
77
+ let result = conditions[0];
78
+ for (let i = 1; i < conditions.length; i++) {
79
+ result = createBinaryExpression("&&", result, conditions[i]);
80
+ }
81
+ return result;
82
+ }
83
+ /**
84
+ * Logical OR. Accepts 1 … N operands and folds left:
85
+ * `or(a, b, c)` → `(a || b) || c`
86
+ */
87
+ export function or(...conditions) {
88
+ if (conditions.length === 0) {
89
+ throw new Error("or() requires at least one argument");
90
+ }
91
+ if (conditions.length === 1) {
92
+ const c = conditions[0];
93
+ if (isExpression(c))
94
+ return c;
95
+ return createUnaryExpression("!", createUnaryExpression("!", c));
96
+ }
97
+ let result = conditions[0];
98
+ for (let i = 1; i < conditions.length; i++) {
99
+ result = createBinaryExpression("||", result, conditions[i]);
100
+ }
101
+ return result;
102
+ }
103
+ /** Negates a Boolean value at deployment time. */
104
+ export function not(value) {
105
+ return createUnaryExpression("!", value);
106
+ }
107
+ // ---------------------------------------------------------------------------
108
+ // Conditional operators
109
+ // ---------------------------------------------------------------------------
110
+ /** Selects one of two values based on a deploy-time condition. */
111
+ export function cond(condition, trueValue, falseValue) {
112
+ return createTernaryExpression(condition, trueValue, falseValue);
113
+ }
114
+ /** Returns the left value unless it is null, otherwise the right value. */
115
+ export function coalesce(left, right) {
116
+ return createBinaryExpression("??", left, right);
117
+ }
118
+ // ---------------------------------------------------------------------------
119
+ // String functions
120
+ // ---------------------------------------------------------------------------
121
+ // Detects the `[TemplateStringsArray, ...values]` shape produced by a
122
+ // tagged-template call. Used by `concat` to support both `concat("a", "b")`
123
+ // and `` concat`a${x}b` `` forms.
124
+ function isTemplateLiteralArgs(args) {
125
+ return (Array.isArray(args[0]) &&
126
+ "raw" in args[0] &&
127
+ Array.isArray(args[0].raw));
128
+ }
129
+ // Interleaves a tagged-template's static `strings` with its dynamic `values`,
130
+ // dropping empty leading/trailing static segments so the resulting array is
131
+ // suitable as `concat()` arguments.
132
+ function interleaveTemplateLiteralArgs(strings, values) {
133
+ const result = [];
134
+ for (let i = 0; i < strings.length; i++) {
135
+ const s = strings[i];
136
+ if (s !== "") {
137
+ result.push(s);
138
+ }
139
+ if (i < values.length) {
140
+ result.push(values[i]);
141
+ }
142
+ }
143
+ return result;
144
+ }
145
+ export function concat(...args) {
146
+ if (isTemplateLiteralArgs(args)) {
147
+ const [strings, ...values] = args;
148
+ return createFunctionCallExpression("concat", interleaveTemplateLiteralArgs(strings, values));
149
+ }
150
+ return createFunctionCallExpression("concat", args);
151
+ }
152
+ /** Returns the first `count` characters of a string. */
153
+ export function take(value, count) {
154
+ return createFunctionCallExpression("take", [value, count]);
155
+ }
156
+ /** Converts a string to lowercase at deployment time. */
157
+ export function toLower(value) {
158
+ return createFunctionCallExpression("toLower", [value]);
159
+ }
160
+ /** Converts a string to uppercase at deployment time. */
161
+ export function toUpper(value) {
162
+ return createFunctionCallExpression("toUpper", [value]);
163
+ }
164
+ /** Returns part of a string, optionally starting at `start` for `count` characters. */
165
+ export function substring(value, start, count) {
166
+ const args = [value];
167
+ if (start !== undefined)
168
+ args.push(start);
169
+ if (count !== undefined)
170
+ args.push(count);
171
+ return createFunctionCallExpression("substring", args);
172
+ }
173
+ /** Replaces occurrences of `oldValue` with `newValue` in a string. */
174
+ export function replace(value, oldValue, newValue) {
175
+ return createFunctionCallExpression("replace", [
176
+ value,
177
+ oldValue,
178
+ newValue,
179
+ ]);
180
+ }
181
+ /** Splits a string into an array at each occurrence of `delimiter`. */
182
+ export function split(value, delimiter) {
183
+ return createFunctionCallExpression("split", [value, delimiter]);
184
+ }
185
+ /** Joins array elements into a string separated by `delimiter`. */
186
+ export function join(values, delimiter) {
187
+ return createFunctionCallExpression("join", [values, delimiter]);
188
+ }
189
+ /** Removes leading and trailing whitespace from a string. */
190
+ export function trim(value) {
191
+ return createFunctionCallExpression("trim", [value]);
192
+ }
193
+ /** Tests whether a string begins with `prefix`. */
194
+ export function startsWith(value, prefix) {
195
+ return createFunctionCallExpression("startsWith", [value, prefix]);
196
+ }
197
+ /** Tests whether a string ends with `suffix`. */
198
+ export function endsWith(value, suffix) {
199
+ return createFunctionCallExpression("endsWith", [value, suffix]);
200
+ }
201
+ /** Encodes a string as Base64 at deployment time. */
202
+ export function base64(value) {
203
+ return createFunctionCallExpression("base64", [value]);
204
+ }
205
+ /** Decodes Base64-encoded JSON into a value at deployment time. */
206
+ export function base64ToJson(value) {
207
+ return createFunctionCallExpression("base64ToJson", [value]);
208
+ }
209
+ /** Formats a string using indexed placeholders and the supplied values. */
210
+ export function format(formatString, ...values) {
211
+ return createFunctionCallExpression("format", [
212
+ formatString,
213
+ ...values,
214
+ ]);
215
+ }
216
+ /** Returns the last index of `searchString` within a string. */
217
+ export function lastIndexOf(value, searchString) {
218
+ return createFunctionCallExpression("lastIndexOf", [
219
+ value,
220
+ searchString,
221
+ ]);
222
+ }
223
+ // ---------------------------------------------------------------------------
224
+ // Unique / ID functions
225
+ // ---------------------------------------------------------------------------
226
+ /** Creates a deterministic string from the supplied values. */
227
+ export function uniqueString(...values) {
228
+ return createFunctionCallExpression("uniqueString", values);
229
+ }
230
+ /** Creates a deterministic GUID from the supplied values. */
231
+ export function guid(...values) {
232
+ return createFunctionCallExpression("guid", values);
233
+ }
234
+ /** Constructs a resource ID at the current deployment scope. */
235
+ export function resourceId(type, ...names) {
236
+ return createFunctionCallExpression("resourceId", [type, ...names]);
237
+ }
238
+ /** Constructs an ID for a subscription-scoped resource. */
239
+ export function subscriptionResourceId(type, ...names) {
240
+ return createFunctionCallExpression("subscriptionResourceId", [
241
+ type,
242
+ ...names,
243
+ ]);
244
+ }
245
+ /** Constructs an extension resource ID relative to `baseId`. */
246
+ export function extensionResourceId(baseId, type, ...names) {
247
+ return createFunctionCallExpression("extensionResourceId", [
248
+ baseId,
249
+ type,
250
+ ...names,
251
+ ]);
252
+ }
253
+ // ---------------------------------------------------------------------------
254
+ // Numeric functions
255
+ // ---------------------------------------------------------------------------
256
+ /** Converts a value to an integer at deployment time. */
257
+ export function int(value) {
258
+ return createFunctionCallExpression("int", [value]);
259
+ }
260
+ /** Returns the smallest of the supplied numbers. */
261
+ export function min(...values) {
262
+ return createFunctionCallExpression("min", values);
263
+ }
264
+ /** Returns the largest of the supplied numbers. */
265
+ export function max(...values) {
266
+ return createFunctionCallExpression("max", values);
267
+ }
268
+ // ---------------------------------------------------------------------------
269
+ // Array / collection functions
270
+ // ---------------------------------------------------------------------------
271
+ /** Returns the length of a string, array, or object at deployment time. */
272
+ export function length(value) {
273
+ return createFunctionCallExpression("length", [value]);
274
+ }
275
+ /** Tests whether a string, array, or object is empty. */
276
+ export function empty(value) {
277
+ return createFunctionCallExpression("empty", [value]);
278
+ }
279
+ /** Returns the first element of an array. */
280
+ export function first(arr) {
281
+ return createFunctionCallExpression("first", [arr]);
282
+ }
283
+ /** Returns the last element of an array. */
284
+ export function last(arr) {
285
+ return createFunctionCallExpression("last", [arr]);
286
+ }
287
+ /** Tests whether a string, array, or object contains a value or key. */
288
+ export function contains(container, value) {
289
+ return createFunctionCallExpression("contains", [container, value]);
290
+ }
291
+ /** Returns the first index of `value` in an array, or -1 if absent. */
292
+ export function indexOf(arr, value) {
293
+ return createFunctionCallExpression("indexOf", [arr, value]);
294
+ }
295
+ /** Flattens one level of nested arrays. */
296
+ export function flatten(arr) {
297
+ return createFunctionCallExpression("flatten", [arr]);
298
+ }
299
+ /** Returns the intersection of two arrays or objects. */
300
+ export function intersect(a, b) {
301
+ return createFunctionCallExpression("intersection", [a, b]);
302
+ }
303
+ export function union(a, b) {
304
+ return createFunctionCallExpression("union", [a, b]);
305
+ }
306
+ /** Skips the first `count` elements of an array. */
307
+ export function skip(arr, count) {
308
+ return createFunctionCallExpression("skip", [arr, count]);
309
+ }
310
+ /** Returns an array's elements in reverse order. */
311
+ export function reverse(arr) {
312
+ return createFunctionCallExpression("reverse", [arr]);
313
+ }
314
+ // ---------------------------------------------------------------------------
315
+ // Object functions
316
+ // ---------------------------------------------------------------------------
317
+ /** Parses JSON text into a deploy-time value. */
318
+ export function json(value) {
319
+ return createFunctionCallExpression("json", [value]);
320
+ }
321
+ /** Returns the property names of an object. */
322
+ export function objectKeys(obj) {
323
+ return createFunctionCallExpression("objectKeys", [obj]);
324
+ }
325
+ /** Returns an object's key/value pairs as an array. */
326
+ export function items(obj) {
327
+ return createFunctionCallExpression("items", [obj]);
328
+ }
329
+ export function subscription(subscriptionId) {
330
+ return createFunctionCallExpression("subscription", subscriptionId === undefined ? [] : [subscriptionId]);
331
+ }
332
+ export function resourceGroup(...args) {
333
+ return createFunctionCallExpression("resourceGroup", args);
334
+ }
335
+ /**
336
+ * Bicep `tenant()`. Returns details about the current tenant (or a scope
337
+ * object when placed in `scope:`). Takes no arguments.
338
+ */
339
+ export function tenant() {
340
+ return createFunctionCallExpression("tenant", []);
341
+ }
342
+ export function managementGroup(identifier) {
343
+ return createFunctionCallExpression("managementGroup", identifier === undefined ? [] : [identifier]);
344
+ }
345
+ /** Bicep `deployment()`. Returns information about the current deployment. */
346
+ export function deployment() {
347
+ return createFunctionCallExpression("deployment", []);
348
+ }
349
+ /** Bicep `environment()`. Returns information about the Azure environment. */
350
+ export function environment() {
351
+ return createFunctionCallExpression("environment", []);
352
+ }
353
+ //# sourceMappingURL=fn.js.map
package/dist/fn.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fn.js","sourceRoot":"","sources":["../src/fn.ts"],"names":[],"mappings":"AAAA,uCAAu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iC;IAEpC,OAAO,4BAA4B,CACjC,eAAe,EACf,IAAI,CACL,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,MAAM;IACpB,OAAO,4BAA4B,CAAc,QAAQ,EAAE,EAAE,CAAC,CAAC;AACjE,CAAC;AAcD,MAAM,UAAU,eAAe,CAC7B,UAAsC;IAEtC,OAAO,4BAA4B,CACjC,iBAAiB,EACjB,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAC7C,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,UAAU;IACxB,OAAO,4BAA4B,CAAU,YAAY,EAAE,EAAE,CAAC,CAAC;AACjE,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,WAAW;IACzB,OAAO,4BAA4B,CAAU,aAAa,EAAE,EAAE,CAAC,CAAC;AAClE,CAAC"}
@@ -0,0 +1,25 @@
1
+ export type { PrimitiveTypeMap, PrimitiveTypeName, TargetScope, } from "./serialization/contract/index.js";
2
+ export { createOutput, OutputCollection, type OutputMetadata, type OutputOptions, type ScalarOutputType, type OutputType, type OutputValue, type OutputValueFor, } from "./constructs/output.js";
3
+ export { createParameter, ParameterCollection, type InferParamType, type Parameter, type ParameterMetadata, type ParameterOptions, type ParameterValue, } from "./constructs/parameter.js";
4
+ export { createVariable, type ExpressionValue, VariableCollection, type Variable, type VariableMetadata, type VariableOptions, type VariableValue, } from "./constructs/variable.js";
5
+ export { Stack, type StackOptions } from "./constructs/stack.js";
6
+ export { ProvisioningComponent, type ProvisioningComponentConstructor, } from "./constructs/provisioning-component.js";
7
+ export type { DeploymentContext } from "./deployment-context/deployment-context.js";
8
+ export { asDiscriminator, isExpression, type Expression, type ExpressionBrand, type ExpressionOrValue, type ExpressionShape, type ExpressionTag, type InputOf, type InputRecord, } from "./expression/expressions.js";
9
+ export type { ArrayAccessExpressionNode, ArrayAccessIndex, BinaryExpressionNode, BinaryOperator, ExpressionNode, FunctionCallExpressionNode, IdentifierExpressionNode, InstanceFunctionCallExpressionNode, InterpolatedStringExpressionNode, PropertyAccessExpressionNode, SymbolicValueExpressionNode, TernaryExpressionNode, UnaryExpressionNode, UnaryOperator, } from "./expression/ast-nodes.js";
10
+ export * as fn from "./fn.js";
11
+ export { DefaultNamingPolicy, namingRequiredPolicy, type NamingContext, type NamingPolicy, type NamingPolicyOptions, } from "./naming/naming-policy.js";
12
+ export type { ResourceNamingRules, ResourceNamingValidCharacters, } from "./naming/naming-rules.js";
13
+ export { type QueryOptions } from "./constructs/resource/resource-query.js";
14
+ export { isResource, isResourceDeclaration, isResourceOf, } from "./constructs/resource/resource-utils.js";
15
+ export { ResourceDeclaration } from "./constructs/resource/resource.js";
16
+ export { deref, type Deref } from "./constructs/resource/resource-proxy.js";
17
+ export { type ScopeExpression, type ExistingResourceProps, type ResourceProps, type ResourceState, type ResourceOptions, } from "./constructs/resource/resource.js";
18
+ export { Resource } from "./constructs/resource/resource.js";
19
+ export type { ResourceCtor } from "./constructs/resource/resource-registry.js";
20
+ export type { FlatVariantPin, FlatVariantSelector, } from "./constructs/resource/resource-type-registry.js";
21
+ export type { AnyShape, ArrayShape, BooleanLiteralShape, BooleanShape, BytesShape, ContainerShape, DateShape, DeferredShape, DiscriminatedModelShape, DiscriminatorNames, EnumShape, FlatModelShape, ModelShape, NullShape, NumberLiteralShape, NumberShape, PropertyShape, RecordShape, StringLiteralShape, StringShape, TerminalValueShape, TupleShape, UnionShape, ValueShape, } from "./shape/shape.js";
22
+ export { INTEGER_SCALAR_NAMES, NUMERIC_SCALAR_NAMES, type BooleanStringEncodingDescriptor, type BooleanValueEncodingDescriptor, type BytesEncodingDescriptor, type BytesValueEncodingDescriptor, type DateTimeTextEncodingDescriptor, type DateValueEncodingDescriptor, type DurationIso8601EncodingDescriptor, type DurationNumericEncodingDescriptor, type IntegerScalarName, type NumberValueEncodingDescriptor, type NumericScalarName, type NumericStringEncodingDescriptor, type PlainDateEncodingDescriptor, type StringValueEncodingDescriptor, type UnixTimestampEncodingDescriptor, type ValueEncodingDescriptor, } from "./shape/value-encoding.js";
23
+ export type { PropertySegment } from "./types.js";
24
+ export { ResourceGroup, type ResourceGroupProps, } from "./constructs/built-in-resources/resource-group.js";
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,GACZ,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,cAAc,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,cAAc,GACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,cAAc,EACd,KAAK,eAAe,EACpB,kBAAkB,EAClB,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,aAAa,GACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EACL,qBAAqB,EACrB,KAAK,gCAAgC,GACtC,MAAM,wCAAwC,CAAC;AAChD,YAAY,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EACL,eAAe,EACf,YAAY,EACZ,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,OAAO,EACZ,KAAK,WAAW,GACjB,MAAM,6BAA6B,CAAC;AACrC,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AAW,EACX,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,UAAU,GACX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,KAAK,+BAA+B,EACpC,KAAK,8BAA8B,EACnC,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EACjC,KAAK,8BAA8B,EACnC,KAAK,2BAA2B,EAChC,KAAK,iCAAiC,EACtC,KAAK,iCAAiC,EACtC,KAAK,iBAAiB,EACtB,KAAK,6BAA6B,EAClC,KAAK,iBAAiB,EACtB,KAAK,+BAA+B,EACpC,KAAK,2BAA2B,EAChC,KAAK,6BAA6B,EAClC,KAAK,+BAA+B,EACpC,KAAK,uBAAuB,GAC7B,MAAM,2BAA2B,CAAC;AACnC,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EACL,aAAa,EACb,KAAK,kBAAkB,GACxB,MAAM,mDAAmD,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export { createOutput, OutputCollection, } from "./constructs/output.js";
4
+ export { createParameter, ParameterCollection, } from "./constructs/parameter.js";
5
+ export { createVariable, VariableCollection, } from "./constructs/variable.js";
6
+ export { Stack } from "./constructs/stack.js";
7
+ export { ProvisioningComponent, } from "./constructs/provisioning-component.js";
8
+ export { asDiscriminator, isExpression, } from "./expression/expressions.js";
9
+ export * as fn from "./fn.js";
10
+ export { DefaultNamingPolicy, namingRequiredPolicy, } from "./naming/naming-policy.js";
11
+ export {} from "./constructs/resource/resource-query.js";
12
+ export { isResource, isResourceDeclaration, isResourceOf, } from "./constructs/resource/resource-utils.js";
13
+ export { ResourceDeclaration } from "./constructs/resource/resource.js";
14
+ export { deref } from "./constructs/resource/resource-proxy.js";
15
+ export {} from "./constructs/resource/resource.js";
16
+ export { Resource } from "./constructs/resource/resource.js";
17
+ export { INTEGER_SCALAR_NAMES, NUMERIC_SCALAR_NAMES, } from "./shape/value-encoding.js";
18
+ export { ResourceGroup, } from "./constructs/built-in-resources/resource-group.js";
19
+ //# sourceMappingURL=index.js.map