codify-plugin-lib 1.0.97 → 1.0.98

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.
@@ -133,11 +133,16 @@ export class ResourceController {
133
133
  async import(config) {
134
134
  this.addDefaultValues(config);
135
135
  await this.applyTransformParameters(config);
136
- // Try to refresh as many parameters as possible here
137
- const parametersToRefresh = {
138
- ...Object.fromEntries(this.getAllParameterKeys().map((k) => [k, null])),
139
- ...config,
140
- };
136
+ // Use refresh parameters if specified, otherwise try to refresh as many parameters as possible here
137
+ const parametersToRefresh = this.settings.import?.refreshParameters
138
+ ? {
139
+ ...Object.fromEntries(this.settings.import?.refreshParameters.map((k) => [k, null])),
140
+ ...config,
141
+ }
142
+ : {
143
+ ...Object.fromEntries(this.getAllParameterKeys().map((k) => [k, null])),
144
+ ...config,
145
+ };
141
146
  // Parse data from the user supplied config
142
147
  const parsedConfig = new ConfigParser(parametersToRefresh, null, this.parsedSettings.statefulParameters);
143
148
  const { allNonStatefulParameters, allStatefulParameters, coreParameters, } = parsedConfig;
@@ -53,7 +53,8 @@ export interface ResourceSettings<T extends StringIndexedObject> {
53
53
  */
54
54
  inputTransformation?: (desired: Partial<T>) => Promise<unknown> | unknown;
55
55
  import?: {
56
- requiredParameters: Array<Partial<keyof T>>;
56
+ requiredParameters?: Array<Partial<keyof T>>;
57
+ refreshParameters?: Array<Partial<keyof T>>;
57
58
  };
58
59
  }
59
60
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codify-plugin-lib",
3
- "version": "1.0.97",
3
+ "version": "1.0.98",
4
4
  "description": "Library plugin library",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -169,7 +169,7 @@ export class ParsedResourceSettings<T extends StringIndexedObject> implements Re
169
169
 
170
170
  const importRequiredParameterNotInSchema =
171
171
  this.settings.import?.requiredParameters?.filter((p) => !(schema?.properties[p]))
172
- if(schema && importRequiredParameterNotInSchema && importRequiredParameterNotInSchema.length > 0) {
172
+ if (schema && importRequiredParameterNotInSchema && importRequiredParameterNotInSchema.length > 0) {
173
173
  throw new Error(`The following properties were declared in settings.import.requiredParameters but were not found in the schema:
174
174
  ${JSON.stringify(importRequiredParameterNotInSchema, null, 2)}`)
175
175
  }
@@ -189,8 +189,15 @@ export class ResourceController<T extends StringIndexedObject> {
189
189
  this.addDefaultValues(config);
190
190
  await this.applyTransformParameters(config);
191
191
 
192
- // Try to refresh as many parameters as possible here
193
- const parametersToRefresh = {
192
+ // Use refresh parameters if specified, otherwise try to refresh as many parameters as possible here
193
+ const parametersToRefresh = this.settings.import?.refreshParameters
194
+ ? {
195
+ ...Object.fromEntries(
196
+ this.settings.import?.refreshParameters.map((k) => [k, null])
197
+ ),
198
+ ...config,
199
+ }
200
+ : {
194
201
  ...Object.fromEntries(
195
202
  this.getAllParameterKeys().map((k) => [k, null])
196
203
  ),
@@ -66,7 +66,9 @@ export interface ResourceSettings<T extends StringIndexedObject> {
66
66
  inputTransformation?: (desired: Partial<T>) => Promise<unknown> | unknown;
67
67
 
68
68
  import?: {
69
- requiredParameters: Array<Partial<keyof T>>;
69
+ requiredParameters?: Array<Partial<keyof T>>;
70
+
71
+ refreshParameters?: Array<Partial<keyof T>>;
70
72
  }
71
73
  }
72
74