@skedulo/mex-types 1.59.0 → 1.61.0

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.
@@ -162,7 +162,7 @@ export interface CustomAIBehaviorComponentModel extends ButtonBehaviorComponentM
162
162
  /** Online query config to call AI service */
163
163
  query: CustomOnlineDataQuery;
164
164
  /** Function expression invoked with the AI query result */
165
- onAIResultFunctionExpression: FunctionExpressionType;
165
+ onAIResultFunctionExpression?: FunctionExpressionType;
166
166
  }
167
167
  export interface GroupByFeatureModel {
168
168
  /**
@@ -2,7 +2,7 @@ import { ListPageExtraActionType, ButtonGroupItemComponentModel, DataExpressionT
2
2
  import { BaseListPageViewComponentModel } from '../view';
3
3
  import { BaseComponentModel } from '../common';
4
4
  import { FlatPageViewComponentTypes } from '../view';
5
- import { ValidatorDefinitionModel } from '../validator';
5
+ import { SoftValidatorDefinitionModel, ValidatorDefinitionModel } from '../validator';
6
6
  /**
7
7
  * @area formProperties
8
8
  */
@@ -388,6 +388,13 @@ export interface FlatPageComponentModel extends BasePageComponentModel {
388
388
  updateButtonText?: LocalizedKey;
389
389
  defaultDataForNewObject?: OneLevelBindingObject;
390
390
  validator?: ValidatorDefinitionModel;
391
+ /**
392
+ * Advisory validators, run once `validator` passes. Failing one asks the user to submit anyway
393
+ * or keep editing, instead of blocking the save.
394
+ * @label Soft validator
395
+ * @version 2.5.x
396
+ */
397
+ softValidator?: SoftValidatorDefinitionModel;
391
398
  /**
392
399
  * @label Read Only condition
393
400
  */
@@ -7,6 +7,13 @@ export interface AsyncExpressionValidatorModel extends BaseValidatorModel {
7
7
  errorMessage: LocalizedKey;
8
8
  expression: DataExpressionType;
9
9
  query: OnlineFetchDataQuery;
10
+ /**
11
+ * Gates the validator, evaluated before `query` runs, so an unmet condition skips the API call entirely
12
+ * Omit to always validate.
13
+ * @label Condition
14
+ * @version 2.5.x
15
+ */
16
+ condition?: DataExpressionType | boolean;
10
17
  }
11
18
  export interface ExpressionValidatorModel extends BaseValidatorModel {
12
19
  type: 'expression';
@@ -17,5 +24,19 @@ export interface CustomFunctionValidatorModel extends BaseValidatorModel {
17
24
  functionName: string;
18
25
  type: 'customFunction';
19
26
  }
20
- export type ValidatorDefinitionModel = ValidatorModelTypes[] | ValidatorModelTypes;
21
- export type ValidatorModelTypes = ExpressionValidatorModel | AsyncExpressionValidatorModel | CustomFunctionValidatorModel;
27
+ export type ValidatorDefinitionModel = HardValidationModel[] | HardValidationModel;
28
+ /**
29
+ * Blocking validation — failing it stops the save until the data is corrected.
30
+ */
31
+ export type HardValidationModel = ExpressionValidatorModel | AsyncExpressionValidatorModel | CustomFunctionValidatorModel;
32
+ /**
33
+ * Advisory validation — failing it warns the user on submit, who may then save anyway. Same shapes
34
+ * as HardValidationModel; what makes it soft is being declared under `upsert.softValidator` rather
35
+ * than `validator`
36
+ * @version 2.5.x
37
+ */
38
+ export type SoftValidationModel = ExpressionValidatorModel | AsyncExpressionValidatorModel | CustomFunctionValidatorModel;
39
+ /**
40
+ * @version 2.5.x
41
+ */
42
+ export type SoftValidatorDefinitionModel = SoftValidationModel[] | SoftValidationModel;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skedulo/mex-types",
3
- "version": "1.59.0",
3
+ "version": "1.61.0",
4
4
  "description": "A central repository store for all the interfaces, type definitions of MEX engine",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",