@wenex/sdk 1.1.30 → 1.1.32
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 +51 -1
- package/common/core/utils/index.d.ts +1 -0
- package/common/core/utils/index.js +1 -0
- package/common/core/utils/index.js.map +1 -1
- package/common/core/utils/token.util.d.ts +2 -0
- package/common/core/utils/token.util.js +10 -0
- package/common/core/utils/token.util.js.map +1 -0
- package/package.json +1 -1
- package/services/essential/sagas.service.js +8 -8
- package/services/essential/sagas.service.js.map +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,54 @@
|
|
|
1
1
|
# platform-sdk
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@wenex/sdk)
|
|
4
|
-
[](https://github.com/wenex-org/platform-sdk/actions/workflows/npm-ci.yml)
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Getting Started
|
|
9
|
+
|
|
10
|
+
Follow these steps to set up the project locally:
|
|
11
|
+
|
|
12
|
+
1. **Clone the repository:**
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
git clone git@github.com:wenex-org/platform-sdk.git
|
|
16
|
+
cd platform-sdk
|
|
17
|
+
````
|
|
18
|
+
|
|
19
|
+
2. **Initialize Git submodules:**
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm run git:clone
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
3. **Install dependencies:**
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pnpm install
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
> *Tip:* If you see a notification about pnpm updates, run:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
corepack use pnpm@latest
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
4. **Set up Husky Git hooks (for development):**
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npm run husky
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Development
|
|
46
|
+
|
|
47
|
+
* Run `npm run husky` to enable Husky hooks during development.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## License
|
|
52
|
+
|
|
53
|
+
This project is licensed under the [MIT License](./LICENSE).
|
|
54
|
+
|
|
@@ -8,6 +8,7 @@ export * from './mixin.util';
|
|
|
8
8
|
export * from './net.util';
|
|
9
9
|
export * from './random.util';
|
|
10
10
|
export * from './repository.util';
|
|
11
|
+
export * from './token.util';
|
|
11
12
|
export * from './tools.util';
|
|
12
13
|
export * from './transform.util';
|
|
13
14
|
export * from './validation.util';
|
|
@@ -24,6 +24,7 @@ __exportStar(require("./mixin.util"), exports);
|
|
|
24
24
|
__exportStar(require("./net.util"), exports);
|
|
25
25
|
__exportStar(require("./random.util"), exports);
|
|
26
26
|
__exportStar(require("./repository.util"), exports);
|
|
27
|
+
__exportStar(require("./token.util"), exports);
|
|
27
28
|
__exportStar(require("./tools.util"), exports);
|
|
28
29
|
__exportStar(require("./transform.util"), exports);
|
|
29
30
|
__exportStar(require("./validation.util"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/core/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,kDAAgC;AAChC,gDAA8B;AAC9B,iDAA+B;AAC/B,gDAA8B;AAC9B,8CAA4B;AAC5B,+CAA6B;AAC7B,6CAA2B;AAC3B,gDAA8B;AAC9B,oDAAkC;AAClC,+CAA6B;AAC7B,mDAAiC;AACjC,oDAAkC;AAClC,iDAA+B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/core/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,kDAAgC;AAChC,gDAA8B;AAC9B,iDAA+B;AAC/B,gDAA8B;AAC9B,8CAA4B;AAC5B,+CAA6B;AAC7B,6CAA2B;AAC3B,gDAA8B;AAC9B,oDAAkC;AAClC,+CAA6B;AAC7B,+CAA6B;AAC7B,mDAAiC;AACjC,oDAAkC;AAClC,iDAA+B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tokenIdentity = void 0;
|
|
4
|
+
const tokenIdentity = (token) => {
|
|
5
|
+
if (!token)
|
|
6
|
+
throw new Error('token is required');
|
|
7
|
+
return token.uid || token.aid || token.cid;
|
|
8
|
+
};
|
|
9
|
+
exports.tokenIdentity = tokenIdentity;
|
|
10
|
+
//# sourceMappingURL=token.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token.util.js","sourceRoot":"","sources":["../../../src/common/core/utils/token.util.ts"],"names":[],"mappings":";;;AAEO,MAAM,aAAa,GAAG,CAAC,KAA2B,EAAE,EAAE;IAC3D,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACjD,OAAO,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC;AAC7C,CAAC,CAAC;AAHW,QAAA,aAAa,iBAGxB"}
|
package/package.json
CHANGED
|
@@ -8,17 +8,17 @@ class SagasService extends classes_1.RestfulService {
|
|
|
8
8
|
super('essential/sagas', axios);
|
|
9
9
|
this.axios = axios;
|
|
10
10
|
}
|
|
11
|
-
start(data, config) {
|
|
12
|
-
return this.post(this.url('start'), data, config);
|
|
11
|
+
async start(data, config) {
|
|
12
|
+
return (await this.post(this.url('start'), data, config)).data;
|
|
13
13
|
}
|
|
14
|
-
add(data, config) {
|
|
15
|
-
return this.post(this.url('add'), data, config);
|
|
14
|
+
async add(data, config) {
|
|
15
|
+
return (await this.post(this.url('add'), data, config)).data;
|
|
16
16
|
}
|
|
17
|
-
abort(id, config) {
|
|
18
|
-
return this.get(this.url(`${id}/abort`), config);
|
|
17
|
+
async abort(id, config) {
|
|
18
|
+
return (await this.get(this.url(`${id}/abort`), config)).data;
|
|
19
19
|
}
|
|
20
|
-
commit(id, config) {
|
|
21
|
-
return this.get(this.url(`${id}/commit`), config);
|
|
20
|
+
async commit(id, config) {
|
|
21
|
+
return (await this.get(this.url(`${id}/commit`), config)).data;
|
|
22
22
|
}
|
|
23
23
|
get stages() {
|
|
24
24
|
return (this._stages = this._stages ?? saga_stages_service_1.SagaStagesService.build(this.axios));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sagas.service.js","sourceRoot":"","sources":["../../src/services/essential/sagas.service.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"sagas.service.js","sourceRoot":"","sources":["../../src/services/essential/sagas.service.ts"],"names":[],"mappings":";;;AAGA,+DAA0D;AAC1D,uDAA0E;AAG1E,MAAa,YAAiD,SAAQ,wBAAqD;IAGzH,YAAsB,KAAoB;QACxC,KAAK,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;QADZ,UAAK,GAAL,KAAK,CAAe;IAE1C,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,IAA8B,EAAE,MAAwC;QAClF,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,CAAmD,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;IACnH,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,IAAqB,EAAE,MAAwC;QACvE,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,CAAmC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;IACjG,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,EAAU,EAAE,MAAwC;QAC9D,OAAO,CAAC,MAAM,IAAI,CAAC,GAAG,CAAyB,IAAI,CAAC,GAAG,CAAC,G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