@extrahorizon/exh-cli 1.12.0-dev-149-5031bb3 → 1.12.0-dev-151-7544bdb

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.
@@ -37,7 +37,7 @@
37
37
  "$schema": { "type": "string" },
38
38
  "description": { "type": "string" },
39
39
  "extendsTemplate": { "type": "string" },
40
- "properties": {
40
+ "inputs": {
41
41
  "type": "object",
42
42
  "additionalProperties": { "$ref": "#/definitions/TypeConfigurationV2" }
43
43
  },
@@ -165,7 +165,7 @@
165
165
  "type": "object",
166
166
  "required": ["type"],
167
167
  "properties": {
168
- "type": { "enum": ["object", "array", "string", "number", "boolean"] }
168
+ "type": { "enum": ["object", "array", "string", "number", "boolean", "object_id", "date"] }
169
169
  },
170
170
  "allOf": [
171
171
  {
@@ -212,6 +212,24 @@
212
212
  }
213
213
  },
214
214
  "then": { "$ref": "#/definitions/BooleanConfiguration" }
215
+ },
216
+ {
217
+ "if": {
218
+ "type": "object",
219
+ "properties": {
220
+ "type": { "const": "object_id" }
221
+ }
222
+ },
223
+ "then": { "$ref": "#/definitions/ObjectIdConfiguration" }
224
+ },
225
+ {
226
+ "if": {
227
+ "type": "object",
228
+ "properties": {
229
+ "type": { "const": "date" }
230
+ }
231
+ },
232
+ "then": { "$ref": "#/definitions/DateConfiguration" }
215
233
  }
216
234
  ]
217
235
  },
@@ -256,6 +274,20 @@
256
274
  "properties": {
257
275
  "type": { "const": "boolean" }
258
276
  }
277
+ },
278
+ "ObjectIdConfiguration": {
279
+ "type": "object",
280
+ "required": ["type"],
281
+ "properties": {
282
+ "type": { "const": "object_id" }
283
+ }
284
+ },
285
+ "DateConfiguration": {
286
+ "type": "object",
287
+ "required": ["type"],
288
+ "properties": {
289
+ "type": { "const": "date" }
290
+ }
259
291
  }
260
292
  }
261
293
  }
@@ -59,7 +59,7 @@ async function extendV1Template(name, templateFilesByName, callChain) {
59
59
  };
60
60
  }
61
61
  async function extendV2Template(name, templateFilesByName, callChain) {
62
- const { extendsTemplate, description, properties, outputs } = templateFilesByName[name];
62
+ const { extendsTemplate, description, inputs, outputs } = templateFilesByName[name];
63
63
  if (!templateFilesByName[extendsTemplate]) {
64
64
  templateFilesByName[extendsTemplate] = await templateV2Repository.findByName(extendsTemplate);
65
65
  }
@@ -77,13 +77,13 @@ async function extendV2Template(name, templateFilesByName, callChain) {
77
77
  const newOutputs = {};
78
78
  for (const output of Object.keys(extendingTemplate.outputs)) {
79
79
  const extendedValue = extendingTemplate.outputs[output]
80
- .replace(/{{[ ]*@data\.([a-zA-Z0-9_-]+)[ ]*}}/g, resolveMatch);
80
+ .replace(/{{[ ]*@inputs\.([a-zA-Z0-9_-]+)[ ]*}}/g, resolveMatch);
81
81
  newOutputs[output] = extendedValue;
82
82
  }
83
83
  return {
84
84
  name,
85
85
  description,
86
- properties,
86
+ inputs,
87
87
  outputs: newOutputs,
88
88
  };
89
89
  }
@@ -101,7 +101,7 @@ function v2ExtendingV1Error(extendsTemplate, callChain) {
101
101
  `In ${renderCallChain(callChain)}`);
102
102
  }
103
103
  function v2VariableNotFoundError(variableName, extendsTemplate, callChain) {
104
- return new Error(`Could not find a value to fill '{{@data.${variableName}}}' ` +
104
+ return new Error(`Could not find a value to fill '{{@inputs.${variableName}}}' ` +
105
105
  `while extending '${extendsTemplate}' ` +
106
106
  `in ${renderCallChain(callChain)}`);
107
107
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@extrahorizon/exh-cli",
3
- "version": "1.12.0-dev-149-5031bb3",
3
+ "version": "1.12.0-dev-151-7544bdb",
4
4
  "main": "build/index.js",
5
5
  "exports": "./build/index.js",
6
6
  "license": "MIT",
@@ -41,7 +41,7 @@
41
41
  "typescript": "4.5.5"
42
42
  },
43
43
  "dependencies": {
44
- "@extrahorizon/javascript-sdk": "8.9.0-dev-141-b21be6e",
44
+ "@extrahorizon/javascript-sdk": "8.9.0-dev-144-fe86b3e",
45
45
  "ajv": "^8.11.0",
46
46
  "archiver": "^7.0.1",
47
47
  "chalk": "^4.0.0",