@freelog/tools-lib 0.1.130 → 0.1.132

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.
Files changed (40) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +103 -103
  3. package/dist/service-API/activities.d.ts +6 -0
  4. package/dist/service-API/policies.d.ts +9 -0
  5. package/dist/tools-lib.cjs.development.js +26 -2
  6. package/dist/tools-lib.cjs.development.js.map +1 -1
  7. package/dist/tools-lib.cjs.production.min.js +1 -1
  8. package/dist/tools-lib.cjs.production.min.js.map +1 -1
  9. package/dist/tools-lib.esm.js +26 -2
  10. package/dist/tools-lib.esm.js.map +1 -1
  11. package/package.json +2 -2
  12. package/src/i18n/I18nNext.ts +154 -154
  13. package/src/i18n/index.ts +7 -7
  14. package/src/index.ts +9 -9
  15. package/src/service-API/activities.ts +231 -216
  16. package/src/service-API/captcha.ts +30 -30
  17. package/src/service-API/collections.ts +81 -81
  18. package/src/service-API/contracts.ts +101 -101
  19. package/src/service-API/events.ts +18 -18
  20. package/src/service-API/i18n.ts +35 -35
  21. package/src/service-API/index.ts +39 -39
  22. package/src/service-API/informalNodes.ts +238 -238
  23. package/src/service-API/nodes.ts +65 -65
  24. package/src/service-API/policies.ts +72 -45
  25. package/src/service-API/presentables.ts +287 -287
  26. package/src/service-API/recombinations/index.ts +69 -69
  27. package/src/service-API/resources.ts +532 -532
  28. package/src/service-API/statistics.ts +20 -20
  29. package/src/service-API/storages.ts +358 -358
  30. package/src/service-API/testQualifications.ts +109 -109
  31. package/src/service-API/tools/index.ts +10 -10
  32. package/src/service-API/transactions.ts +109 -109
  33. package/src/service-API/user.ts +270 -270
  34. package/src/utils/axios.ts +145 -145
  35. package/src/utils/format.ts +98 -98
  36. package/src/utils/index.ts +20 -20
  37. package/src/utils/linkTo.ts +399 -399
  38. package/src/utils/predefined.ts +37 -37
  39. package/src/utils/regexp.ts +52 -52
  40. package/src/utils/tools.ts +85 -85
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2021 liu-kai-github
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ MIT License
2
+
3
+ Copyright (c) 2021 liu-kai-github
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
package/README.md CHANGED
@@ -1,103 +1,103 @@
1
- # TSDX User Guide
2
-
3
- Congrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and how to use it.
4
-
5
- > This TSDX setup is meant for developing libraries (not apps!) that can be published to NPM. If you’re looking to build a Node app, you could use `ts-node-dev`, plain `ts-node`, or simple `tsc`.
6
-
7
- > If you’re new to TypeScript, checkout [this handy cheatsheet](https://devhints.io/typescript)
8
-
9
- ## Commands
10
-
11
- TSDX scaffolds your new library inside `/src`.
12
-
13
- To run TSDX, use:
14
-
15
- ```bash
16
- npm start # or yarn start
17
- ```
18
-
19
- This builds to `/dist` and runs the project in watch mode so any edits you save inside `src` causes a rebuild to `/dist`.
20
-
21
- To do a one-off build, use `npm run build` or `yarn build`.
22
-
23
- To run tests, use `npm test` or `yarn test`.
24
-
25
- ## Configuration
26
-
27
- Code quality is set up for you with `prettier`, `husky`, and `lint-staged`. Adjust the respective fields in `package.json` accordingly.
28
-
29
- ### Jest
30
-
31
- Jest tests are set up to run with `npm test` or `yarn test`.
32
-
33
- ### Bundle Analysis
34
-
35
- [`size-limit`](https://github.com/ai/size-limit) is set up to calculate the real cost of your library with `npm run size` and visualize the bundle with `npm run analyze`.
36
-
37
- #### Setup Files
38
-
39
- This is the folder structure we set up for you:
40
-
41
- ```txt
42
- /src
43
- index.tsx # EDIT THIS
44
- /test
45
- blah.test.tsx # EDIT THIS
46
- .gitignore
47
- package.json
48
- README.md # EDIT THIS
49
- tsconfig.json
50
- ```
51
-
52
- ### Rollup
53
-
54
- TSDX uses [Rollup](https://rollupjs.org) as a bundler and generates multiple rollup configs for various module formats and build settings. See [Optimizations](#optimizations) for details.
55
-
56
- ### TypeScript
57
-
58
- `tsconfig.json` is set up to interpret `dom` and `esnext` types, as well as `react` for `jsx`. Adjust according to your needs.
59
-
60
- ## Continuous Integration
61
-
62
- ### GitHub Actions
63
-
64
- Two actions are added by default:
65
-
66
- - `main` which installs deps w/ cache, lints, tests, and builds on all pushes against a Node and OS matrix
67
- - `size` which comments cost comparison of your library on every pull request using [`size-limit`](https://github.com/ai/size-limit)
68
-
69
- ## Optimizations
70
-
71
- Please see the main `tsdx` [optimizations docs](https://github.com/palmerhq/tsdx#optimizations). In particular, know that you can take advantage of development-only optimizations:
72
-
73
- ```js
74
- // ./types/index.d.ts
75
- declare var __DEV__: boolean;
76
-
77
- // inside your code...
78
- if (__DEV__) {
79
- console.log('foo');
80
- }
81
- ```
82
-
83
- You can also choose to install and use [invariant](https://github.com/palmerhq/tsdx#invariant) and [warning](https://github.com/palmerhq/tsdx#warning) functions.
84
-
85
- ## Module Formats
86
-
87
- CJS, ESModules, and UMD module formats are supported.
88
-
89
- The appropriate paths are configured in `package.json` and `dist/index.js` accordingly. Please report if any issues are found.
90
-
91
- ## Named Exports
92
-
93
- Per Palmer Group guidelines, [always use named exports.](https://github.com/palmerhq/typescript#exports) Code split inside your React app instead of your React library.
94
-
95
- ## Including Styles
96
-
97
- There are many ways to ship styles, including with CSS-in-JS. TSDX has no opinion on this, configure how you like.
98
-
99
- For vanilla CSS, you can include it at the root directory and add it to the `files` section in your `package.json`, so that it can be imported separately by your users and run through their bundler's loader.
100
-
101
- ## Publishing to NPM
102
-
103
- We recommend using [np](https://github.com/sindresorhus/np).
1
+ # TSDX User Guide
2
+
3
+ Congrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and how to use it.
4
+
5
+ > This TSDX setup is meant for developing libraries (not apps!) that can be published to NPM. If you’re looking to build a Node app, you could use `ts-node-dev`, plain `ts-node`, or simple `tsc`.
6
+
7
+ > If you’re new to TypeScript, checkout [this handy cheatsheet](https://devhints.io/typescript)
8
+
9
+ ## Commands
10
+
11
+ TSDX scaffolds your new library inside `/src`.
12
+
13
+ To run TSDX, use:
14
+
15
+ ```bash
16
+ npm start # or yarn start
17
+ ```
18
+
19
+ This builds to `/dist` and runs the project in watch mode so any edits you save inside `src` causes a rebuild to `/dist`.
20
+
21
+ To do a one-off build, use `npm run build` or `yarn build`.
22
+
23
+ To run tests, use `npm test` or `yarn test`.
24
+
25
+ ## Configuration
26
+
27
+ Code quality is set up for you with `prettier`, `husky`, and `lint-staged`. Adjust the respective fields in `package.json` accordingly.
28
+
29
+ ### Jest
30
+
31
+ Jest tests are set up to run with `npm test` or `yarn test`.
32
+
33
+ ### Bundle Analysis
34
+
35
+ [`size-limit`](https://github.com/ai/size-limit) is set up to calculate the real cost of your library with `npm run size` and visualize the bundle with `npm run analyze`.
36
+
37
+ #### Setup Files
38
+
39
+ This is the folder structure we set up for you:
40
+
41
+ ```txt
42
+ /src
43
+ index.tsx # EDIT THIS
44
+ /test
45
+ blah.test.tsx # EDIT THIS
46
+ .gitignore
47
+ package.json
48
+ README.md # EDIT THIS
49
+ tsconfig.json
50
+ ```
51
+
52
+ ### Rollup
53
+
54
+ TSDX uses [Rollup](https://rollupjs.org) as a bundler and generates multiple rollup configs for various module formats and build settings. See [Optimizations](#optimizations) for details.
55
+
56
+ ### TypeScript
57
+
58
+ `tsconfig.json` is set up to interpret `dom` and `esnext` types, as well as `react` for `jsx`. Adjust according to your needs.
59
+
60
+ ## Continuous Integration
61
+
62
+ ### GitHub Actions
63
+
64
+ Two actions are added by default:
65
+
66
+ - `main` which installs deps w/ cache, lints, tests, and builds on all pushes against a Node and OS matrix
67
+ - `size` which comments cost comparison of your library on every pull request using [`size-limit`](https://github.com/ai/size-limit)
68
+
69
+ ## Optimizations
70
+
71
+ Please see the main `tsdx` [optimizations docs](https://github.com/palmerhq/tsdx#optimizations). In particular, know that you can take advantage of development-only optimizations:
72
+
73
+ ```js
74
+ // ./types/index.d.ts
75
+ declare var __DEV__: boolean;
76
+
77
+ // inside your code...
78
+ if (__DEV__) {
79
+ console.log('foo');
80
+ }
81
+ ```
82
+
83
+ You can also choose to install and use [invariant](https://github.com/palmerhq/tsdx#invariant) and [warning](https://github.com/palmerhq/tsdx#warning) functions.
84
+
85
+ ## Module Formats
86
+
87
+ CJS, ESModules, and UMD module formats are supported.
88
+
89
+ The appropriate paths are configured in `package.json` and `dist/index.js` accordingly. Please report if any issues are found.
90
+
91
+ ## Named Exports
92
+
93
+ Per Palmer Group guidelines, [always use named exports.](https://github.com/palmerhq/typescript#exports) Code split inside your React app instead of your React library.
94
+
95
+ ## Including Styles
96
+
97
+ There are many ways to ship styles, including with CSS-in-JS. TSDX has no opinion on this, configure how you like.
98
+
99
+ For vanilla CSS, you can include it at the root directory and add it to the `files` section in your `package.json`, so that it can be imported separately by your users and run through their bundler's loader.
100
+
101
+ ## Publishing to NPM
102
+
103
+ We recommend using [np](https://github.com/sindresorhus/np).
@@ -68,4 +68,10 @@ declare type ListInviteFriendInfosParamsType = {
68
68
  createDate: string;
69
69
  }[];
70
70
  export declare function listInviteFriendInfos(params: ListInviteFriendInfosParamsType): Promise<any>;
71
+ interface GetRewardRecordInfosParamsType {
72
+ rewardGroupCode?: string;
73
+ rewardConfigCode?: string;
74
+ status?: 1 | 2 | 3;
75
+ }
76
+ export declare function getRewardRecordInfos(params: GetRewardRecordInfosParamsType): Promise<any>;
71
77
  export {};
@@ -15,4 +15,13 @@ export declare function policiesList(params: PoliciesListParamsType): Promise<an
15
15
  interface PolicyTemplatesParamsType {
16
16
  }
17
17
  export declare function policyTemplates(params?: PolicyTemplatesParamsType): Promise<any>;
18
+ interface PolicyTranslationParamsType {
19
+ contract: string;
20
+ }
21
+ export declare function policyTranslation(params: PolicyTranslationParamsType): Promise<any>;
22
+ interface PolicyTransferTranslationParamsType {
23
+ contract: string;
24
+ fsmTransfers: any;
25
+ }
26
+ export declare function policyTransferTranslation(params: PolicyTransferTranslationParamsType): Promise<any>;
18
27
  export {};
@@ -2467,6 +2467,13 @@ function listInviteFriendInfos(params) {
2467
2467
  data: params
2468
2468
  });
2469
2469
  }
2470
+ function getRewardRecordInfos(params) {
2471
+ return FUtil.Request({
2472
+ method: 'POST',
2473
+ url: "/v2/activities/facade/getRewardRecordInfos",
2474
+ data: params
2475
+ });
2476
+ }
2470
2477
 
2471
2478
  var Activity = {
2472
2479
  __proto__: null,
@@ -2485,7 +2492,8 @@ var Activity = {
2485
2492
  getWechatOfficialAccountInfo: getWechatOfficialAccountInfo,
2486
2493
  lotteryList: lotteryList,
2487
2494
  lotteryShow: lotteryShow,
2488
- listInviteFriendInfos: listInviteFriendInfos
2495
+ listInviteFriendInfos: listInviteFriendInfos,
2496
+ getRewardRecordInfos: getRewardRecordInfos
2489
2497
  };
2490
2498
 
2491
2499
  var _excluded$9 = ["recordId"];
@@ -2640,12 +2648,28 @@ function policyTemplates(params) {
2640
2648
  params: params
2641
2649
  });
2642
2650
  }
2651
+ function policyTranslation(params) {
2652
+ return FUtil.Request({
2653
+ method: 'POST',
2654
+ url: "/v2/translate/translate",
2655
+ data: params
2656
+ });
2657
+ }
2658
+ function policyTransferTranslation(params) {
2659
+ return FUtil.Request({
2660
+ method: 'POST',
2661
+ url: "/v2/translate/transfer",
2662
+ data: params
2663
+ });
2664
+ }
2643
2665
 
2644
2666
  var Policy = {
2645
2667
  __proto__: null,
2646
2668
  policies: policies,
2647
2669
  policiesList: policiesList,
2648
- policyTemplates: policyTemplates
2670
+ policyTemplates: policyTemplates,
2671
+ policyTranslation: policyTranslation,
2672
+ policyTransferTranslation: policyTransferTranslation
2649
2673
  };
2650
2674
 
2651
2675
  /**