timonel 2.8.0-beta.5 → 2.8.0
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 +9 -25
- package/README.md +12 -55
- package/dist/cli.d.ts.map +1 -0
- package/dist/{src/cli.js → cli.js} +4 -35
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/{src/lib → lib}/helm.d.ts +234 -4
- package/dist/lib/helm.d.ts.map +1 -0
- package/dist/{src/lib → lib}/helm.js +309 -20
- package/dist/lib/helm.js.map +1 -0
- package/dist/lib/helmChartWriter.d.ts.map +1 -0
- package/dist/{src/lib → lib}/helmChartWriter.js +5 -19
- package/dist/lib/helmChartWriter.js.map +1 -0
- package/dist/{src/lib → lib}/resources/baseResourceProvider.d.ts +1 -1
- package/dist/lib/resources/baseResourceProvider.d.ts.map +1 -0
- package/dist/lib/resources/baseResourceProvider.js.map +1 -0
- package/dist/{src/lib → lib}/resources/cloud/aws/awsResources.d.ts +5 -14
- package/dist/lib/resources/cloud/aws/awsResources.d.ts.map +1 -0
- package/dist/{src/lib → lib}/resources/cloud/aws/awsResources.js +63 -78
- package/dist/lib/resources/cloud/aws/awsResources.js.map +1 -0
- package/dist/lib/resources/cloud/aws/karpenterResources.d.ts.map +1 -0
- package/dist/lib/resources/cloud/aws/karpenterResources.js.map +1 -0
- package/dist/lib/rutter.d.ts +445 -0
- package/dist/lib/rutter.d.ts.map +1 -0
- package/dist/lib/rutter.js +585 -0
- package/dist/lib/rutter.js.map +1 -0
- package/dist/{src/lib → lib}/security.d.ts +2 -72
- package/dist/lib/security.d.ts.map +1 -0
- package/dist/lib/security.js +390 -0
- package/dist/lib/security.js.map +1 -0
- package/dist/lib/umbrella.d.ts.map +1 -0
- package/dist/lib/umbrella.js.map +1 -0
- package/dist/{src/lib → lib}/umbrellaRutter.d.ts +1 -1
- package/dist/lib/umbrellaRutter.d.ts.map +1 -0
- package/dist/lib/umbrellaRutter.js.map +1 -0
- package/dist/{src/lib → lib}/utils/helmHelpers.d.ts +2 -12
- package/dist/lib/utils/helmHelpers.d.ts.map +1 -0
- package/dist/{src/lib → lib}/utils/helmHelpers.js +2 -46
- package/dist/lib/utils/helmHelpers.js.map +1 -0
- package/package.json +3 -4
- package/dist/src/cli.d.ts.map +0 -1
- package/dist/src/cli.js.map +0 -1
- package/dist/src/index.d.ts +0 -23
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -15
- package/dist/src/index.js.map +0 -1
- package/dist/src/lib/constants.d.ts +0 -142
- package/dist/src/lib/constants.d.ts.map +0 -1
- package/dist/src/lib/constants.js +0 -167
- package/dist/src/lib/constants.js.map +0 -1
- package/dist/src/lib/helm.d.ts.map +0 -1
- package/dist/src/lib/helm.js.map +0 -1
- package/dist/src/lib/helmChartWriter.d.ts.map +0 -1
- package/dist/src/lib/helmChartWriter.js.map +0 -1
- package/dist/src/lib/resources/autoscaling/autoscalingResources.d.ts +0 -248
- package/dist/src/lib/resources/autoscaling/autoscalingResources.d.ts.map +0 -1
- package/dist/src/lib/resources/autoscaling/autoscalingResources.js +0 -81
- package/dist/src/lib/resources/autoscaling/autoscalingResources.js.map +0 -1
- package/dist/src/lib/resources/baseResourceProvider.d.ts.map +0 -1
- package/dist/src/lib/resources/baseResourceProvider.js.map +0 -1
- package/dist/src/lib/resources/cloud/aws/awsResources.d.ts.map +0 -1
- package/dist/src/lib/resources/cloud/aws/awsResources.js.map +0 -1
- package/dist/src/lib/resources/cloud/aws/karpenterResources.d.ts.map +0 -1
- package/dist/src/lib/resources/cloud/aws/karpenterResources.js.map +0 -1
- package/dist/src/lib/resources/cloud/azure/azureResources.d.ts +0 -169
- package/dist/src/lib/resources/cloud/azure/azureResources.d.ts.map +0 -1
- package/dist/src/lib/resources/cloud/azure/azureResources.js +0 -218
- package/dist/src/lib/resources/cloud/azure/azureResources.js.map +0 -1
- package/dist/src/lib/resources/cloud/gcp/gcpResources.d.ts +0 -164
- package/dist/src/lib/resources/cloud/gcp/gcpResources.d.ts.map +0 -1
- package/dist/src/lib/resources/cloud/gcp/gcpResources.js +0 -192
- package/dist/src/lib/resources/cloud/gcp/gcpResources.js.map +0 -1
- package/dist/src/lib/resources/core/coreResources.d.ts +0 -790
- package/dist/src/lib/resources/core/coreResources.d.ts.map +0 -1
- package/dist/src/lib/resources/core/coreResources.js +0 -1115
- package/dist/src/lib/resources/core/coreResources.js.map +0 -1
- package/dist/src/lib/resources/core/storageResources.d.ts +0 -133
- package/dist/src/lib/resources/core/storageResources.d.ts.map +0 -1
- package/dist/src/lib/resources/core/storageResources.js +0 -120
- package/dist/src/lib/resources/core/storageResources.js.map +0 -1
- package/dist/src/lib/resources/network/networkResources.d.ts +0 -515
- package/dist/src/lib/resources/network/networkResources.d.ts.map +0 -1
- package/dist/src/lib/resources/network/networkResources.js +0 -784
- package/dist/src/lib/resources/network/networkResources.js.map +0 -1
- package/dist/src/lib/resources/security/encryption.d.ts +0 -290
- package/dist/src/lib/resources/security/encryption.d.ts.map +0 -1
- package/dist/src/lib/resources/security/encryption.js +0 -295
- package/dist/src/lib/resources/security/encryption.js.map +0 -1
- package/dist/src/lib/resources/security/index.d.ts +0 -6
- package/dist/src/lib/resources/security/index.d.ts.map +0 -1
- package/dist/src/lib/resources/security/index.js +0 -6
- package/dist/src/lib/resources/security/index.js.map +0 -1
- package/dist/src/lib/resources/validation/validationResources.d.ts +0 -26
- package/dist/src/lib/resources/validation/validationResources.d.ts.map +0 -1
- package/dist/src/lib/resources/validation/validationResources.js +0 -33
- package/dist/src/lib/resources/validation/validationResources.js.map +0 -1
- package/dist/src/lib/rutter.d.ts +0 -1106
- package/dist/src/lib/rutter.d.ts.map +0 -1
- package/dist/src/lib/rutter.js +0 -1295
- package/dist/src/lib/rutter.js.map +0 -1
- package/dist/src/lib/security.d.ts.map +0 -1
- package/dist/src/lib/security.js +0 -569
- package/dist/src/lib/security.js.map +0 -1
- package/dist/src/lib/umbrella.d.ts.map +0 -1
- package/dist/src/lib/umbrella.js.map +0 -1
- package/dist/src/lib/umbrellaRutter.d.ts.map +0 -1
- package/dist/src/lib/umbrellaRutter.js.map +0 -1
- package/dist/src/lib/utils/helmHelpers.d.ts.map +0 -1
- package/dist/src/lib/utils/helmHelpers.js.map +0 -1
- package/dist/src/lib/utils/podTemplates.d.ts +0 -192
- package/dist/src/lib/utils/podTemplates.d.ts.map +0 -1
- package/dist/src/lib/utils/podTemplates.js +0 -331
- package/dist/src/lib/utils/podTemplates.js.map +0 -1
- package/dist/src/lib/utils/resourceNaming.d.ts +0 -57
- package/dist/src/lib/utils/resourceNaming.d.ts.map +0 -1
- package/dist/src/lib/utils/resourceNaming.js +0 -82
- package/dist/src/lib/utils/resourceNaming.js.map +0 -1
- /package/dist/{src/cli.d.ts → cli.d.ts} +0 -0
- /package/dist/{src/lib → lib}/helmChartWriter.d.ts +0 -0
- /package/dist/{src/lib → lib}/resources/baseResourceProvider.js +0 -0
- /package/dist/{src/lib → lib}/resources/cloud/aws/karpenterResources.d.ts +0 -0
- /package/dist/{src/lib → lib}/resources/cloud/aws/karpenterResources.js +0 -0
- /package/dist/{src/lib → lib}/umbrella.d.ts +0 -0
- /package/dist/{src/lib → lib}/umbrella.js +0 -0
- /package/dist/{src/lib → lib}/umbrellaRutter.js +0 -0
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
import { BaseResourceProvider } from '../../baseResourceProvider.js';
|
|
2
|
-
/**
|
|
3
|
-
* Azure-specific Kubernetes resources provider
|
|
4
|
-
* Handles Azure integrations like Azure Disk, Azure File, Application Gateway, AGIC, and other Azure services
|
|
5
|
-
*
|
|
6
|
-
* @since 2.4.0
|
|
7
|
-
*/
|
|
8
|
-
export class AzureResources extends BaseResourceProvider {
|
|
9
|
-
/**
|
|
10
|
-
* Creates an Azure Disk StorageClass
|
|
11
|
-
* @param spec - Azure Disk StorageClass specification
|
|
12
|
-
* @returns Created StorageClass ApiObject
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```typescript
|
|
16
|
-
* azureResources.addAzureDiskStorageClass({
|
|
17
|
-
* name: 'premium-disk',
|
|
18
|
-
* skuName: 'Premium_LRS',
|
|
19
|
-
* cachingMode: 'ReadOnly',
|
|
20
|
-
* allowVolumeExpansion: true
|
|
21
|
-
* });
|
|
22
|
-
* ```
|
|
23
|
-
*
|
|
24
|
-
* @since 2.4.0
|
|
25
|
-
*/
|
|
26
|
-
addAzureDiskStorageClass(spec) {
|
|
27
|
-
const parameters = {
|
|
28
|
-
skuName: spec.skuName ?? 'Standard_LRS',
|
|
29
|
-
...(spec.cachingMode ? { cachingmode: spec.cachingMode } : {}),
|
|
30
|
-
...(spec.fsType ? { fsType: spec.fsType } : {}),
|
|
31
|
-
...(spec.kind ? { kind: spec.kind } : {}),
|
|
32
|
-
};
|
|
33
|
-
const fields = {
|
|
34
|
-
provisioner: 'disk.csi.azure.com',
|
|
35
|
-
parameters,
|
|
36
|
-
reclaimPolicy: spec.reclaimPolicy ?? 'Delete',
|
|
37
|
-
allowVolumeExpansion: spec.allowVolumeExpansion ?? true,
|
|
38
|
-
volumeBindingMode: spec.volumeBindingMode ?? 'WaitForFirstConsumer',
|
|
39
|
-
};
|
|
40
|
-
return this.createRootLevelApiObject(spec.name, AzureResources.STORAGE_API_VERSION, 'StorageClass', fields, spec.labels, spec.annotations);
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Creates an Azure File StorageClass
|
|
44
|
-
* @param spec - Azure File StorageClass specification
|
|
45
|
-
* @returns Created StorageClass ApiObject
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* ```typescript
|
|
49
|
-
* azureResources.addAzureFileStorageClass({
|
|
50
|
-
* name: 'azure-file-premium',
|
|
51
|
-
* skuName: 'Premium_LRS',
|
|
52
|
-
* protocol: 'nfs',
|
|
53
|
-
* allowSharedAccess: true
|
|
54
|
-
* });
|
|
55
|
-
* ```
|
|
56
|
-
*
|
|
57
|
-
* @since 2.4.0
|
|
58
|
-
*/
|
|
59
|
-
addAzureFileStorageClass(spec) {
|
|
60
|
-
const parameters = {
|
|
61
|
-
skuName: spec.skuName ?? 'Standard_LRS',
|
|
62
|
-
...(spec.protocol ? { protocol: spec.protocol } : {}),
|
|
63
|
-
...(spec.allowSharedAccess !== undefined
|
|
64
|
-
? { allowSharedAccess: String(spec.allowSharedAccess) }
|
|
65
|
-
: {}),
|
|
66
|
-
};
|
|
67
|
-
const fields = {
|
|
68
|
-
provisioner: 'file.csi.azure.com',
|
|
69
|
-
parameters,
|
|
70
|
-
reclaimPolicy: spec.reclaimPolicy ?? 'Delete',
|
|
71
|
-
allowVolumeExpansion: spec.allowVolumeExpansion ?? true,
|
|
72
|
-
volumeBindingMode: spec.volumeBindingMode ?? 'Immediate',
|
|
73
|
-
};
|
|
74
|
-
return this.createRootLevelApiObject(spec.name, AzureResources.STORAGE_API_VERSION, 'StorageClass', fields, spec.labels, spec.annotations);
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Creates an Azure Application Gateway Ingress
|
|
78
|
-
* @param spec - AGIC Ingress specification
|
|
79
|
-
* @returns Created Ingress ApiObject
|
|
80
|
-
*
|
|
81
|
-
* @example
|
|
82
|
-
* ```typescript
|
|
83
|
-
* azureResources.addApplicationGatewayIngress({
|
|
84
|
-
* name: 'app-gateway-ingress',
|
|
85
|
-
* host: 'myapp.example.com',
|
|
86
|
-
* serviceName: 'my-service',
|
|
87
|
-
* servicePort: 80,
|
|
88
|
-
* sslRedirect: true
|
|
89
|
-
* });
|
|
90
|
-
* ```
|
|
91
|
-
*
|
|
92
|
-
* @since 2.4.0
|
|
93
|
-
*/
|
|
94
|
-
addApplicationGatewayIngress(spec) {
|
|
95
|
-
const annotations = {
|
|
96
|
-
'kubernetes.io/ingress.class': 'azure/application-gateway',
|
|
97
|
-
...(spec.sslRedirect !== undefined
|
|
98
|
-
? { 'appgw.ingress.kubernetes.io/ssl-redirect': String(spec.sslRedirect) }
|
|
99
|
-
: {}),
|
|
100
|
-
...(spec.cookieBasedAffinity !== undefined
|
|
101
|
-
? { 'appgw.ingress.kubernetes.io/cookie-based-affinity': String(spec.cookieBasedAffinity) }
|
|
102
|
-
: {}),
|
|
103
|
-
...(spec.requestTimeout
|
|
104
|
-
? { 'appgw.ingress.kubernetes.io/request-timeout': String(spec.requestTimeout) }
|
|
105
|
-
: {}),
|
|
106
|
-
...(spec.connectionDraining !== undefined
|
|
107
|
-
? { 'appgw.ingress.kubernetes.io/connection-draining': String(spec.connectionDraining) }
|
|
108
|
-
: {}),
|
|
109
|
-
...(spec.annotations || {}),
|
|
110
|
-
};
|
|
111
|
-
const rules = [
|
|
112
|
-
{
|
|
113
|
-
host: spec.host,
|
|
114
|
-
http: {
|
|
115
|
-
paths: [
|
|
116
|
-
{
|
|
117
|
-
path: spec.path ?? '/',
|
|
118
|
-
pathType: 'Prefix',
|
|
119
|
-
backend: {
|
|
120
|
-
service: {
|
|
121
|
-
name: spec.serviceName,
|
|
122
|
-
port: { number: spec.servicePort },
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
],
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
];
|
|
130
|
-
const ingressSpec = {
|
|
131
|
-
rules,
|
|
132
|
-
...(spec.tls ? { tls: spec.tls } : {}),
|
|
133
|
-
};
|
|
134
|
-
return this.createApiObject(spec.name, AzureResources.NETWORKING_API_VERSION, 'Ingress', ingressSpec, spec.labels, annotations);
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Creates an Azure Key Vault SecretProviderClass
|
|
138
|
-
* @param spec - Azure Key Vault SecretProviderClass specification
|
|
139
|
-
* @returns Created SecretProviderClass ApiObject
|
|
140
|
-
*
|
|
141
|
-
* @example
|
|
142
|
-
* ```typescript
|
|
143
|
-
* azureResources.addAzureKeyVaultSecretProviderClass({
|
|
144
|
-
* name: 'app-secrets',
|
|
145
|
-
* keyVaultName: 'my-keyvault',
|
|
146
|
-
* tenantId: '87654321-4321-4321-4321-210987654321',
|
|
147
|
-
* objects: [
|
|
148
|
-
* { objectName: 'database-password', objectType: 'secret' }
|
|
149
|
-
* ]
|
|
150
|
-
* });
|
|
151
|
-
* ```
|
|
152
|
-
*
|
|
153
|
-
* @since 2.4.0
|
|
154
|
-
*/
|
|
155
|
-
addAzureKeyVaultSecretProviderClass(spec) {
|
|
156
|
-
// Validate object names for security
|
|
157
|
-
spec.objects.forEach((obj) => {
|
|
158
|
-
if (obj.objectName.includes('../') || obj.objectName.includes('..\\')) {
|
|
159
|
-
throw new Error(`Azure Key Vault ${spec.name}: Object name '${obj.objectName}' contains invalid path traversal sequences`);
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
const objects = spec.objects.map((obj) => ({
|
|
163
|
-
objectName: obj.objectName,
|
|
164
|
-
objectType: obj.objectType,
|
|
165
|
-
...(obj.objectAlias ? { objectAlias: obj.objectAlias } : {}),
|
|
166
|
-
...(obj.objectVersion ? { objectVersion: obj.objectVersion } : {}),
|
|
167
|
-
}));
|
|
168
|
-
const secretProviderSpec = {
|
|
169
|
-
secretObjects: [
|
|
170
|
-
{
|
|
171
|
-
secretName: spec.secretName || spec.name,
|
|
172
|
-
type: 'Opaque',
|
|
173
|
-
data: objects.map((obj) => ({
|
|
174
|
-
objectName: obj.objectName,
|
|
175
|
-
key: obj.objectAlias || obj.objectName,
|
|
176
|
-
})),
|
|
177
|
-
},
|
|
178
|
-
],
|
|
179
|
-
parameters: {
|
|
180
|
-
keyvaultName: spec.keyVaultName,
|
|
181
|
-
tenantId: spec.tenantId,
|
|
182
|
-
objects: JSON.stringify({ array: objects }),
|
|
183
|
-
...(spec.userAssignedIdentityID
|
|
184
|
-
? { userAssignedIdentityID: spec.userAssignedIdentityID }
|
|
185
|
-
: {}),
|
|
186
|
-
},
|
|
187
|
-
};
|
|
188
|
-
return this.createApiObject(spec.name, 'secrets-store.csi.x-k8s.io/v1', 'SecretProviderClass', secretProviderSpec, spec.labels, spec.annotations);
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Creates an Azure Container Registry ServiceAccount
|
|
192
|
-
* @param spec - Azure ACR ServiceAccount specification
|
|
193
|
-
* @returns Created ServiceAccount ApiObject
|
|
194
|
-
*
|
|
195
|
-
* @example
|
|
196
|
-
* ```typescript
|
|
197
|
-
* azureResources.addAzureACRServiceAccount({
|
|
198
|
-
* name: 'acr-service-account',
|
|
199
|
-
* acrName: 'myregistry',
|
|
200
|
-
* resourceGroup: 'my-rg'
|
|
201
|
-
* });
|
|
202
|
-
* ```
|
|
203
|
-
*
|
|
204
|
-
* @since 2.4.0
|
|
205
|
-
*/
|
|
206
|
-
addAzureACRServiceAccount(spec) {
|
|
207
|
-
const annotations = {
|
|
208
|
-
'azure.workload.identity/client-id': spec.clientId || '',
|
|
209
|
-
'azure.workload.identity/tenant-id': spec.tenantId || '',
|
|
210
|
-
...(spec.annotations || {}),
|
|
211
|
-
};
|
|
212
|
-
const serviceAccountSpec = {};
|
|
213
|
-
return this.createApiObject(spec.name, 'v1', 'ServiceAccount', serviceAccountSpec, spec.labels, annotations);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
AzureResources.STORAGE_API_VERSION = 'storage.k8s.io/v1';
|
|
217
|
-
AzureResources.NETWORKING_API_VERSION = 'networking.k8s.io/v1';
|
|
218
|
-
//# sourceMappingURL=azureResources.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"azureResources.js","sourceRoot":"","sources":["../../../../../../src/lib/resources/cloud/azure/azureResources.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE;;;;;GAKG;AACH,MAAM,OAAO,cAAe,SAAQ,oBAAoB;IAItD;;;;;;;;;;;;;;;;OAgBG;IACH,wBAAwB,CAAC,IAA+B;QACtD,MAAM,UAAU,GAA2B;Y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;;;;;;OAeG;IACH,yBAAyB,CAAC,IAAgC;QACxD,MAAM,WAAW,GAA2B;YAC1C,mCAAmC,EAAE,IAAI,CAAC,QAAQ,IAAI,EAAE;YACxD,mCAAmC,EAAE,IAAI,CAAC,QAAQ,IAAI,EAAE;YACxD,GAAG,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC;SAC5B,CAAC;QAEF,MAAM,kBAAkB,GAAG,EAAE,CAAC;QAE9B,OAAO,IAAI,CAAC,eAAe,CACzB,IAAI,CAAC,IAAI,EACT,IAAI,EACJ,gBAAgB,EAChB,kBAAkB,EAClB,IAAI,CAAC,MAAM,EACX,WAAW,CACZ,CAAC;IACJ,CAAC;;AArQuB,kCAAmB,GAAG,mBAAmB,CAAC;AAC1C,qCAAsB,GAAG,sBAAsB,CAAC"}
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import type { ApiObject } from 'cdk8s';
|
|
2
|
-
import { BaseResourceProvider } from '../../baseResourceProvider.js';
|
|
3
|
-
/**
|
|
4
|
-
* GCP-specific Kubernetes resources provider
|
|
5
|
-
* Handles GCP integrations like Persistent Disk, Filestore, GCE Ingress, Workload Identity, and other GCP services
|
|
6
|
-
*
|
|
7
|
-
* @since 2.4.0
|
|
8
|
-
*/
|
|
9
|
-
export declare class GCPResources extends BaseResourceProvider {
|
|
10
|
-
private static readonly STORAGE_API_VERSION;
|
|
11
|
-
private static readonly CORE_API_VERSION;
|
|
12
|
-
private static readonly NETWORKING_API_VERSION;
|
|
13
|
-
/**
|
|
14
|
-
* Creates a GCP Persistent Disk StorageClass
|
|
15
|
-
* @param spec - GCP PD StorageClass specification
|
|
16
|
-
* @returns Created StorageClass ApiObject
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```typescript
|
|
20
|
-
* gcpResources.addPersistentDiskStorageClass({
|
|
21
|
-
* name: 'fast-ssd',
|
|
22
|
-
* type: 'pd-ssd',
|
|
23
|
-
* replicationType: 'regional-pd',
|
|
24
|
-
* allowVolumeExpansion: true
|
|
25
|
-
* });
|
|
26
|
-
* ```
|
|
27
|
-
*
|
|
28
|
-
* @since 2.4.0
|
|
29
|
-
*/
|
|
30
|
-
addPersistentDiskStorageClass(spec: GCPPersistentDiskStorageClassSpec): ApiObject;
|
|
31
|
-
/**
|
|
32
|
-
* Creates a GCP Filestore StorageClass
|
|
33
|
-
* @param spec - GCP Filestore StorageClass specification
|
|
34
|
-
* @returns Created StorageClass ApiObject
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```typescript
|
|
38
|
-
* gcpResources.addFilestoreStorageClass({
|
|
39
|
-
* name: 'filestore-premium',
|
|
40
|
-
* tier: 'premium',
|
|
41
|
-
* network: 'default',
|
|
42
|
-
* allowVolumeExpansion: true
|
|
43
|
-
* });
|
|
44
|
-
* ```
|
|
45
|
-
*
|
|
46
|
-
* @since 2.4.0
|
|
47
|
-
*/
|
|
48
|
-
addFilestoreStorageClass(spec: GCPFilestoreStorageClassSpec): ApiObject;
|
|
49
|
-
/**
|
|
50
|
-
* Creates a GCE Ingress with Google Cloud Load Balancer
|
|
51
|
-
* @param spec - GCE Ingress specification
|
|
52
|
-
* @returns Created Ingress ApiObject
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* ```typescript
|
|
56
|
-
* gcpResources.addGCEIngress({
|
|
57
|
-
* name: 'gce-ingress',
|
|
58
|
-
* host: 'myapp.example.com',
|
|
59
|
-
* serviceName: 'my-service',
|
|
60
|
-
* servicePort: 80,
|
|
61
|
-
* staticIPName: 'my-static-ip',
|
|
62
|
-
* managedCertificate: 'my-ssl-cert'
|
|
63
|
-
* });
|
|
64
|
-
* ```
|
|
65
|
-
*
|
|
66
|
-
* @since 2.4.0
|
|
67
|
-
*/
|
|
68
|
-
addGCEIngress(spec: GCPGCEIngressSpec): ApiObject;
|
|
69
|
-
/**
|
|
70
|
-
* Creates a ServiceAccount with Workload Identity annotations
|
|
71
|
-
* @param spec - Workload Identity ServiceAccount specification
|
|
72
|
-
* @returns Created ServiceAccount ApiObject
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* ```typescript
|
|
76
|
-
* gcpResources.addWorkloadIdentityServiceAccount({
|
|
77
|
-
* name: 'workload-identity-sa',
|
|
78
|
-
* googleServiceAccount: 'my-gsa@my-project.iam.gserviceaccount.com',
|
|
79
|
-
* namespace: 'default'
|
|
80
|
-
* });
|
|
81
|
-
* ```
|
|
82
|
-
*
|
|
83
|
-
* @since 2.4.0
|
|
84
|
-
*/
|
|
85
|
-
addWorkloadIdentityServiceAccount(spec: GCPWorkloadIdentityServiceAccountSpec): ApiObject;
|
|
86
|
-
/**
|
|
87
|
-
* Creates a ServiceAccount with GCP Artifact Registry access
|
|
88
|
-
* @param spec - Artifact Registry ServiceAccount specification
|
|
89
|
-
* @returns Created ServiceAccount ApiObject
|
|
90
|
-
*
|
|
91
|
-
* @example
|
|
92
|
-
* ```typescript
|
|
93
|
-
* gcpResources.addArtifactRegistryServiceAccount({
|
|
94
|
-
* name: 'artifact-registry-sa',
|
|
95
|
-
* googleServiceAccount: 'my-gsa@project.iam.gserviceaccount.com'
|
|
96
|
-
* });
|
|
97
|
-
* ```
|
|
98
|
-
*
|
|
99
|
-
* @since 2.7.0
|
|
100
|
-
*/
|
|
101
|
-
addArtifactRegistryServiceAccount(spec: GCPArtifactRegistryServiceAccountSpec): ApiObject;
|
|
102
|
-
}
|
|
103
|
-
export interface GCPPersistentDiskStorageClassSpec {
|
|
104
|
-
name: string;
|
|
105
|
-
type?: 'pd-standard' | 'pd-ssd' | 'pd-balanced';
|
|
106
|
-
replicationType?: 'none' | 'regional-pd';
|
|
107
|
-
fsType?: string;
|
|
108
|
-
reclaimPolicy?: 'Delete' | 'Retain';
|
|
109
|
-
allowVolumeExpansion?: boolean;
|
|
110
|
-
volumeBindingMode?: 'Immediate' | 'WaitForFirstConsumer';
|
|
111
|
-
labels?: Record<string, string>;
|
|
112
|
-
annotations?: Record<string, string>;
|
|
113
|
-
}
|
|
114
|
-
export interface GCPFilestoreStorageClassSpec {
|
|
115
|
-
name: string;
|
|
116
|
-
tier?: 'standard' | 'premium' | 'basic-hdd' | 'basic-ssd';
|
|
117
|
-
network?: string;
|
|
118
|
-
location?: string;
|
|
119
|
-
reclaimPolicy?: 'Delete' | 'Retain';
|
|
120
|
-
allowVolumeExpansion?: boolean;
|
|
121
|
-
volumeBindingMode?: 'Immediate' | 'WaitForFirstConsumer';
|
|
122
|
-
labels?: Record<string, string>;
|
|
123
|
-
annotations?: Record<string, string>;
|
|
124
|
-
}
|
|
125
|
-
export interface GCPGCEIngressSpec {
|
|
126
|
-
name: string;
|
|
127
|
-
host: string;
|
|
128
|
-
serviceName: string;
|
|
129
|
-
servicePort: number;
|
|
130
|
-
path?: string;
|
|
131
|
-
staticIPName?: string;
|
|
132
|
-
managedCertificate?: string;
|
|
133
|
-
sslRedirect?: boolean;
|
|
134
|
-
backendConfig?: Record<string, unknown>;
|
|
135
|
-
tls?: Array<{
|
|
136
|
-
hosts: string[];
|
|
137
|
-
secretName: string;
|
|
138
|
-
}>;
|
|
139
|
-
labels?: Record<string, string>;
|
|
140
|
-
annotations?: Record<string, string>;
|
|
141
|
-
}
|
|
142
|
-
export interface GCPWorkloadIdentityServiceAccountSpec {
|
|
143
|
-
name: string;
|
|
144
|
-
googleServiceAccount: string;
|
|
145
|
-
namespace?: string;
|
|
146
|
-
labels?: Record<string, string>;
|
|
147
|
-
annotations?: Record<string, string>;
|
|
148
|
-
}
|
|
149
|
-
export type GCPArtifactRegistryServiceAccountSpec = {
|
|
150
|
-
name: string;
|
|
151
|
-
automountServiceAccountToken?: boolean;
|
|
152
|
-
imagePullSecrets?: Array<{
|
|
153
|
-
name: string;
|
|
154
|
-
}>;
|
|
155
|
-
labels?: Record<string, string>;
|
|
156
|
-
annotations?: Record<string, string>;
|
|
157
|
-
} & ({
|
|
158
|
-
/** @deprecated Use gcpServiceAccount instead */ googleServiceAccount: string;
|
|
159
|
-
gcpServiceAccount?: never;
|
|
160
|
-
} | {
|
|
161
|
-
gcpServiceAccount: string;
|
|
162
|
-
googleServiceAccount?: never;
|
|
163
|
-
});
|
|
164
|
-
//# sourceMappingURL=gcpResources.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gcpResources.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/resources/cloud/gcp/gcpResources.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE;;;;;GAKG;AACH,qBAAa,YAAa,SAAQ,oBAAoB;IACpD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CAAuB;IAClE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAQ;IAChD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,sBAAsB,CAA0B;IAExE;;;;;;;;;;;;;;;;OAgBG;IACH,6BAA6B,CAAC,IAAI,EAAE,iCAAiC,GAAG,SAAS;IAyBjF;;;;;;;;;;;;;;;;OAgBG;IACH,wBAAwB,CAAC,IAAI,EAAE,4BAA4B,GAAG,SAAS;IAyBvE;;;;;;;;;;;;;;;;;;OAkBG;IACH,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS;IAqDjD;;;;;;;;;;;;;;;OAeG;IACH,iCAAiC,CAAC,IAAI,EAAE,qCAAqC,GAAG,SAAS;IAkBzF;;;;;;;;;;;;;;OAcG;IACH,iCAAiC,CAAC,IAAI,EAAE,qCAAqC,GAAG,SAAS;CA4B1F;AAGD,MAAM,WAAW,iCAAiC;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,aAAa,GAAG,QAAQ,GAAG,aAAa,CAAC;IAChD,eAAe,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IA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,CAAC;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,qCAAqC;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB,EAAE,MAAM,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC;AAED,MAAM,MAAM,qCAAqC,GAAG;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,gBAAgB,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC,GAAG,CACA;IACE,gDAAgD,CAAC,oBAAoB,EAAE,MAAM,CAAC;IAC9E,iBAAiB,CAAC,EAAE,KAAK,CAAC;CAC3B,GACD;IAAE,iBAAiB,EAAE,MAAM,CAAC;IAAC,oBAAoB,CAAC,EAAE,KAAK,CAAA;CAAE,CAC9D,CAAC"}
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import { BaseResourceProvider } from '../../baseResourceProvider.js';
|
|
2
|
-
/**
|
|
3
|
-
* GCP-specific Kubernetes resources provider
|
|
4
|
-
* Handles GCP integrations like Persistent Disk, Filestore, GCE Ingress, Workload Identity, and other GCP services
|
|
5
|
-
*
|
|
6
|
-
* @since 2.4.0
|
|
7
|
-
*/
|
|
8
|
-
export class GCPResources extends BaseResourceProvider {
|
|
9
|
-
/**
|
|
10
|
-
* Creates a GCP Persistent Disk StorageClass
|
|
11
|
-
* @param spec - GCP PD StorageClass specification
|
|
12
|
-
* @returns Created StorageClass ApiObject
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```typescript
|
|
16
|
-
* gcpResources.addPersistentDiskStorageClass({
|
|
17
|
-
* name: 'fast-ssd',
|
|
18
|
-
* type: 'pd-ssd',
|
|
19
|
-
* replicationType: 'regional-pd',
|
|
20
|
-
* allowVolumeExpansion: true
|
|
21
|
-
* });
|
|
22
|
-
* ```
|
|
23
|
-
*
|
|
24
|
-
* @since 2.4.0
|
|
25
|
-
*/
|
|
26
|
-
addPersistentDiskStorageClass(spec) {
|
|
27
|
-
const parameters = {
|
|
28
|
-
type: spec.type ?? 'pd-standard',
|
|
29
|
-
...(spec.replicationType ? { 'replication-type': spec.replicationType } : {}),
|
|
30
|
-
...(spec.fsType ? { fstype: spec.fsType } : {}),
|
|
31
|
-
};
|
|
32
|
-
const fields = {
|
|
33
|
-
provisioner: 'pd.csi.storage.gke.io',
|
|
34
|
-
parameters,
|
|
35
|
-
reclaimPolicy: spec.reclaimPolicy ?? 'Delete',
|
|
36
|
-
allowVolumeExpansion: spec.allowVolumeExpansion ?? true,
|
|
37
|
-
volumeBindingMode: spec.volumeBindingMode ?? 'WaitForFirstConsumer',
|
|
38
|
-
};
|
|
39
|
-
return this.createRootLevelApiObject(spec.name, GCPResources.STORAGE_API_VERSION, 'StorageClass', fields, spec.labels, spec.annotations);
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Creates a GCP Filestore StorageClass
|
|
43
|
-
* @param spec - GCP Filestore StorageClass specification
|
|
44
|
-
* @returns Created StorageClass ApiObject
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* ```typescript
|
|
48
|
-
* gcpResources.addFilestoreStorageClass({
|
|
49
|
-
* name: 'filestore-premium',
|
|
50
|
-
* tier: 'premium',
|
|
51
|
-
* network: 'default',
|
|
52
|
-
* allowVolumeExpansion: true
|
|
53
|
-
* });
|
|
54
|
-
* ```
|
|
55
|
-
*
|
|
56
|
-
* @since 2.4.0
|
|
57
|
-
*/
|
|
58
|
-
addFilestoreStorageClass(spec) {
|
|
59
|
-
const parameters = {
|
|
60
|
-
tier: spec.tier ?? 'standard',
|
|
61
|
-
network: spec.network ?? 'default',
|
|
62
|
-
...(spec.location ? { location: spec.location } : {}),
|
|
63
|
-
};
|
|
64
|
-
const fields = {
|
|
65
|
-
provisioner: 'filestore.csi.storage.gke.io',
|
|
66
|
-
parameters,
|
|
67
|
-
reclaimPolicy: spec.reclaimPolicy ?? 'Delete',
|
|
68
|
-
allowVolumeExpansion: spec.allowVolumeExpansion ?? true,
|
|
69
|
-
volumeBindingMode: spec.volumeBindingMode ?? 'Immediate',
|
|
70
|
-
};
|
|
71
|
-
return this.createRootLevelApiObject(spec.name, GCPResources.STORAGE_API_VERSION, 'StorageClass', fields, spec.labels, spec.annotations);
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Creates a GCE Ingress with Google Cloud Load Balancer
|
|
75
|
-
* @param spec - GCE Ingress specification
|
|
76
|
-
* @returns Created Ingress ApiObject
|
|
77
|
-
*
|
|
78
|
-
* @example
|
|
79
|
-
* ```typescript
|
|
80
|
-
* gcpResources.addGCEIngress({
|
|
81
|
-
* name: 'gce-ingress',
|
|
82
|
-
* host: 'myapp.example.com',
|
|
83
|
-
* serviceName: 'my-service',
|
|
84
|
-
* servicePort: 80,
|
|
85
|
-
* staticIPName: 'my-static-ip',
|
|
86
|
-
* managedCertificate: 'my-ssl-cert'
|
|
87
|
-
* });
|
|
88
|
-
* ```
|
|
89
|
-
*
|
|
90
|
-
* @since 2.4.0
|
|
91
|
-
*/
|
|
92
|
-
addGCEIngress(spec) {
|
|
93
|
-
const annotations = {
|
|
94
|
-
'kubernetes.io/ingress.class': 'gce',
|
|
95
|
-
...(spec.staticIPName
|
|
96
|
-
? { 'kubernetes.io/ingress.global-static-ip-name': spec.staticIPName }
|
|
97
|
-
: {}),
|
|
98
|
-
...(spec.managedCertificate
|
|
99
|
-
? { 'networking.gke.io/managed-certificates': spec.managedCertificate }
|
|
100
|
-
: {}),
|
|
101
|
-
...(spec.sslRedirect !== undefined
|
|
102
|
-
? { 'ingress.gcp.kubernetes.io/force-ssl-redirect': String(spec.sslRedirect) }
|
|
103
|
-
: {}),
|
|
104
|
-
...(spec.backendConfig
|
|
105
|
-
? { 'cloud.google.com/backend-config': JSON.stringify(spec.backendConfig) }
|
|
106
|
-
: {}),
|
|
107
|
-
...(spec.annotations || {}),
|
|
108
|
-
};
|
|
109
|
-
const rules = [
|
|
110
|
-
{
|
|
111
|
-
host: spec.host,
|
|
112
|
-
http: {
|
|
113
|
-
paths: [
|
|
114
|
-
{
|
|
115
|
-
path: spec.path ?? '/*',
|
|
116
|
-
pathType: 'ImplementationSpecific',
|
|
117
|
-
backend: {
|
|
118
|
-
service: {
|
|
119
|
-
name: spec.serviceName,
|
|
120
|
-
port: { number: spec.servicePort },
|
|
121
|
-
},
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
],
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
];
|
|
128
|
-
const ingressSpec = {
|
|
129
|
-
rules,
|
|
130
|
-
...(spec.tls ? { tls: spec.tls } : {}),
|
|
131
|
-
};
|
|
132
|
-
return this.createApiObject(spec.name, GCPResources.NETWORKING_API_VERSION, 'Ingress', ingressSpec, spec.labels, annotations);
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Creates a ServiceAccount with Workload Identity annotations
|
|
136
|
-
* @param spec - Workload Identity ServiceAccount specification
|
|
137
|
-
* @returns Created ServiceAccount ApiObject
|
|
138
|
-
*
|
|
139
|
-
* @example
|
|
140
|
-
* ```typescript
|
|
141
|
-
* gcpResources.addWorkloadIdentityServiceAccount({
|
|
142
|
-
* name: 'workload-identity-sa',
|
|
143
|
-
* googleServiceAccount: 'my-gsa@my-project.iam.gserviceaccount.com',
|
|
144
|
-
* namespace: 'default'
|
|
145
|
-
* });
|
|
146
|
-
* ```
|
|
147
|
-
*
|
|
148
|
-
* @since 2.4.0
|
|
149
|
-
*/
|
|
150
|
-
addWorkloadIdentityServiceAccount(spec) {
|
|
151
|
-
const annotations = {
|
|
152
|
-
'iam.gke.io/gcp-service-account': spec.googleServiceAccount,
|
|
153
|
-
...(spec.annotations || {}),
|
|
154
|
-
};
|
|
155
|
-
const serviceAccountSpec = {};
|
|
156
|
-
return this.createApiObject(spec.name, GCPResources.CORE_API_VERSION, 'ServiceAccount', serviceAccountSpec, spec.labels, annotations);
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Creates a ServiceAccount with GCP Artifact Registry access
|
|
160
|
-
* @param spec - Artifact Registry ServiceAccount specification
|
|
161
|
-
* @returns Created ServiceAccount ApiObject
|
|
162
|
-
*
|
|
163
|
-
* @example
|
|
164
|
-
* ```typescript
|
|
165
|
-
* gcpResources.addArtifactRegistryServiceAccount({
|
|
166
|
-
* name: 'artifact-registry-sa',
|
|
167
|
-
* googleServiceAccount: 'my-gsa@project.iam.gserviceaccount.com'
|
|
168
|
-
* });
|
|
169
|
-
* ```
|
|
170
|
-
*
|
|
171
|
-
* @since 2.7.0
|
|
172
|
-
*/
|
|
173
|
-
addArtifactRegistryServiceAccount(spec) {
|
|
174
|
-
const googleServiceAccount = 'googleServiceAccount' in spec ? spec.googleServiceAccount : spec.gcpServiceAccount;
|
|
175
|
-
const annotations = {
|
|
176
|
-
'iam.gke.io/gcp-service-account': googleServiceAccount,
|
|
177
|
-
...(spec.annotations || {}),
|
|
178
|
-
};
|
|
179
|
-
const serviceAccountSpec = {};
|
|
180
|
-
if (spec.automountServiceAccountToken !== undefined) {
|
|
181
|
-
serviceAccountSpec['automountServiceAccountToken'] = spec.automountServiceAccountToken;
|
|
182
|
-
}
|
|
183
|
-
if (spec.imagePullSecrets) {
|
|
184
|
-
serviceAccountSpec['imagePullSecrets'] = spec.imagePullSecrets;
|
|
185
|
-
}
|
|
186
|
-
return this.createApiObject(spec.name, GCPResources.CORE_API_VERSION, 'ServiceAccount', serviceAccountSpec, spec.labels, annotations);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
GCPResources.STORAGE_API_VERSION = 'storage.k8s.io/v1';
|
|
190
|
-
GCPResources.CORE_API_VERSION = 'v1';
|
|
191
|
-
GCPResources.NETWORKING_API_VERSION = 'networking.k8s.io/v1';
|
|
192
|
-
//# sourceMappingURL=gcpResources.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gcpResources.js","sourceRoot":"","sources":["../../../../../../src/lib/resources/cloud/gcp/gcpResources.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE;;;;;GAKG;AACH,MAAM,OAAO,YAAa,SAAQ,oBAAoB;IAKpD;;;;;;;;;;;;;;;;OAgBG;IACH,6BAA6B,CAAC,IAAuC;QACnE,MAAM,UAAU,GAA2B;YACzC,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,aAAa;YAChC,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7E,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAChD,CAAC;QAEF,MAAM,MAAM,GAAG;YACb,WAAW,EAAE,uBAAuB;YACpC,UAAU;YACV,aAAa,EAAE,IAAI,CAAC,aAAa,IAAI,QAAQ;YAC7C,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,IAAI,IAAI;YACvD,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,IAAI,sBAAsB;SACpE,CAAC;QAEF,OAAO,IAAI,CAAC,wBAAwB,CAClC,IAAI,CAAC,IAAI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