@highstate/pulumi 0.7.0 → 0.7.2

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/index.d.ts CHANGED
@@ -138,7 +138,7 @@ interface UnitContext<TArgs extends Record<string, ArgumentValue>, TInputs exten
138
138
  [K in keyof TInputs]: undefined extends TInputs[K] ? Output<NonNullable<TInputs[K]>> | undefined : Output<TInputs[K]>;
139
139
  };
140
140
  invokedTriggers: InstanceTriggerInvocation[];
141
- outputs(this: void, outputs: OutputMapToDeepInputMap<TOutputs>): Promise<unknown>;
141
+ outputs(this: void, outputs?: OutputMapToDeepInputMap<TOutputs>): Promise<unknown>;
142
142
  }
143
143
  type InputSpecToValue<T extends ComponentInputSpec> = T[2] extends true ? Static<T[0]["schema"]>[] : T[1] extends true ? Static<T[0]["schema"]> : Static<T[0]["schema"]> | undefined;
144
144
  type InputSpecMapToValueMap<T extends Record<string, ComponentInputSpec>> = T extends Record<string, never> ? Record<string, never> : {
package/dist/index.mjs CHANGED
@@ -155,7 +155,7 @@ function forUnit(unit) {
155
155
  secrets,
156
156
  inputs,
157
157
  invokedTriggers: config.getObject("$invokedTriggers") ?? [],
158
- outputs: async (outputs) => {
158
+ outputs: async (outputs = {}) => {
159
159
  const result = mapValues(outputs, (outputValue, outputName) => {
160
160
  if (outputName === "$status") {
161
161
  return output(outputValue).apply(mapStatus);
@@ -186,6 +186,12 @@ function forUnit(unit) {
186
186
  );
187
187
  }
188
188
  return output(outputValue).apply((value) => {
189
+ if (value === void 0) {
190
+ if (outputModel.required) {
191
+ throw new Error(`Output '${outputName}' is required.`);
192
+ }
193
+ return void 0;
194
+ }
189
195
  if (!ajv.validate(entity.schema, value)) {
190
196
  throw new Error(`Invalid output for '${outputModel.type}': ${ajv.errorsText()}`);
191
197
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@highstate/pulumi",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "type": "module",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -20,7 +20,7 @@
20
20
  "build": "pkgroll --tsconfig=tsconfig.build.json"
21
21
  },
22
22
  "dependencies": {
23
- "@highstate/contract": "^0.7.0",
23
+ "@highstate/contract": "^0.7.2",
24
24
  "@pulumi/pulumi": "^3.152.0",
25
25
  "@sinclair/typebox": "^0.34.11",
26
26
  "ajv": "^8.17.1",
@@ -30,5 +30,5 @@
30
30
  "devDependencies": {
31
31
  "pkgroll": "^2.5.1"
32
32
  },
33
- "gitHead": "2f5227f7b88cf38946e490fc4cdb96127bd8b174"
33
+ "gitHead": "e177535015e0fa3c74ae8ddc0bc6d31b191d2c54"
34
34
  }