1- import { ResourceJson , ResourceConfig as SchemaResourceConfig } from 'codify-schemas' ;
1+ import { ResourceJson , ResourceOs , ResourceConfig as SchemaResourceConfig } from 'codify-schemas' ;
22
33import { deepEqual } from '../utils/index.js' ;
44import { ConfigBlock , ConfigType } from './config.js' ;
@@ -28,6 +28,7 @@ export class ResourceConfig implements ConfigBlock {
2828 type : string ;
2929 name ?: string ;
3030 dependsOn : string [ ] ;
31+ os ?: ResourceOs [ ] ;
3132 sourceMapKey ?: string ;
3233
3334 // Calculated
@@ -37,11 +38,12 @@ export class ResourceConfig implements ConfigBlock {
3738 resourceInfo ?: ResourceInfo ;
3839
3940 constructor ( config : SchemaResourceConfig , sourceMapKey ?: string ) {
40- const { dependsOn, name, type, ...parameters } = config ;
41+ const { dependsOn, name, type, os , ...parameters } = config ;
4142
4243 this . raw = config ;
4344 this . type = type ;
4445 this . name = name ;
46+ this . os = os ;
4547 this . parameters = parameters ?? { } ;
4648 this . dependsOn = dependsOn ?? [ ]
4749 this . sourceMapKey = sourceMapKey ;
@@ -62,16 +64,14 @@ export class ResourceConfig implements ConfigBlock {
6264 return {
6365 type : this . type ,
6466 ...( excludeName || ! this . name ? { } : { name : this . name } ) ,
65- ...( this . dependsOn . length > 0 ? { dependsOn : this . dependsOn } : { } )
67+ ...( this . dependsOn . length > 0 ? { dependsOn : this . dependsOn } : { } ) ,
68+ ...( this . os && this . os ?. length > 0 ? { os : this . os } : { } )
6669 } ;
6770 }
6871
6972 toJson ( ) : ResourceJson {
7073 return {
71- core : {
72- type : this . type ,
73- name : this . name ,
74- } ,
74+ core : this . core ( ) ,
7575 parameters : this . parameters ?? { } ,
7676 }
7777 }
0 commit comments