codify-plugin-lib 1.0.33 → 1.0.35

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.
@@ -25,7 +25,7 @@ export class Plugin {
25
25
  }
26
26
  const error = await this.resources.get(config.type).validate(config);
27
27
  if (error) {
28
- totalErrors.push(error);
28
+ totalErrors.push(...error);
29
29
  }
30
30
  }
31
31
  await this.crossValidateResources(data.configs);
@@ -2,6 +2,7 @@ import { ResourceConfig, ResourceOperation } from 'codify-schemas';
2
2
  import { ParameterChange } from './change-set.js';
3
3
  import { Plan } from './plan.js';
4
4
  import { StatefulParameter } from './stateful-parameter.js';
5
+ export type ErrorMessage = string;
5
6
  export declare abstract class Resource<T extends ResourceConfig> {
6
7
  private dependencies;
7
8
  private statefulParameters;
@@ -12,7 +13,7 @@ export declare abstract class Resource<T extends ResourceConfig> {
12
13
  plan(desiredConfig: T): Promise<Plan<T>>;
13
14
  apply(plan: Plan<T>): Promise<void>;
14
15
  protected registerStatefulParameter(parameter: StatefulParameter<T, keyof T>): void;
15
- abstract validate(config: unknown): Promise<string | undefined>;
16
+ abstract validate(config: unknown): Promise<ErrorMessage[] | undefined>;
16
17
  abstract getCurrentConfig(desiredConfig: T): Promise<T | null>;
17
18
  abstract calculateOperation(change: ParameterChange): ResourceOperation.MODIFY | ResourceOperation.RECREATE;
18
19
  abstract applyCreate(plan: Plan<T>): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codify-plugin-lib",
3
- "version": "1.0.33",
3
+ "version": "1.0.35",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -42,7 +42,7 @@ export class Plugin {
42
42
 
43
43
  const error = await this.resources.get(config.type)!.validate(config);
44
44
  if (error) {
45
- totalErrors.push(error);
45
+ totalErrors.push(...error);
46
46
  }
47
47
  }
48
48
 
@@ -3,6 +3,8 @@ import { ChangeSet, ParameterChange } from './change-set.js';
3
3
  import { Plan } from './plan.js';
4
4
  import { StatefulParameter } from './stateful-parameter.js';
5
5
 
6
+ export type ErrorMessage = string;
7
+
6
8
  export abstract class Resource<T extends ResourceConfig> {
7
9
 
8
10
  private statefulParameters: Map<string, StatefulParameter<T, keyof T>> = new Map();
@@ -116,7 +118,7 @@ export abstract class Resource<T extends ResourceConfig> {
116
118
  this.statefulParameters.set(parameter.name as string, parameter);
117
119
  }
118
120
 
119
- abstract validate(config: unknown): Promise<string | undefined>;
121
+ abstract validate(config: unknown): Promise<ErrorMessage[] | undefined>;
120
122
 
121
123
  abstract getCurrentConfig(desiredConfig: T): Promise<T | null>;
122
124