codify-plugin-lib 1.0.160 → 1.0.162
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.
|
@@ -207,7 +207,7 @@ export class ResourceController {
|
|
|
207
207
|
const resultParametersArray = currentParametersArray
|
|
208
208
|
?.map((r, idx) => ({ ...r, ...statefulCurrentParameters[idx] }));
|
|
209
209
|
for (const result of resultParametersArray) {
|
|
210
|
-
await this.applyTransformParameters(result, { original:
|
|
210
|
+
await this.applyTransformParameters(result, { original: context.originalDesiredConfig });
|
|
211
211
|
this.removeDefaultValues(result, parameters);
|
|
212
212
|
}
|
|
213
213
|
return resultParametersArray?.map((r) => ({ core, parameters: r }));
|
|
@@ -281,7 +281,7 @@ ${JSON.stringify(refresh, null, 2)}
|
|
|
281
281
|
continue;
|
|
282
282
|
}
|
|
283
283
|
config[key] = reverse
|
|
284
|
-
? await inputTransformation.from(config[key], reverse.original)
|
|
284
|
+
? await inputTransformation.from(config[key], reverse.original?.[key])
|
|
285
285
|
: await inputTransformation.to(config[key]);
|
|
286
286
|
}
|
|
287
287
|
if (this.settings.transformation) {
|
package/package.json
CHANGED
|
@@ -298,13 +298,11 @@ export class ResourceController<T extends StringIndexedObject> {
|
|
|
298
298
|
?.map((r, idx) => ({ ...r, ...statefulCurrentParameters[idx] }))
|
|
299
299
|
|
|
300
300
|
for (const result of resultParametersArray) {
|
|
301
|
-
await this.applyTransformParameters(result, { original:
|
|
301
|
+
await this.applyTransformParameters(result, { original: context.originalDesiredConfig });
|
|
302
302
|
this.removeDefaultValues(result, parameters);
|
|
303
303
|
}
|
|
304
304
|
|
|
305
305
|
return resultParametersArray?.map((r) => ({ core, parameters: r }))
|
|
306
|
-
|
|
307
|
-
|
|
308
306
|
}
|
|
309
307
|
|
|
310
308
|
private async applyCreate(plan: Plan<T>): Promise<void> {
|
|
@@ -383,7 +381,7 @@ ${JSON.stringify(refresh, null, 2)}
|
|
|
383
381
|
}
|
|
384
382
|
}
|
|
385
383
|
|
|
386
|
-
private async applyTransformParameters(config: Partial<T> | null, reverse?: { original: Partial<T> }): Promise<void> {
|
|
384
|
+
private async applyTransformParameters(config: Partial<T> | null, reverse?: { original: Partial<T> | null }): Promise<void> {
|
|
387
385
|
if (!config) {
|
|
388
386
|
return;
|
|
389
387
|
}
|
|
@@ -394,7 +392,7 @@ ${JSON.stringify(refresh, null, 2)}
|
|
|
394
392
|
}
|
|
395
393
|
|
|
396
394
|
(config as Record<string, unknown>)[key] = reverse
|
|
397
|
-
? await inputTransformation.from(config[key], reverse.original)
|
|
395
|
+
? await inputTransformation.from(config[key], reverse.original?.[key])
|
|
398
396
|
: await inputTransformation.to(config[key]);
|
|
399
397
|
}
|
|
400
398
|
|
|
@@ -5,7 +5,6 @@ import path from 'node:path';
|
|
|
5
5
|
|
|
6
6
|
import { ArrayStatefulParameter, StatefulParameter } from '../stateful-parameter/stateful-parameter.js';
|
|
7
7
|
import { addVariablesToPath, areArraysEqual, resolvePathWithVariables, tildify, untildify } from '../utils/utils.js';
|
|
8
|
-
import { or } from 'ajv/dist/compile/codegen/index.js';
|
|
9
8
|
import { RefreshContext } from './resource.js';
|
|
10
9
|
|
|
11
10
|
export interface InputTransformation {
|