@extrahorizon/exh-cli 1.7.0 → 1.8.0-dev-64-478dd73

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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Extra Horizon CLI changelog
2
2
 
3
+ ### v1.8.0
4
+ * `exh data schemas sync` now also strips the description fields for conditions and actions in the creation transition
5
+ * Added priority to the transition task action in the schema validator
6
+ * Improved typing for the afterActions in the schema validator
7
+
3
8
  ### v1.7.0
4
9
  * `exh data schemas sync` now allows your schema `.json` files to contain a `$schema` property
5
10
  * This allows you to specify a json-schema for the schema files themselves, providing hints and validation in your editor
@@ -1,13 +1,13 @@
1
- import { Schema, Transition } from '@extrahorizon/javascript-sdk';
1
+ import { CreationTransition, Schema, TypeConfiguration } from '@extrahorizon/javascript-sdk';
2
2
  export declare function stripUnsupportedDescriptionFields(schema: Schema): {
3
3
  id: string;
4
4
  name: string;
5
5
  description: string;
6
- properties: Record<string, any>;
6
+ properties: Record<string, TypeConfiguration>;
7
7
  indexes: import("@extrahorizon/javascript-sdk").Index[];
8
8
  statuses: Record<string, Record<string, string>>;
9
- creationTransition: import("@extrahorizon/javascript-sdk").CreationTransition;
10
- transitions: Transition[];
9
+ creationTransition: CreationTransition;
10
+ transitions: import("@extrahorizon/javascript-sdk").Transition[];
11
11
  createMode: import("@extrahorizon/javascript-sdk").CreateMode;
12
12
  readMode: import("@extrahorizon/javascript-sdk").ReadMode;
13
13
  updateMode: import("@extrahorizon/javascript-sdk").UpdateMode;
@@ -18,5 +18,5 @@ export declare function stripUnsupportedDescriptionFields(schema: Schema): {
18
18
  updateTimestamp: Date;
19
19
  creationTimestamp: Date;
20
20
  findTransitionIdByName?: (name: string) => string;
21
- transitionsByName?: Record<string, Transition>;
21
+ transitionsByName?: Record<string, import("@extrahorizon/javascript-sdk").Transition>;
22
22
  };
@@ -5,7 +5,7 @@ const _ = require("lodash");
5
5
  function stripUnsupportedDescriptionFields(schema) {
6
6
  const newSchema = { ...schema };
7
7
  if (schema.creationTransition) {
8
- newSchema.creationTransition = _.omit(schema.creationTransition, 'description');
8
+ newSchema.creationTransition = stripDescriptionsFromTransition(schema.creationTransition);
9
9
  }
10
10
  if (schema.transitions) {
11
11
  newSchema.transitions = schema.transitions.map(stripDescriptionsFromTransition);
@@ -110,7 +110,10 @@
110
110
  "type": "array",
111
111
  "items": { "$ref": "#/definitions/Action" }
112
112
  },
113
- "afterActions": { "type": "array" }
113
+ "afterActions": {
114
+ "type": "array",
115
+ "items": { "$ref": "#/definitions/AfterAction" }
116
+ }
114
117
  },
115
118
  "required": [
116
119
  "type",
@@ -121,9 +124,15 @@
121
124
  "ManualTransition": {
122
125
  "type": "object",
123
126
  "properties": {
124
- "type": { "const": "manual" },
125
- "name": { "type": "string" },
126
- "description": { "type": "string" },
127
+ "type": {
128
+ "const": "manual"
129
+ },
130
+ "name": {
131
+ "type": "string"
132
+ },
133
+ "description": {
134
+ "type": "string"
135
+ },
127
136
  "fromStatuses": {
128
137
  "type": "array",
129
138
  "items": {
@@ -140,18 +149,33 @@
140
149
  "type": "array",
141
150
  "items": {
142
151
  "anyOf": [
143
- { "$ref": "#/definitions/InputCondition" },
144
- { "$ref": "#/definitions/DocumentCondition" },
145
- { "$ref": "#/definitions/InitiatorHasRelationToUserInDataCondition" },
146
- { "$ref": "#/definitions/InitiatorHasRelationToGroupInDataCondition" }
152
+ {
153
+ "$ref": "#/definitions/InputCondition"
154
+ },
155
+ {
156
+ "$ref": "#/definitions/DocumentCondition"
157
+ },
158
+ {
159
+ "$ref": "#/definitions/InitiatorHasRelationToUserInDataCondition"
160
+ },
161
+ {
162
+ "$ref": "#/definitions/InitiatorHasRelationToGroupInDataCondition"
163
+ }
147
164
  ]
148
165
  }
149
166
  },
150
167
  "actions": {
151
168
  "type": "array",
152
- "items": { "$ref": "#/definitions/Action" }
169
+ "items": {
170
+ "$ref": "#/definitions/Action"
171
+ }
153
172
  },
154
- "afterActions": { "type": "array" }
173
+ "afterActions": {
174
+ "type": "array",
175
+ "items": {
176
+ "$ref": "#/definitions/AfterAction"
177
+ }
178
+ }
155
179
  },
156
180
  "required": [
157
181
  "type",
@@ -191,7 +215,10 @@
191
215
  "type": "array",
192
216
  "items": { "$ref": "#/definitions/Action" }
193
217
  },
194
- "afterActions": { "type": "array" }
218
+ "afterActions": {
219
+ "type": "array",
220
+ "items": { "$ref": "#/definitions/AfterAction" }
221
+ }
195
222
  },
196
223
  "required": [
197
224
  "type",
@@ -233,12 +260,48 @@
233
260
  { "$ref": "#/definitions/MeasurementReviewedNotificationAction" }
234
261
  ]
235
262
  },
263
+ "AfterAction": {
264
+ "type": "object",
265
+ "properties": {
266
+ "type": {
267
+ "type": "string",
268
+ "enum": [
269
+ "task",
270
+ "notifyAlgoQueueManager"
271
+ ]
272
+ }
273
+ },
274
+ "anyOf": [
275
+ { "$ref": "#/definitions/TaskAction" },
276
+ { "$ref": "#/definitions/NotifyAlgoQueueManagerAction" }
277
+ ]
278
+ },
279
+ "NotifyAlgoQueueManagerAction": {
280
+ "type": "object",
281
+ "description": "Deprecated! The notifyAlgoQueueManager action is deprecated and should not be used.",
282
+ "properties": {
283
+ "type": {
284
+ "const": "notifyAlgoQueueManager",
285
+ "description": "Deprecated! The notifyAlgoQueueManager action is deprecated and should not be used."
286
+ },
287
+ "description": { "type": "string" },
288
+ "id": { "type": "string" },
289
+ "version": { "type": "string" }
290
+ },
291
+ "required": [
292
+ "type",
293
+ "id",
294
+ "version"
295
+ ],
296
+ "additionalProperties": false
297
+ },
236
298
  "TaskAction": {
237
299
  "type": "object",
238
300
  "properties": {
239
301
  "type": { "const": "task" },
240
302
  "description": { "type": "string" },
241
303
  "functionName": { "type": "string" },
304
+ "priority": { "type": "number" },
242
305
  "data": {
243
306
  "type": "object",
244
307
  "additionalProperties": true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@extrahorizon/exh-cli",
3
- "version": "1.7.0",
3
+ "version": "1.8.0-dev-64-478dd73",
4
4
  "main": "build/index.js",
5
5
  "exports": "./build/index.js",
6
6
  "license": "MIT",
@@ -40,7 +40,7 @@
40
40
  "typescript": "4.5.5"
41
41
  },
42
42
  "dependencies": {
43
- "@extrahorizon/javascript-sdk": "^8.4.0",
43
+ "@extrahorizon/javascript-sdk": "^8.4.1",
44
44
  "ajv": "^8.11.0",
45
45
  "archiver": "^5.3.1",
46
46
  "chalk": "^4.0.0",