1- import { Plan , Plugin , Resource , ValidationResult , runPlugin } from 'codify-plugin-lib' ;
1+ import { Plugin , Resource , runPlugin } from 'codify-plugin-lib' ;
22import { StringIndexedObject } from 'codify-schemas' ;
33
4- export interface TestConfig extends StringIndexedObject {
4+ export interface TestConfig extends StringIndexedObject {
55 propA : string ;
66 propB : number ;
77 propC : string ;
@@ -14,12 +14,12 @@ export class TestResource extends Resource<TestConfig> {
1414 } ) ;
1515 }
1616
17- async applyCreate ( plan : Plan < TestConfig > ) : Promise < void > { }
17+ async applyCreate ( ) : Promise < void > { }
1818
19- async applyDestroy ( plan : Plan < TestConfig > ) : Promise < void > { }
19+ async applyDestroy ( ) : Promise < void > { }
2020
21- async refresh ( keys : Map < string , unknown > ) : Promise < Partial < TestConfig > | null > {
22- if ( keys . has ( ' propD' ) ) {
21+ async refresh ( parameters : Partial < TestConfig > ) : Promise < Partial < TestConfig > | null > {
22+ if ( parameters . propD ) {
2323 throw new Error ( 'Prop D is included' ) ;
2424 }
2525
@@ -29,12 +29,6 @@ export class TestResource extends Resource<TestConfig> {
2929 propC : 'c' ,
3030 } ;
3131 }
32-
33- async validateResource ( config : unknown ) : Promise < ValidationResult > {
34- return {
35- isValid : true
36- }
37- }
3832}
3933
4034export class TestUninstallResource extends Resource < TestConfig > {
@@ -44,19 +38,13 @@ export class TestUninstallResource extends Resource<TestConfig> {
4438 } ) ;
4539 }
4640
47- async applyCreate ( plan : Plan < TestConfig > ) : Promise < void > { }
41+ async applyCreate ( ) : Promise < void > { }
4842
49- async applyDestroy ( plan : Plan < TestConfig > ) : Promise < void > { }
43+ async applyDestroy ( ) : Promise < void > { }
5044
51- async refresh ( keys : Map < string , unknown > ) : Promise < Partial < TestConfig > | null > {
45+ async refresh ( ) : Promise < Partial < TestConfig > | null > {
5246 return null ;
5347 }
54-
55- async validateResource ( config : unknown ) : Promise < ValidationResult > {
56- return {
57- isValid : true
58- }
59- }
6048}
6149
6250function buildPlugin ( ) : Plugin {
0 commit comments