@cdktn/provider-generator 0.24.0-pre.3 → 0.24.0-pre.31
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/.spec.swcrc +22 -0
- package/build/get/__tests__/generator/import-style.test.d.ts +2 -0
- package/build/get/__tests__/generator/import-style.test.js +101 -0
- package/build/get/__tests__/generator/module-generator.test.js +12 -12
- package/build/get/constructs-maker.d.ts +5 -1
- package/build/get/constructs-maker.js +5 -2
- package/build/get/generator/emitter/struct-emitter.d.ts +2 -1
- package/build/get/generator/emitter/struct-emitter.js +14 -11
- package/build/get/generator/module-generator.js +3 -3
- package/build/get/generator/provider-generator.d.ts +9 -1
- package/build/get/generator/provider-generator.js +9 -6
- package/eslint.config.mjs +13 -0
- package/jest.config.js +16 -9
- package/package.json +8 -9
- package/src/__tests__/__snapshots__/edge-provider-schema.test.ts.snap +8 -8
- package/src/__tests__/__snapshots__/provider.test.ts.snap +2951 -2951
- package/src/get/__tests__/generator/__snapshots__/complex-computed-types.test.ts.snap +5 -5
- package/src/get/__tests__/generator/__snapshots__/export-sharding.test.ts.snap +3310 -3310
- package/src/get/__tests__/generator/__snapshots__/module-generator.test.ts.snap +355 -355
- package/src/get/__tests__/generator/__snapshots__/nested-types.test.ts.snap +8 -8
- package/src/get/__tests__/generator/__snapshots__/provider.test.ts.snap +8 -8
- package/src/get/__tests__/generator/__snapshots__/resource-types.test.ts.snap +126 -126
- package/src/get/__tests__/generator/__snapshots__/skipped-attributes.test.ts.snap +17 -17
- package/src/get/__tests__/generator/__snapshots__/types.test.ts.snap +65 -65
|
@@ -29,7 +29,7 @@ export interface NestedTypeWithoutAttributesResourcePredictorBotDetection {
|
|
|
29
29
|
export function nestedTypeWithoutAttributesResourcePredictorBotDetectionToTerraform(struct?: NestedTypeWithoutAttributesResourcePredictorBotDetection | cdktn.IResolvable): any {
|
|
30
30
|
if (!cdktn.canInspect(struct) || cdktn.Tokenization.isResolvable(struct)) { return struct; }
|
|
31
31
|
if (cdktn.isComplexElement(struct)) {
|
|
32
|
-
throw new Error("A complex element was used as configuration, this is not supported: https://
|
|
32
|
+
throw new Error("A complex element was used as configuration, this is not supported: https://cdktn.io/docs/concepts/resources#references");
|
|
33
33
|
}
|
|
34
34
|
return {
|
|
35
35
|
}
|
|
@@ -39,7 +39,7 @@ export function nestedTypeWithoutAttributesResourcePredictorBotDetectionToTerraf
|
|
|
39
39
|
export function nestedTypeWithoutAttributesResourcePredictorBotDetectionToHclTerraform(struct?: NestedTypeWithoutAttributesResourcePredictorBotDetection | cdktn.IResolvable): any {
|
|
40
40
|
if (!cdktn.canInspect(struct) || cdktn.Tokenization.isResolvable(struct)) { return struct; }
|
|
41
41
|
if (cdktn.isComplexElement(struct)) {
|
|
42
|
-
throw new Error("A complex element was used as configuration, this is not supported: https://
|
|
42
|
+
throw new Error("A complex element was used as configuration, this is not supported: https://cdktn.io/docs/concepts/resources#references");
|
|
43
43
|
}
|
|
44
44
|
const attrs = {
|
|
45
45
|
};
|
|
@@ -250,7 +250,7 @@ export interface NestedTypesResourceArchiveRulesFilter {
|
|
|
250
250
|
export function nestedTypesResourceArchiveRulesFilterToTerraform(struct?: NestedTypesResourceArchiveRulesFilter | cdktn.IResolvable): any {
|
|
251
251
|
if (!cdktn.canInspect(struct) || cdktn.Tokenization.isResolvable(struct)) { return struct; }
|
|
252
252
|
if (cdktn.isComplexElement(struct)) {
|
|
253
|
-
throw new Error("A complex element was used as configuration, this is not supported: https://
|
|
253
|
+
throw new Error("A complex element was used as configuration, this is not supported: https://cdktn.io/docs/concepts/resources#references");
|
|
254
254
|
}
|
|
255
255
|
return {
|
|
256
256
|
eq: cdktn.listMapper(cdktn.stringToTerraform, false)(struct!.eq),
|
|
@@ -263,7 +263,7 @@ export function nestedTypesResourceArchiveRulesFilterToTerraform(struct?: Nested
|
|
|
263
263
|
export function nestedTypesResourceArchiveRulesFilterToHclTerraform(struct?: NestedTypesResourceArchiveRulesFilter | cdktn.IResolvable): any {
|
|
264
264
|
if (!cdktn.canInspect(struct) || cdktn.Tokenization.isResolvable(struct)) { return struct; }
|
|
265
265
|
if (cdktn.isComplexElement(struct)) {
|
|
266
|
-
throw new Error("A complex element was used as configuration, this is not supported: https://
|
|
266
|
+
throw new Error("A complex element was used as configuration, this is not supported: https://cdktn.io/docs/concepts/resources#references");
|
|
267
267
|
}
|
|
268
268
|
const attrs = {
|
|
269
269
|
eq: {
|
|
@@ -401,7 +401,7 @@ export class NestedTypesResourceArchiveRulesFilterList extends cdktn.ComplexList
|
|
|
401
401
|
* @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index)
|
|
402
402
|
*/
|
|
403
403
|
constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string, wrapsSet: boolean) {
|
|
404
|
-
super(terraformResource, terraformAttribute, wrapsSet)
|
|
404
|
+
super(terraformResource, terraformAttribute, wrapsSet);
|
|
405
405
|
}
|
|
406
406
|
|
|
407
407
|
/**
|
|
@@ -427,7 +427,7 @@ export interface NestedTypesResourceArchiveRules {
|
|
|
427
427
|
export function nestedTypesResourceArchiveRulesToTerraform(struct?: NestedTypesResourceArchiveRules | cdktn.IResolvable): any {
|
|
428
428
|
if (!cdktn.canInspect(struct) || cdktn.Tokenization.isResolvable(struct)) { return struct; }
|
|
429
429
|
if (cdktn.isComplexElement(struct)) {
|
|
430
|
-
throw new Error("A complex element was used as configuration, this is not supported: https://
|
|
430
|
+
throw new Error("A complex element was used as configuration, this is not supported: https://cdktn.io/docs/concepts/resources#references");
|
|
431
431
|
}
|
|
432
432
|
return {
|
|
433
433
|
filter: cdktn.listMapper(nestedTypesResourceArchiveRulesFilterToTerraform, false)(struct!.filter),
|
|
@@ -439,7 +439,7 @@ export function nestedTypesResourceArchiveRulesToTerraform(struct?: NestedTypesR
|
|
|
439
439
|
export function nestedTypesResourceArchiveRulesToHclTerraform(struct?: NestedTypesResourceArchiveRules | cdktn.IResolvable): any {
|
|
440
440
|
if (!cdktn.canInspect(struct) || cdktn.Tokenization.isResolvable(struct)) { return struct; }
|
|
441
441
|
if (cdktn.isComplexElement(struct)) {
|
|
442
|
-
throw new Error("A complex element was used as configuration, this is not supported: https://
|
|
442
|
+
throw new Error("A complex element was used as configuration, this is not supported: https://cdktn.io/docs/concepts/resources#references");
|
|
443
443
|
}
|
|
444
444
|
const attrs = {
|
|
445
445
|
filter: {
|
|
@@ -546,7 +546,7 @@ export class NestedTypesResourceArchiveRulesList extends cdktn.ComplexList {
|
|
|
546
546
|
* @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index)
|
|
547
547
|
*/
|
|
548
548
|
constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string, wrapsSet: boolean) {
|
|
549
|
-
super(terraformResource, terraformAttribute, wrapsSet)
|
|
549
|
+
super(terraformResource, terraformAttribute, wrapsSet);
|
|
550
550
|
}
|
|
551
551
|
|
|
552
552
|
/**
|
|
@@ -166,7 +166,7 @@ export interface AwsProviderAssumeRole {
|
|
|
166
166
|
export function awsProviderAssumeRoleToTerraform(struct?: AwsProviderAssumeRole): any {
|
|
167
167
|
if (!cdktn.canInspect(struct) || cdktn.Tokenization.isResolvable(struct)) { return struct; }
|
|
168
168
|
if (cdktn.isComplexElement(struct)) {
|
|
169
|
-
throw new Error("A complex element was used as configuration, this is not supported: https://
|
|
169
|
+
throw new Error("A complex element was used as configuration, this is not supported: https://cdktn.io/docs/concepts/resources#references");
|
|
170
170
|
}
|
|
171
171
|
return {
|
|
172
172
|
external_id: cdktn.stringToTerraform(struct!.externalId),
|
|
@@ -180,7 +180,7 @@ export function awsProviderAssumeRoleToTerraform(struct?: AwsProviderAssumeRole)
|
|
|
180
180
|
export function awsProviderAssumeRoleToHclTerraform(struct?: AwsProviderAssumeRole): any {
|
|
181
181
|
if (!cdktn.canInspect(struct) || cdktn.Tokenization.isResolvable(struct)) { return struct; }
|
|
182
182
|
if (cdktn.isComplexElement(struct)) {
|
|
183
|
-
throw new Error("A complex element was used as configuration, this is not supported: https://
|
|
183
|
+
throw new Error("A complex element was used as configuration, this is not supported: https://cdktn.io/docs/concepts/resources#references");
|
|
184
184
|
}
|
|
185
185
|
const attrs = {
|
|
186
186
|
external_id: {
|
|
@@ -1029,7 +1029,7 @@ export interface AwsProviderEndpoints {
|
|
|
1029
1029
|
export function awsProviderEndpointsToTerraform(struct?: AwsProviderEndpoints | cdktn.IResolvable): any {
|
|
1030
1030
|
if (!cdktn.canInspect(struct) || cdktn.Tokenization.isResolvable(struct)) { return struct; }
|
|
1031
1031
|
if (cdktn.isComplexElement(struct)) {
|
|
1032
|
-
throw new Error("A complex element was used as configuration, this is not supported: https://
|
|
1032
|
+
throw new Error("A complex element was used as configuration, this is not supported: https://cdktn.io/docs/concepts/resources#references");
|
|
1033
1033
|
}
|
|
1034
1034
|
return {
|
|
1035
1035
|
accessanalyzer: cdktn.stringToTerraform(struct!.accessanalyzer),
|
|
@@ -1174,7 +1174,7 @@ export function awsProviderEndpointsToTerraform(struct?: AwsProviderEndpoints |
|
|
|
1174
1174
|
export function awsProviderEndpointsToHclTerraform(struct?: AwsProviderEndpoints | cdktn.IResolvable): any {
|
|
1175
1175
|
if (!cdktn.canInspect(struct) || cdktn.Tokenization.isResolvable(struct)) { return struct; }
|
|
1176
1176
|
if (cdktn.isComplexElement(struct)) {
|
|
1177
|
-
throw new Error("A complex element was used as configuration, this is not supported: https://
|
|
1177
|
+
throw new Error("A complex element was used as configuration, this is not supported: https://cdktn.io/docs/concepts/resources#references");
|
|
1178
1178
|
}
|
|
1179
1179
|
const attrs = {
|
|
1180
1180
|
accessanalyzer: {
|
|
@@ -2011,7 +2011,7 @@ export interface AwsProviderIgnoreTags {
|
|
|
2011
2011
|
export function awsProviderIgnoreTagsToTerraform(struct?: AwsProviderIgnoreTags): any {
|
|
2012
2012
|
if (!cdktn.canInspect(struct) || cdktn.Tokenization.isResolvable(struct)) { return struct; }
|
|
2013
2013
|
if (cdktn.isComplexElement(struct)) {
|
|
2014
|
-
throw new Error("A complex element was used as configuration, this is not supported: https://
|
|
2014
|
+
throw new Error("A complex element was used as configuration, this is not supported: https://cdktn.io/docs/concepts/resources#references");
|
|
2015
2015
|
}
|
|
2016
2016
|
return {
|
|
2017
2017
|
key_prefixes: cdktn.listMapper(cdktn.stringToTerraform, false)(struct!.keyPrefixes),
|
|
@@ -2023,7 +2023,7 @@ export function awsProviderIgnoreTagsToTerraform(struct?: AwsProviderIgnoreTags)
|
|
|
2023
2023
|
export function awsProviderIgnoreTagsToHclTerraform(struct?: AwsProviderIgnoreTags): any {
|
|
2024
2024
|
if (!cdktn.canInspect(struct) || cdktn.Tokenization.isResolvable(struct)) { return struct; }
|
|
2025
2025
|
if (cdktn.isComplexElement(struct)) {
|
|
2026
|
-
throw new Error("A complex element was used as configuration, this is not supported: https://
|
|
2026
|
+
throw new Error("A complex element was used as configuration, this is not supported: https://cdktn.io/docs/concepts/resources#references");
|
|
2027
2027
|
}
|
|
2028
2028
|
const attrs = {
|
|
2029
2029
|
key_prefixes: {
|
|
@@ -2686,7 +2686,7 @@ export interface ElasticstackProviderElasticsearch {
|
|
|
2686
2686
|
export function elasticstackProviderElasticsearchToTerraform(struct?: ElasticstackProviderElasticsearch): any {
|
|
2687
2687
|
if (!cdktn.canInspect(struct) || cdktn.Tokenization.isResolvable(struct)) { return struct; }
|
|
2688
2688
|
if (cdktn.isComplexElement(struct)) {
|
|
2689
|
-
throw new Error("A complex element was used as configuration, this is not supported: https://
|
|
2689
|
+
throw new Error("A complex element was used as configuration, this is not supported: https://cdktn.io/docs/concepts/resources#references");
|
|
2690
2690
|
}
|
|
2691
2691
|
return {
|
|
2692
2692
|
api_key: cdktn.stringToTerraform(struct!.apiKey),
|
|
@@ -2707,7 +2707,7 @@ export function elasticstackProviderElasticsearchToTerraform(struct?: Elasticsta
|
|
|
2707
2707
|
export function elasticstackProviderElasticsearchToHclTerraform(struct?: ElasticstackProviderElasticsearch): any {
|
|
2708
2708
|
if (!cdktn.canInspect(struct) || cdktn.Tokenization.isResolvable(struct)) { return struct; }
|
|
2709
2709
|
if (cdktn.isComplexElement(struct)) {
|
|
2710
|
-
throw new Error("A complex element was used as configuration, this is not supported: https://
|
|
2710
|
+
throw new Error("A complex element was used as configuration, this is not supported: https://cdktn.io/docs/concepts/resources#references");
|
|
2711
2711
|
}
|
|
2712
2712
|
const attrs = {
|
|
2713
2713
|
api_key: {
|