codify-plugin-lib 1.0.37 → 1.0.39
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/dist/entities/change-set.d.ts +17 -9
- package/dist/entities/change-set.js +91 -36
- package/dist/entities/plan-types.d.ts +11 -0
- package/dist/entities/plan-types.js +1 -0
- package/dist/entities/plan.d.ts +10 -7
- package/dist/entities/plan.js +53 -8
- package/dist/entities/plugin.js +9 -8
- package/dist/entities/resource-types.d.ts +24 -0
- package/dist/entities/resource-types.js +1 -0
- package/dist/entities/resource.d.ts +20 -15
- package/dist/entities/resource.js +137 -62
- package/dist/entities/stateful-parameter.d.ts +22 -8
- package/dist/entities/stateful-parameter.js +33 -0
- package/dist/entities/test.d.ts +1 -0
- package/dist/entities/test.js +22 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -0
- package/dist/utils/common-types.d.ts +3 -0
- package/dist/utils/common-types.js +1 -0
- package/dist/utils/utils.d.ts +6 -0
- package/dist/utils/utils.js +15 -0
- package/package.json +2 -2
- package/src/entities/change-set.test.ts +24 -36
- package/src/entities/change-set.ts +138 -47
- package/src/entities/plan-types.ts +26 -0
- package/src/entities/plan.ts +87 -16
- package/src/entities/plugin.ts +11 -9
- package/src/entities/resource-parameters.test.ts +159 -0
- package/src/entities/resource-types.ts +47 -0
- package/src/entities/resource.test.ts +77 -215
- package/src/entities/resource.ts +203 -91
- package/src/entities/stateful-parameter.ts +56 -8
- package/src/index.ts +3 -0
- package/src/utils/utils.ts +21 -0
|
@@ -1,16 +1,24 @@
|
|
|
1
|
-
import { ParameterOperation,
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { ParameterOperation, ResourceOperation, StringIndexedObject } from 'codify-schemas';
|
|
2
|
+
import { ParameterConfiguration } from './plan-types.js';
|
|
3
|
+
export interface ParameterChange<T extends StringIndexedObject> {
|
|
4
|
+
name: keyof T & string;
|
|
4
5
|
operation: ParameterOperation;
|
|
5
6
|
previousValue: any | null;
|
|
6
7
|
newValue: any | null;
|
|
7
8
|
}
|
|
8
|
-
export declare class ChangeSet {
|
|
9
|
+
export declare class ChangeSet<T extends StringIndexedObject> {
|
|
9
10
|
operation: ResourceOperation;
|
|
10
|
-
parameterChanges: Array<ParameterChange
|
|
11
|
-
constructor(operation: ResourceOperation, parameterChanges: Array<ParameterChange
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
parameterChanges: Array<ParameterChange<T>>;
|
|
12
|
+
constructor(operation: ResourceOperation, parameterChanges: Array<ParameterChange<T>>);
|
|
13
|
+
get desiredParameters(): T;
|
|
14
|
+
get currentParameters(): T;
|
|
15
|
+
static newCreate<T extends {}>(desiredConfig: T): ChangeSet<StringIndexedObject>;
|
|
16
|
+
static calculateParameterChangeSet<T extends StringIndexedObject>(desired: T | null, current: T | null, options: {
|
|
17
|
+
statefulMode: boolean;
|
|
18
|
+
parameterConfigurations?: Record<keyof T, ParameterConfiguration>;
|
|
19
|
+
}): ParameterChange<T>[];
|
|
14
20
|
static combineResourceOperations(prev: ResourceOperation, next: ResourceOperation): ResourceOperation;
|
|
15
|
-
static isSame(a: unknown, b: unknown): boolean;
|
|
21
|
+
static isSame(a: unknown, b: unknown, isEqual?: (a: unknown, b: unknown) => boolean): boolean;
|
|
22
|
+
private static calculateStatefulModeChangeSet;
|
|
23
|
+
private static calculateStatelessModeChangeSet;
|
|
16
24
|
}
|
|
@@ -6,7 +6,21 @@ export class ChangeSet {
|
|
|
6
6
|
this.operation = operation;
|
|
7
7
|
this.parameterChanges = parameterChanges;
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
get desiredParameters() {
|
|
10
|
+
return this.parameterChanges
|
|
11
|
+
.reduce((obj, pc) => ({
|
|
12
|
+
...obj,
|
|
13
|
+
[pc.name]: pc.newValue,
|
|
14
|
+
}), {});
|
|
15
|
+
}
|
|
16
|
+
get currentParameters() {
|
|
17
|
+
return this.parameterChanges
|
|
18
|
+
.reduce((obj, pc) => ({
|
|
19
|
+
...obj,
|
|
20
|
+
[pc.name]: pc.previousValue,
|
|
21
|
+
}), {});
|
|
22
|
+
}
|
|
23
|
+
static newCreate(desiredConfig) {
|
|
10
24
|
const parameterChangeSet = Object.entries(desiredConfig)
|
|
11
25
|
.filter(([k,]) => k !== 'type' && k !== 'name')
|
|
12
26
|
.map(([k, v]) => {
|
|
@@ -19,47 +33,76 @@ export class ChangeSet {
|
|
|
19
33
|
});
|
|
20
34
|
return new ChangeSet(ResourceOperation.CREATE, parameterChangeSet);
|
|
21
35
|
}
|
|
22
|
-
static calculateParameterChangeSet(
|
|
36
|
+
static calculateParameterChangeSet(desired, current, options) {
|
|
37
|
+
if (options.statefulMode) {
|
|
38
|
+
return ChangeSet.calculateStatefulModeChangeSet(desired, current, options.parameterConfigurations);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
return ChangeSet.calculateStatelessModeChangeSet(desired, current, options.parameterConfigurations);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
static combineResourceOperations(prev, next) {
|
|
45
|
+
const orderOfOperations = [
|
|
46
|
+
ResourceOperation.NOOP,
|
|
47
|
+
ResourceOperation.MODIFY,
|
|
48
|
+
ResourceOperation.RECREATE,
|
|
49
|
+
ResourceOperation.CREATE,
|
|
50
|
+
ResourceOperation.DESTROY,
|
|
51
|
+
];
|
|
52
|
+
const indexPrev = orderOfOperations.indexOf(prev);
|
|
53
|
+
const indexNext = orderOfOperations.indexOf(next);
|
|
54
|
+
return orderOfOperations[Math.max(indexPrev, indexNext)];
|
|
55
|
+
}
|
|
56
|
+
static isSame(a, b, isEqual) {
|
|
57
|
+
if (isEqual) {
|
|
58
|
+
return isEqual(a, b);
|
|
59
|
+
}
|
|
60
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
|
61
|
+
const sortedPrev = a.map((x) => x).sort();
|
|
62
|
+
const sortedNext = b.map((x) => x).sort();
|
|
63
|
+
return JSON.stringify(sortedPrev) === JSON.stringify(sortedNext);
|
|
64
|
+
}
|
|
65
|
+
return a === b;
|
|
66
|
+
}
|
|
67
|
+
static calculateStatefulModeChangeSet(desired, current, parameterConfigurations) {
|
|
23
68
|
const parameterChangeSet = new Array();
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
for (const [k, v] of Object.entries(filteredPrev)) {
|
|
29
|
-
if (!filteredNext[k]) {
|
|
69
|
+
const _desired = { ...desired };
|
|
70
|
+
const _current = { ...current };
|
|
71
|
+
for (const [k, v] of Object.entries(_current)) {
|
|
72
|
+
if (_desired[k] == null) {
|
|
30
73
|
parameterChangeSet.push({
|
|
31
74
|
name: k,
|
|
32
75
|
previousValue: v,
|
|
33
76
|
newValue: null,
|
|
34
77
|
operation: ParameterOperation.REMOVE,
|
|
35
78
|
});
|
|
36
|
-
delete
|
|
79
|
+
delete _current[k];
|
|
37
80
|
continue;
|
|
38
81
|
}
|
|
39
|
-
if (!ChangeSet.isSame(
|
|
82
|
+
if (!ChangeSet.isSame(_current[k], _desired[k], parameterConfigurations?.[k]?.isEqual)) {
|
|
40
83
|
parameterChangeSet.push({
|
|
41
84
|
name: k,
|
|
42
85
|
previousValue: v,
|
|
43
|
-
newValue:
|
|
86
|
+
newValue: _desired[k],
|
|
44
87
|
operation: ParameterOperation.MODIFY,
|
|
45
88
|
});
|
|
46
|
-
delete
|
|
47
|
-
delete
|
|
89
|
+
delete _current[k];
|
|
90
|
+
delete _desired[k];
|
|
48
91
|
continue;
|
|
49
92
|
}
|
|
50
93
|
parameterChangeSet.push({
|
|
51
94
|
name: k,
|
|
52
95
|
previousValue: v,
|
|
53
|
-
newValue:
|
|
96
|
+
newValue: _desired[k],
|
|
54
97
|
operation: ParameterOperation.NOOP,
|
|
55
98
|
});
|
|
56
|
-
delete
|
|
57
|
-
delete
|
|
99
|
+
delete _current[k];
|
|
100
|
+
delete _desired[k];
|
|
58
101
|
}
|
|
59
|
-
if (Object.keys(
|
|
102
|
+
if (Object.keys(_current).length !== 0) {
|
|
60
103
|
throw Error('Diff algorithm error');
|
|
61
104
|
}
|
|
62
|
-
for (const [k, v] of Object.entries(
|
|
105
|
+
for (const [k, v] of Object.entries(_desired)) {
|
|
63
106
|
parameterChangeSet.push({
|
|
64
107
|
name: k,
|
|
65
108
|
previousValue: null,
|
|
@@ -69,24 +112,36 @@ export class ChangeSet {
|
|
|
69
112
|
}
|
|
70
113
|
return parameterChangeSet;
|
|
71
114
|
}
|
|
72
|
-
static
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
115
|
+
static calculateStatelessModeChangeSet(desired, current, parameterConfigurations) {
|
|
116
|
+
const parameterChangeSet = new Array();
|
|
117
|
+
const _desired = { ...desired };
|
|
118
|
+
const _current = { ...current };
|
|
119
|
+
for (const [k, v] of Object.entries(_desired)) {
|
|
120
|
+
if (_current[k] == null) {
|
|
121
|
+
parameterChangeSet.push({
|
|
122
|
+
name: k,
|
|
123
|
+
previousValue: null,
|
|
124
|
+
newValue: v,
|
|
125
|
+
operation: ParameterOperation.ADD,
|
|
126
|
+
});
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
if (!ChangeSet.isSame(_current[k], _desired[k], parameterConfigurations?.[k]?.isEqual)) {
|
|
130
|
+
parameterChangeSet.push({
|
|
131
|
+
name: k,
|
|
132
|
+
previousValue: _current[k],
|
|
133
|
+
newValue: _desired[k],
|
|
134
|
+
operation: ParameterOperation.MODIFY,
|
|
135
|
+
});
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
parameterChangeSet.push({
|
|
139
|
+
name: k,
|
|
140
|
+
previousValue: v,
|
|
141
|
+
newValue: v,
|
|
142
|
+
operation: ParameterOperation.NOOP,
|
|
143
|
+
});
|
|
89
144
|
}
|
|
90
|
-
return
|
|
145
|
+
return parameterChangeSet;
|
|
91
146
|
}
|
|
92
147
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ResourceOperation } from 'codify-schemas';
|
|
2
|
+
export interface ParameterConfiguration {
|
|
3
|
+
planOperation?: ResourceOperation.MODIFY | ResourceOperation.RECREATE;
|
|
4
|
+
isEqual?: (a: any, b: any) => boolean;
|
|
5
|
+
isArrayElementEqual?: (a: any, b: any) => boolean;
|
|
6
|
+
isStatefulParameter?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface PlanConfiguration<T> {
|
|
9
|
+
statefulMode: boolean;
|
|
10
|
+
parameterConfigurations?: Record<keyof T, ParameterConfiguration>;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/entities/plan.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { ChangeSet } from './change-set.js';
|
|
2
|
-
import { ApplyRequestData, PlanResponseData, ResourceConfig } from 'codify-schemas';
|
|
3
|
-
|
|
2
|
+
import { ApplyRequestData, PlanResponseData, ResourceConfig, StringIndexedObject } from 'codify-schemas';
|
|
3
|
+
import { PlanConfiguration } from './plan-types.js';
|
|
4
|
+
export declare class Plan<T extends StringIndexedObject> {
|
|
4
5
|
id: string;
|
|
5
|
-
changeSet: ChangeSet
|
|
6
|
-
|
|
7
|
-
constructor(id: string, changeSet: ChangeSet
|
|
8
|
-
static create<T extends
|
|
6
|
+
changeSet: ChangeSet<T>;
|
|
7
|
+
resourceMetadata: ResourceConfig;
|
|
8
|
+
constructor(id: string, changeSet: ChangeSet<T>, resourceMetadata: ResourceConfig);
|
|
9
|
+
static create<T extends StringIndexedObject>(desiredConfig: Partial<T> & ResourceConfig, currentConfig: Partial<T> & ResourceConfig | null, configuration: PlanConfiguration<T>): Plan<T>;
|
|
9
10
|
getResourceType(): string;
|
|
10
|
-
static fromResponse(data: ApplyRequestData['plan']): Plan<
|
|
11
|
+
static fromResponse<T extends ResourceConfig>(data: ApplyRequestData['plan']): Plan<T>;
|
|
12
|
+
get desiredConfig(): T;
|
|
13
|
+
get currentConfig(): T;
|
|
11
14
|
toResponse(): PlanResponseData;
|
|
12
15
|
}
|
package/dist/entities/plan.js
CHANGED
|
@@ -1,19 +1,52 @@
|
|
|
1
1
|
import { ChangeSet } from './change-set.js';
|
|
2
|
+
import { ParameterOperation, ResourceOperation, } from 'codify-schemas';
|
|
2
3
|
import { randomUUID } from 'crypto';
|
|
4
|
+
import { splitUserConfig } from '../utils/utils.js';
|
|
3
5
|
export class Plan {
|
|
4
6
|
id;
|
|
5
7
|
changeSet;
|
|
6
|
-
|
|
7
|
-
constructor(id, changeSet,
|
|
8
|
+
resourceMetadata;
|
|
9
|
+
constructor(id, changeSet, resourceMetadata) {
|
|
8
10
|
this.id = id;
|
|
9
11
|
this.changeSet = changeSet;
|
|
10
|
-
this.
|
|
12
|
+
this.resourceMetadata = resourceMetadata;
|
|
11
13
|
}
|
|
12
|
-
static create(
|
|
13
|
-
|
|
14
|
+
static create(desiredConfig, currentConfig, configuration) {
|
|
15
|
+
const parameterConfigurations = configuration.parameterConfigurations ?? {};
|
|
16
|
+
const statefulParameterNames = new Set([...Object.entries(parameterConfigurations)]
|
|
17
|
+
.filter(([k, v]) => v.isStatefulParameter)
|
|
18
|
+
.map(([k, v]) => k));
|
|
19
|
+
const { resourceMetadata, parameters: desiredParameters } = splitUserConfig(desiredConfig);
|
|
20
|
+
const { parameters: currentParameters } = currentConfig != null ? splitUserConfig(currentConfig) : { parameters: null };
|
|
21
|
+
const parameterChangeSet = ChangeSet.calculateParameterChangeSet(desiredParameters, currentParameters, { statefulMode: configuration.statefulMode, parameterConfigurations });
|
|
22
|
+
let resourceOperation;
|
|
23
|
+
if (!currentConfig && desiredConfig) {
|
|
24
|
+
resourceOperation = ResourceOperation.CREATE;
|
|
25
|
+
}
|
|
26
|
+
else if (currentConfig && !desiredConfig) {
|
|
27
|
+
resourceOperation = ResourceOperation.DESTROY;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
resourceOperation = parameterChangeSet
|
|
31
|
+
.filter((change) => change.operation !== ParameterOperation.NOOP)
|
|
32
|
+
.reduce((operation, curr) => {
|
|
33
|
+
let newOperation;
|
|
34
|
+
if (statefulParameterNames.has(curr.name)) {
|
|
35
|
+
newOperation = ResourceOperation.MODIFY;
|
|
36
|
+
}
|
|
37
|
+
else if (parameterConfigurations[curr.name]?.planOperation) {
|
|
38
|
+
newOperation = parameterConfigurations[curr.name].planOperation;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
newOperation = ResourceOperation.RECREATE;
|
|
42
|
+
}
|
|
43
|
+
return ChangeSet.combineResourceOperations(operation, newOperation);
|
|
44
|
+
}, ResourceOperation.NOOP);
|
|
45
|
+
}
|
|
46
|
+
return new Plan(randomUUID(), new ChangeSet(resourceOperation, parameterChangeSet), resourceMetadata);
|
|
14
47
|
}
|
|
15
48
|
getResourceType() {
|
|
16
|
-
return this.
|
|
49
|
+
return this.resourceMetadata.type;
|
|
17
50
|
}
|
|
18
51
|
static fromResponse(data) {
|
|
19
52
|
if (!data) {
|
|
@@ -28,12 +61,24 @@ export class Plan {
|
|
|
28
61
|
...(data.parameters.reduce((prev, { name, newValue }) => Object.assign(prev, { [name]: newValue }), {}))
|
|
29
62
|
});
|
|
30
63
|
}
|
|
64
|
+
get desiredConfig() {
|
|
65
|
+
return {
|
|
66
|
+
...this.resourceMetadata,
|
|
67
|
+
...this.changeSet.desiredParameters,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
get currentConfig() {
|
|
71
|
+
return {
|
|
72
|
+
...this.resourceMetadata,
|
|
73
|
+
...this.changeSet.currentParameters,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
31
76
|
toResponse() {
|
|
32
77
|
return {
|
|
33
78
|
planId: this.id,
|
|
34
79
|
operation: this.changeSet.operation,
|
|
35
|
-
resourceName: this.
|
|
36
|
-
resourceType: this.
|
|
80
|
+
resourceName: this.resourceMetadata.name,
|
|
81
|
+
resourceType: this.resourceMetadata.type,
|
|
37
82
|
parameters: this.changeSet.parameterChanges,
|
|
38
83
|
};
|
|
39
84
|
}
|
package/dist/entities/plugin.js
CHANGED
|
@@ -13,26 +13,27 @@ export class Plugin {
|
|
|
13
13
|
return {
|
|
14
14
|
resourceDefinitions: [...this.resources.values()]
|
|
15
15
|
.map((r) => ({
|
|
16
|
-
type: r.
|
|
16
|
+
type: r.typeId,
|
|
17
17
|
dependencies: r.getDependencyTypeIds(),
|
|
18
18
|
}))
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
async validate(data) {
|
|
22
|
-
const
|
|
22
|
+
const validationResults = [];
|
|
23
23
|
for (const config of data.configs) {
|
|
24
24
|
if (!this.resources.has(config.type)) {
|
|
25
25
|
throw new Error(`Resource type not found: ${config.type}`);
|
|
26
26
|
}
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
const validateResult = await this.resources.get(config.type).validate(config);
|
|
28
|
+
validationResults.push({
|
|
29
|
+
...validateResult,
|
|
30
|
+
resourceType: config.type,
|
|
31
|
+
resourceName: config.name,
|
|
32
|
+
});
|
|
31
33
|
}
|
|
32
34
|
await this.crossValidateResources(data.configs);
|
|
33
35
|
return {
|
|
34
|
-
|
|
35
|
-
errors: totalErrors,
|
|
36
|
+
validationResults
|
|
36
37
|
};
|
|
37
38
|
}
|
|
38
39
|
async plan(data) {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { StatefulParameter } from './stateful-parameter.js';
|
|
2
|
+
import { ResourceOperation, StringIndexedObject } from 'codify-schemas';
|
|
3
|
+
import { Resource } from './resource.js';
|
|
4
|
+
export type ErrorMessage = string;
|
|
5
|
+
export interface ResourceParameterConfiguration {
|
|
6
|
+
planOperation?: ResourceOperation.MODIFY | ResourceOperation.RECREATE;
|
|
7
|
+
isEqual?: (a: any, b: any) => boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface ResourceConfiguration<T extends StringIndexedObject> {
|
|
10
|
+
type: string;
|
|
11
|
+
callStatefulParameterRemoveOnDestroy?: boolean;
|
|
12
|
+
dependencies?: Resource<any>[];
|
|
13
|
+
statefulParameters?: Array<StatefulParameter<T, T[keyof T]>>;
|
|
14
|
+
parameterConfigurations?: Partial<Record<keyof T, ResourceParameterConfiguration>>;
|
|
15
|
+
}
|
|
16
|
+
export interface ResourceDefinition {
|
|
17
|
+
[x: string]: {
|
|
18
|
+
type: string;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export interface ValidationResult {
|
|
22
|
+
isValid: boolean;
|
|
23
|
+
errors?: unknown[];
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,23 +1,28 @@
|
|
|
1
|
-
import { ResourceConfig,
|
|
2
|
-
import { ParameterChange } from './change-set.js';
|
|
1
|
+
import { ResourceConfig, StringIndexedObject } from 'codify-schemas';
|
|
3
2
|
import { Plan } from './plan.js';
|
|
4
3
|
import { StatefulParameter } from './stateful-parameter.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
import { ResourceConfiguration, ValidationResult } from './resource-types.js';
|
|
5
|
+
import { ParameterConfiguration } from './plan-types.js';
|
|
6
|
+
export declare abstract class Resource<T extends StringIndexedObject> {
|
|
7
|
+
readonly typeId: string;
|
|
8
|
+
readonly statefulParameters: Map<keyof T, StatefulParameter<T, T[keyof T]>>;
|
|
9
|
+
readonly dependencies: Resource<any>[];
|
|
10
|
+
readonly parameterConfigurations: Record<keyof T, ParameterConfiguration>;
|
|
11
|
+
private readonly options;
|
|
12
|
+
protected constructor(configuration: ResourceConfiguration<T>);
|
|
11
13
|
getDependencyTypeIds(): string[];
|
|
12
14
|
onInitialize(): Promise<void>;
|
|
13
|
-
plan(desiredConfig: T): Promise<Plan<T>>;
|
|
15
|
+
plan(desiredConfig: Partial<T> & ResourceConfig): Promise<Plan<T>>;
|
|
14
16
|
apply(plan: Plan<T>): Promise<void>;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
private _applyCreate;
|
|
18
|
+
private _applyModify;
|
|
19
|
+
private _applyDestroy;
|
|
20
|
+
private generateParameterConfigurations;
|
|
21
|
+
private validateResourceConfiguration;
|
|
22
|
+
private validateRefreshResults;
|
|
23
|
+
abstract validate(config: unknown): Promise<ValidationResult>;
|
|
24
|
+
abstract refresh(keys: Set<keyof T>): Promise<Partial<T> | null>;
|
|
19
25
|
abstract applyCreate(plan: Plan<T>): Promise<void>;
|
|
20
|
-
|
|
21
|
-
abstract applyRecreate(plan: Plan<T>): Promise<void>;
|
|
26
|
+
applyModify(parameterName: keyof T, newValue: unknown, previousValue: unknown, allowDeletes: boolean, plan: Plan<T>): Promise<void>;
|
|
22
27
|
abstract applyDestroy(plan: Plan<T>): Promise<void>;
|
|
23
28
|
}
|