@skedulo/mex-types 1.54.1 → 1.57.1

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.
@@ -1,4 +1,5 @@
1
1
  import { FlatPageViewComponentTypes, SelectPageOnlineSource, SkedButtonTheme } from '../view';
2
+ import { ValidatorDefinitionModel } from '../validator';
2
3
  export type DollarExpressionType = string;
3
4
  export type DataExpressionType = string;
4
5
  export type ValueExpressionType = string | ValueExpressionLogic[];
@@ -108,14 +109,14 @@ export interface ButtonGroupItemComponentModel {
108
109
  showIfExpression?: DataExpressionType;
109
110
  }
110
111
  export interface ButtonBehaviorComponentModel {
111
- type: 'custom' | 'sms' | 'phone' | 'openUrl' | 'email' | 'openSelector' | 'routing';
112
+ type: 'custom' | 'sms' | 'phone' | 'openUrl' | 'email' | 'openSelector' | 'routing' | 'custom-ai';
112
113
  }
113
114
  export type ListPageExtraActionBehavior = PhoneButtonBehaviorComponentModel | SMSButtonBehaviorComponentModel | OpenURLButtonBehaviorComponentModel | EmailButtonBehaviorComponentModel;
114
115
  export type ListPageExtraActionType = {
115
116
  title: LocalizedKey;
116
117
  behavior: ListPageExtraActionBehavior;
117
118
  };
118
- export type ButtonBehaviorComponentModelTypes = CustomFunctionButtonBehaviorComponentModel | PhoneButtonBehaviorComponentModel | SMSButtonBehaviorComponentModel | OpenURLButtonBehaviorComponentModel | EmailButtonBehaviorComponentModel | RoutingBehaviorComponentModel;
119
+ export type ButtonBehaviorComponentModelTypes = CustomFunctionButtonBehaviorComponentModel | PhoneButtonBehaviorComponentModel | SMSButtonBehaviorComponentModel | OpenURLButtonBehaviorComponentModel | EmailButtonBehaviorComponentModel | RoutingBehaviorComponentModel | CustomAIBehaviorComponentModel;
119
120
  export interface CustomFunctionButtonBehaviorComponentModel extends ButtonBehaviorComponentModel {
120
121
  functionExpression: DataExpressionType;
121
122
  /**
@@ -148,6 +149,21 @@ export interface RoutingBehaviorComponentModel extends ButtonBehaviorComponentMo
148
149
  destination: RoutingType;
149
150
  type: 'routing';
150
151
  }
152
+ /**
153
+ * Button behavior that triggers an AI-powered action, required full online mode
154
+ * @version: 1.55.0
155
+ */
156
+ export interface CustomAIBehaviorComponentModel extends ButtonBehaviorComponentModel {
157
+ type: 'custom-ai';
158
+ processingPage?: {
159
+ title?: LocalizedKey;
160
+ };
161
+ entryValidator?: ValidatorDefinitionModel;
162
+ /** Online query config to call AI service */
163
+ query: CustomOnlineDataQuery;
164
+ /** Function expression invoked with the AI query result */
165
+ onAIResultFunctionExpression: FunctionExpressionType;
166
+ }
151
167
  export interface GroupByFeatureModel {
152
168
  /**
153
169
  * @label Group by
@@ -1,4 +1,4 @@
1
- import { UIDefinition } from 'src/page';
1
+ import { UIContent } from 'src/page';
2
2
  import { AsyncExpressionType } from './CommonTypes';
3
3
  /**
4
4
  * Form definition status.
@@ -319,7 +319,7 @@ export interface FormDef {
319
319
  /**
320
320
  * Form definition UI. In JSON format
321
321
  */
322
- ui: UIDefinition;
322
+ ui: UIContent;
323
323
  /**
324
324
  * Static fetch configuration. In JSON format
325
325
  */
@@ -7,6 +7,7 @@ import { ValidatorDefinitionModel } from '../validator';
7
7
  * @area formProperties
8
8
  */
9
9
  export type UIDefinition = {
10
+ type: 'standard';
10
11
  /**
11
12
  * @label First page
12
13
  * @placeholder Enter a page name
@@ -69,6 +70,7 @@ export type UIDefinition = {
69
70
  };
70
71
  };
71
72
  };
73
+ export type UIContent = UIDefinition | MexWexContent;
72
74
  /**
73
75
  * @version 1.14.0
74
76
  */
@@ -563,5 +565,12 @@ export interface MessageBoxProperties {
563
565
  theme: ValueExpressionType;
564
566
  numberOfLines?: number;
565
567
  }
568
+ /**
569
+ * @version: 2.4.0
570
+ * For the Form using mexwex content as rendering engine
571
+ */
572
+ export interface MexWexContent {
573
+ type: 'mexwex';
574
+ }
566
575
  export type AllPageComponentModel = ListPageComponentModel | FlatPageComponentModelTypes;
567
576
  export {};
@@ -18,4 +18,4 @@ export interface CustomFunctionValidatorModel extends BaseValidatorModel {
18
18
  type: 'customFunction';
19
19
  }
20
20
  export type ValidatorDefinitionModel = ValidatorModelTypes[] | ValidatorModelTypes;
21
- export type ValidatorModelTypes = ExpressionValidatorModel | CustomFunctionValidatorModel;
21
+ export type ValidatorModelTypes = ExpressionValidatorModel | AsyncExpressionValidatorModel | CustomFunctionValidatorModel;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skedulo/mex-types",
3
- "version": "1.54.1",
3
+ "version": "1.57.1",
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",