@skedulo/mex-types 1.1.0 → 1.2.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.
package/README.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # mex-types
2
2
 
3
- A central repository store for all the interfaces, type definitions of MEX engine.
3
+ A central repository store for all the interfaces, type definitions of MEX engine. It also includes scripts that can read information from TypeScript files, which contain these interfaces and definitions. The data extracted from these files is then used by the Form Builder.
4
+
5
+
6
+
7
+ ## Node version
8
+ 18.x
4
9
 
5
10
  ## Install
6
11
 
@@ -10,25 +15,70 @@ Bootstrap
10
15
  yarn bootstrap
11
16
  ```
12
17
 
13
- Linting
18
+ ## How to test the package locally
19
+ From the root of **mex-types**, run
14
20
 
15
21
  ```sh
16
- yarn lint
22
+ yarn clean
23
+ yarn build
24
+ npm pack --pack-destination /tmp
17
25
  ```
18
26
 
19
- Build
27
+ After this step, you should see a new file in the /tmp folder
28
+ - For example: /tmp/skedulo-mex-types-0.0.1.tgz
20
29
 
21
- ```sh
22
- yarn build
30
+ Inside project uses this package, update **package.json** to point to ***.tgz** above
31
+ ```json
32
+ "dependencies": {
33
+ "@skedulo@mex-types": "file:/tmp/skedulo-mex-types-0.0.1.tgz"
34
+ }
23
35
  ```
24
36
 
25
- ## Publish
37
+ ## Semantic release
38
+
39
+ This project adheres to the Semantic Versioning (SemVer) release approach, and as such, we employ the tool [Semantic Release](https://github.com/semantic-release/semantic-release) to facilitate automated version incrementation.
40
+
41
+ ### Commit message convention
42
+ > Tips: To simplify the process of creating commit messages that adhere to the Conventional Commits format, consider using the Commitizen tool. After you've staged all your changes, you can run either yarn commit or git cz. This tool will guide you through the process and make it easier to generate the correct commit message format.
43
+
44
+ Please use the [guidelines](https://www.conventionalcommits.org/en/v1.0.0/) outlined in this guide when writing your commit messages. Following this guide ensures that your commit messages follow a standard format. This standard format is **important** because it helps the semantic-release tool understand and manage versioning more effectively.
45
+
46
+ The table below shows which commit message gets you which release type when **semantic-release** runs (using the default configuration):
47
+
48
+ | Commit message | Release type |
49
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
50
+ | fix(api): resolve issue with data parsing | ~~Patch~~ Fix Release |
51
+ | feat(login): add user authentication feature | ~~Minor~~ Feature Release |
52
+ | feat(login): No backward compatibility <br><br>BREAKING CHANGE: The graphiteWidth option has been removed.<br>The default graphite width of 10mm is always used for performance reasons.` | ~~Major~~ Breaking Release <br /> (Note that the BREAKING CHANGE: token must be in the footer of the commit) |
53
+
54
+ ### Publish workflow
55
+ #### Release channel
56
+ **main** branch
57
+
58
+ ### Pre-release channel
59
+ **beta** branch (**Must** be branched from **main**)
60
+
61
+ **New feature** (Pre-release) flow:
62
+ - Create a branch from **beta**
63
+ - Implement the feature
64
+ - Raise PR from new branch into **beta**
65
+ - After approved, using squash merge. Please enter commit message following conventional guidelines
66
+ - At this stage, your beta version is ready to install. It might have a format like this *1.0.1-beta*. (There is a bot will comment on your PR about new version after semantic-release publishing successfully.)
67
+ - Raise PR from **beta** to **main**
68
+ - Wait for approval and squash merge
69
+
70
+ **Hot fix**
71
+ - Create a branch from **main**
72
+ - Implement the fix
73
+ - Raise PR from new branch into **main**
74
+ - After approved, using squash merge.(Please use *fix* convention message)
75
+
76
+ ### Release type rules
77
+ - If adding comments into the code that affect the output of parsed info, must release in patch type. Here are list of change might contribute to parsed output
78
+ - jsdocs comment
79
+ - the parser scripts get updated
80
+ - If add new property, interface, type defs, must release in minor type
81
+ - Break change (TBD)
82
+
26
83
 
27
- Bump up the semantic version in package.json and run the following commands -
28
84
 
29
- ```sh
30
- git tag vd.d.d (e.g. v0.4.9)
31
- git push --tags
32
- yarn build
33
- npm publish
34
- ```
@@ -1,8 +1,11 @@
1
1
  import { BaseFlatPageViewComponentModel, SkedButtonTheme } from '../view/FlatPageViewComponentModel';
2
+ import { SelectPageOnlineSource } from '../view';
2
3
  export type DataExpressionType = string;
3
4
  export type ValueExpressionType = string | ValueExpressionLogic[];
4
5
  export type LocalizedKey = string;
5
6
  export type OneLevelBindingObject = any;
7
+ export type FunctionExpressionType = string;
8
+ export type TimezoneType = 'none' | 'job' | 'local';
6
9
  export type ValueExpressionLogic = {
7
10
  condition?: DataExpressionType;
8
11
  value: ValueExpressionType;
@@ -35,7 +38,7 @@ export interface ButtonGroupItemComponentModel {
35
38
  behavior: ButtonBehaviorComponentModel;
36
39
  }
37
40
  export interface ButtonBehaviorComponentModel {
38
- type: 'custom' | 'sms' | 'phone' | 'openUrl' | 'email';
41
+ type: 'custom' | 'sms' | 'phone' | 'openUrl' | 'email' | 'openSelector';
39
42
  }
40
43
  export interface CustomFunctionButtonBehaviorComponentModel extends ButtonBehaviorComponentModel {
41
44
  functionExpression: DataExpressionType;
@@ -52,3 +55,30 @@ export interface OpenURLButtonBehaviorComponentModel extends ButtonBehaviorCompo
52
55
  export interface EmailButtonBehaviorComponentModel extends ButtonBehaviorComponentModel {
53
56
  emailExpression: DataExpressionType;
54
57
  }
58
+ export type SelectPageConfig = {
59
+ searchBar: {
60
+ filterOnProperties: string[] | undefined;
61
+ placeholder: LocalizedKey;
62
+ };
63
+ itemCaption: LocalizedKey;
64
+ itemTitle: LocalizedKey;
65
+ dataSourceExpression: DataExpressionType;
66
+ emptyText: LocalizedKey;
67
+ filterExpression?: DataExpressionType;
68
+ singleSelectionConfig: {
69
+ dismissPageAfterChosen: boolean;
70
+ } | undefined;
71
+ isMultiSelect?: boolean;
72
+ header: {
73
+ title: LocalizedKey;
74
+ hasClearBtn: boolean;
75
+ } | undefined;
76
+ onlineSource?: SelectPageOnlineSource;
77
+ selectedDataExpression?: DataExpressionType;
78
+ };
79
+ export interface OpenSelectorButtonBehaviorComponentModel extends ButtonBehaviorComponentModel {
80
+ selectPage: SelectPageConfig;
81
+ events: {
82
+ onDataChosen: FunctionExpressionType;
83
+ };
84
+ }
@@ -1,4 +1,4 @@
1
- import { ButtonGroupItemComponentModel, DataExpressionType, ListPageAddNewDefaultDataType, LocalizedKey, OneLevelBindingObject, RoutingType } from '../common/CommonTypes';
1
+ import { ButtonGroupItemComponentModel, DataExpressionType, FunctionExpressionType, ListPageAddNewDefaultDataType, LocalizedKey, OneLevelBindingObject, RoutingType } from '../common/CommonTypes';
2
2
  import { BaseListPageViewComponentModel } from '../view/ListPageViewComponentModel';
3
3
  import { BaseComponentModel } from '../common/BaseComponentModel';
4
4
  import { BaseFlatPageViewComponentModel } from '../view/FlatPageViewComponentModel';
@@ -84,6 +84,11 @@ export interface FlatPageComponentModel extends BasePageComponentModel {
84
84
  };
85
85
  items: BaseFlatPageViewComponentModel[];
86
86
  description: LocalizedKey;
87
+ events: {
88
+ onInitialized: FunctionExpressionType;
89
+ onSubmitted: FunctionExpressionType;
90
+ onRemoved: FunctionExpressionType;
91
+ };
87
92
  }
88
93
  export type AllPageComponentModel = ListPageComponentModel | FlatPageComponentModel;
89
94
  export {};
@@ -1,5 +1,5 @@
1
1
  import { BaseComponentModel } from '../common/BaseComponentModel';
2
- import { ButtonGroupItemComponentModel, DataExpressionType, ListPageAddNewDefaultDataType, LocalizedKey, OneLevelBindingObject, RoutingType } from '../common/CommonTypes';
2
+ import { ButtonGroupItemComponentModel, DataExpressionType, FunctionExpressionType, ListPageAddNewDefaultDataType, LocalizedKey, OneLevelBindingObject, RoutingType, TimezoneType } from '../common/CommonTypes';
3
3
  import { SelectPageOnlineSource, SelectPageSearchBarConfig } from './SearchPage';
4
4
  import { ValidatorDefinitionModel } from '../validator/ValidatorModel';
5
5
  export interface BaseFlatPageViewComponentModel extends BaseComponentModel {
@@ -11,6 +11,10 @@ export interface CommonEditorViewComponentModel extends BaseFlatPageViewComponen
11
11
  validator: ValidatorDefinitionModel | undefined;
12
12
  mandatory: boolean | DataExpressionType | undefined;
13
13
  readonly: boolean | DataExpressionType | undefined;
14
+ editorEvents: CommonEditorEvents;
15
+ }
16
+ export interface CommonEditorEvents {
17
+ onValueChanged: FunctionExpressionType;
14
18
  }
15
19
  export interface CommonEditorWithPlaceholder {
16
20
  placeholder: LocalizedKey;
@@ -68,6 +72,9 @@ export interface ToggleEditorItemModel {
68
72
  }
69
73
  export interface DateTimePickerViewComponentModel extends CommonEditorViewComponentModel, CommonEditorWithPlaceholder {
70
74
  mode: 'datetime' | 'date' | 'time';
75
+ datetimeOptions?: {
76
+ timezone?: TimezoneType;
77
+ };
71
78
  valueExpression: DataExpressionType;
72
79
  }
73
80
  export interface BaseSublistViewComponentModel extends BaseComponentModel {
@@ -1,24 +1,4 @@
1
1
  import { DataExpressionType, LocalizedKey, OneLevelBindingObject } from '../common/CommonTypes';
2
- export type SelectPageConfig = {
3
- searchBar: {
4
- filterOnProperties: string[] | undefined;
5
- placeholder: LocalizedKey;
6
- };
7
- itemCaption: LocalizedKey;
8
- itemTitle: LocalizedKey;
9
- dataSourceExpression: DataExpressionType;
10
- emptyText: LocalizedKey;
11
- filterExpression?: DataExpressionType;
12
- singleSelectionConfig: {
13
- dismissPageAfterChosen: boolean;
14
- } | undefined;
15
- isMultiSelect?: boolean;
16
- header: {
17
- title: LocalizedKey;
18
- hasClearBtn: boolean;
19
- };
20
- onlineSource?: SelectPageOnlineSource;
21
- };
22
2
  export type SelectPageOnlineSource = {
23
3
  key: DataExpressionType;
24
4
  variables: OneLevelBindingObject;
package/package.json CHANGED
@@ -3,6 +3,7 @@
3
3
  "description": "A central repository store for all the interfaces, type definitions of MEX engine",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
+ "version": "1.2.1",
6
7
  "scripts": {
7
8
  "bootstrap": "rm -rf node_modules && yarn install --pure-lockfile --peer",
8
9
  "lint": "tslint 'src/**/*.ts'",
@@ -44,6 +45,5 @@
44
45
  },
45
46
  "publishConfig": {
46
47
  "access": "public"
47
- },
48
- "version": "1.1.0"
48
+ }
49
49
  }