codify-plugin-lib 1.0.178 → 1.0.180
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 +24 -0
- package/dist/entities/change-set.js +152 -0
- package/dist/entities/errors.d.ts +4 -0
- package/dist/entities/errors.js +7 -0
- package/dist/entities/plan-types.d.ts +25 -0
- package/dist/entities/plan-types.js +1 -0
- package/dist/entities/plan.d.ts +15 -0
- package/dist/entities/plan.js +127 -0
- package/dist/entities/plugin.d.ts +16 -0
- package/dist/entities/plugin.js +80 -0
- package/dist/entities/resource-options.d.ts +31 -0
- package/dist/entities/resource-options.js +76 -0
- package/dist/entities/resource-types.d.ts +11 -0
- package/dist/entities/resource-types.js +1 -0
- package/dist/entities/resource.d.ts +42 -0
- package/dist/entities/resource.js +303 -0
- package/dist/entities/stateful-parameter.d.ts +29 -0
- package/dist/entities/stateful-parameter.js +46 -0
- package/dist/entities/transform-parameter.d.ts +4 -0
- package/dist/entities/transform-parameter.js +2 -0
- package/dist/plan/change-set.d.ts +8 -3
- package/dist/plan/change-set.js +10 -3
- package/dist/plan/plan.js +7 -4
- package/dist/plugin/plugin.d.ts +1 -1
- package/dist/plugin/plugin.js +27 -5
- package/dist/pty/vitest.config.d.ts +2 -0
- package/dist/pty/vitest.config.js +11 -0
- package/dist/resource/resource-settings.d.ts +11 -0
- package/dist/resource/stateful-parameter.d.ts +165 -0
- package/dist/resource/stateful-parameter.js +94 -0
- package/dist/utils/spawn-2.d.ts +5 -0
- package/dist/utils/spawn-2.js +7 -0
- package/dist/utils/spawn.d.ts +29 -0
- package/dist/utils/spawn.js +124 -0
- package/package.json +2 -2
- package/src/plan/change-set.test.ts +1 -1
- package/src/plan/change-set.ts +16 -3
- package/src/plan/plan.ts +7 -4
- package/src/plugin/plugin.ts +31 -5
- package/src/resource/resource-controller-stateful-mode.test.ts +15 -7
- package/src/resource/resource-controller.test.ts +4 -2
- package/src/resource/resource-settings.test.ts +2 -0
- package/src/resource/resource-settings.ts +14 -1
|
@@ -142,19 +142,23 @@ describe('Resource tests for stateful plans', () => {
|
|
|
142
142
|
name: "propA",
|
|
143
143
|
newValue: "propA",
|
|
144
144
|
previousValue: "propA",
|
|
145
|
-
operation: ParameterOperation.NOOP
|
|
145
|
+
operation: ParameterOperation.NOOP,
|
|
146
|
+
isSensitive: false,
|
|
147
|
+
|
|
146
148
|
},
|
|
147
149
|
{
|
|
148
150
|
name: "propB",
|
|
149
151
|
newValue: 10,
|
|
150
152
|
previousValue: null,
|
|
151
|
-
operation: ParameterOperation.ADD
|
|
153
|
+
operation: ParameterOperation.ADD,
|
|
154
|
+
isSensitive: false,
|
|
152
155
|
},
|
|
153
156
|
{
|
|
154
157
|
name: "propC",
|
|
155
158
|
newValue: 'propC',
|
|
156
159
|
previousValue: 'propC',
|
|
157
|
-
operation: ParameterOperation.NOOP
|
|
160
|
+
operation: ParameterOperation.NOOP,
|
|
161
|
+
isSensitive: false,
|
|
158
162
|
},
|
|
159
163
|
])
|
|
160
164
|
},
|
|
@@ -214,25 +218,29 @@ describe('Resource tests for stateful plans', () => {
|
|
|
214
218
|
name: "propA",
|
|
215
219
|
newValue: "propA",
|
|
216
220
|
previousValue: "propA",
|
|
217
|
-
operation: ParameterOperation.NOOP
|
|
221
|
+
operation: ParameterOperation.NOOP,
|
|
222
|
+
isSensitive: false,
|
|
218
223
|
},
|
|
219
224
|
{
|
|
220
225
|
name: "propB",
|
|
221
226
|
newValue: 10,
|
|
222
227
|
previousValue: null,
|
|
223
|
-
operation: ParameterOperation.ADD
|
|
228
|
+
operation: ParameterOperation.ADD,
|
|
229
|
+
isSensitive: false,
|
|
224
230
|
},
|
|
225
231
|
{
|
|
226
232
|
name: "propC",
|
|
227
233
|
newValue: 'propC',
|
|
228
234
|
previousValue: 'propC',
|
|
229
|
-
operation: ParameterOperation.NOOP
|
|
235
|
+
operation: ParameterOperation.NOOP,
|
|
236
|
+
isSensitive: false,
|
|
230
237
|
},
|
|
231
238
|
{
|
|
232
239
|
name: "propD",
|
|
233
240
|
newValue: 'propD',
|
|
234
241
|
previousValue: null,
|
|
235
|
-
operation: ParameterOperation.ADD
|
|
242
|
+
operation: ParameterOperation.ADD,
|
|
243
|
+
isSensitive: false,
|
|
236
244
|
},
|
|
237
245
|
])
|
|
238
246
|
},
|
|
@@ -80,13 +80,15 @@ describe('Resource tests', () => {
|
|
|
80
80
|
name: 'propA',
|
|
81
81
|
previousValue: 'propABefore',
|
|
82
82
|
newValue: 'propA',
|
|
83
|
-
operation: 'modify'
|
|
83
|
+
operation: 'modify',
|
|
84
|
+
isSensitive: false,
|
|
84
85
|
})
|
|
85
86
|
expect(result.changeSet.parameterChanges[1]).to.deep.eq({
|
|
86
87
|
name: 'propB',
|
|
87
88
|
previousValue: 10,
|
|
88
89
|
newValue: 10,
|
|
89
|
-
operation: 'noop'
|
|
90
|
+
operation: 'noop',
|
|
91
|
+
isSensitive: false,
|
|
90
92
|
})
|
|
91
93
|
})
|
|
92
94
|
|
|
@@ -717,12 +717,14 @@ describe('Resource parameter tests', () => {
|
|
|
717
717
|
operation: ParameterOperation.NOOP,
|
|
718
718
|
previousValue: null,
|
|
719
719
|
newValue: 'setting',
|
|
720
|
+
isSensitive: false,
|
|
720
721
|
},
|
|
721
722
|
{
|
|
722
723
|
name: 'propB',
|
|
723
724
|
operation: ParameterOperation.NOOP,
|
|
724
725
|
previousValue: 64,
|
|
725
726
|
newValue: 64,
|
|
727
|
+
isSensitive: false,
|
|
726
728
|
}
|
|
727
729
|
])
|
|
728
730
|
)
|
|
@@ -27,6 +27,12 @@ export interface ResourceSettings<T extends StringIndexedObject> {
|
|
|
27
27
|
*/
|
|
28
28
|
schema?: Partial<JSONSchemaType<T | any>>;
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Mark the resource as sensitive. Defaults to false. This prevents the resource from automatically being imported by init and import.
|
|
32
|
+
* This differs from the parameter level sensitivity which also prevents the parameter value from being displayed in the plan.
|
|
33
|
+
*/
|
|
34
|
+
isSensitive?: boolean;
|
|
35
|
+
|
|
30
36
|
/**
|
|
31
37
|
* Allow multiple of the same resource to unique. Set truthy if
|
|
32
38
|
* multiples are allowed, for example for applications, there can be multiple copy of the same application installed
|
|
@@ -163,7 +169,7 @@ export interface ResourceSettings<T extends StringIndexedObject> {
|
|
|
163
169
|
* @param input
|
|
164
170
|
* @param context
|
|
165
171
|
*/
|
|
166
|
-
refreshMapper?: (input: Partial<T>, context: RefreshContext<T>) => Partial<T
|
|
172
|
+
refreshMapper?: (input: Partial<T>, context: RefreshContext<T>) => Partial<T>;
|
|
167
173
|
}
|
|
168
174
|
}
|
|
169
175
|
|
|
@@ -207,6 +213,13 @@ export interface DefaultParameterSetting {
|
|
|
207
213
|
*/
|
|
208
214
|
type?: ParameterSettingType;
|
|
209
215
|
|
|
216
|
+
/**
|
|
217
|
+
* Mark the field as sensitive. Defaults to false. This has two side effects:
|
|
218
|
+
* 1. When displaying this field in the plan, it will be replaced with asterisks
|
|
219
|
+
* 2. When importing, resources with sensitive fields will be skipped unless the user explicitly allows it.
|
|
220
|
+
*/
|
|
221
|
+
isSensitive?: boolean;
|
|
222
|
+
|
|
210
223
|
/**
|
|
211
224
|
* Default value for the parameter. If a value is not provided in the config, then this value will be used.
|
|
212
225
|
*/
|