@doreamonjs/plugin-authorization 0.0.1-beta.4 → 0.3.13
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/CHANGELOG.md +38 -2
- package/LICENSE +21 -0
- package/README.md +4 -2
- package/lib/constants.d.ts +2 -1
- package/lib/constants.js +6 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.js +15 -8
- package/lib/instance.d.ts +4 -0
- package/lib/instance.js +7 -0
- package/lib/model.d.ts +7 -11
- package/lib/model.js +80 -28
- package/lib/service.d.ts +2 -9
- package/lib/service.js +6 -23
- package/lib/types.d.ts +2 -11
- package/lib/types.js +0 -1
- package/package.json +37 -37
- package/lib/constants.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/model.js.map +0 -1
- package/lib/selector.d.ts +0 -7
- package/lib/selector.js +0 -17
- package/lib/selector.js.map +0 -1
- package/lib/service.js.map +0 -1
- package/lib/types.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [0.
|
|
6
|
+
## [0.3.13](https://github.com/zcorky/zodash/compare/v0.3.12...v0.3.13) (2022-08-31)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* plugin-authorization model + types ([7c4058c](https://github.com/zcorky/zodash/commit/7c4058c47429eda26de6af08ce6b2d2a423f83c9))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [0.3.12](https://github.com/zcorky/zodash/compare/v0.3.11...v0.3.12) (2022-08-31)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @doreamonjs/plugin-authorization
|
|
9
20
|
|
|
@@ -11,6 +22,31 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
11
22
|
|
|
12
23
|
|
|
13
24
|
|
|
14
|
-
## [0.
|
|
25
|
+
## [0.3.3](https://github.com/zcorky/zodash/compare/v0.3.2...v0.3.3) (2022-08-30)
|
|
15
26
|
|
|
16
27
|
**Note:** Version bump only for package @doreamonjs/plugin-authorization
|
|
28
|
+
|
|
29
|
+
## [0.3.2](https://github.com/zcorky/zodash/compare/v0.3.1...v0.3.2) (2022-08-30)
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
- dependencies ([60d97c5](https://github.com/zcorky/zodash/commit/60d97c5f857228f91bdbda6e833438559b3ea7d6))
|
|
34
|
+
- package.json main and typings ([5a23e68](https://github.com/zcorky/zodash/commit/5a23e689ce467ddba1deeec674a8639fef3ba5a8))
|
|
35
|
+
|
|
36
|
+
# 0.3.0 (2022-08-30)
|
|
37
|
+
|
|
38
|
+
### Bug Fixes
|
|
39
|
+
|
|
40
|
+
- test ([ab09558](https://github.com/zcorky/zodash/commit/ab0955886a268210cef6cbfe2a6b2362f6d826d6))
|
|
41
|
+
|
|
42
|
+
### Features
|
|
43
|
+
|
|
44
|
+
- add plugin-request/forms/authorizations ([7901413](https://github.com/zcorky/zodash/commit/79014135cbae3337e5bf4c8372627f784ffe476e))
|
|
45
|
+
|
|
46
|
+
## [1.1.8](https://github.com/zcorky/zodash/compare/@zodash/get@1.1.7...@zodash/get@1.1.8) (2021-04-05)
|
|
47
|
+
|
|
48
|
+
**Note:** Version bump only for package @zodash/get
|
|
49
|
+
|
|
50
|
+
## 1.1.7 (2021-04-05)
|
|
51
|
+
|
|
52
|
+
**Note:** Version bump only for package @zodash/get
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 Eason
|
|
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
|
+
SOFTWARE.
|
package/README.md
CHANGED
package/lib/constants.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export declare const NAMESPACE = "
|
|
1
|
+
export declare const NAMESPACE = "authorizations";
|
|
2
|
+
export declare function namespace(): string;
|
package/lib/constants.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NAMESPACE =
|
|
4
|
-
|
|
3
|
+
exports.namespace = exports.NAMESPACE = void 0;
|
|
4
|
+
exports.NAMESPACE = 'authorizations';
|
|
5
|
+
function namespace() {
|
|
6
|
+
return exports.NAMESPACE;
|
|
7
|
+
}
|
|
8
|
+
exports.namespace = namespace;
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
}
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
5
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
__exportStar(require("./types"), exports);
|
|
14
|
+
__exportStar(require("./constants"), exports);
|
|
15
|
+
__exportStar(require("./model"), exports);
|
|
16
|
+
__exportStar(require("./service"), exports);
|
|
17
|
+
__exportStar(require("./instance"), exports);
|
package/lib/instance.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.service = exports.model = void 0;
|
|
4
|
+
const model_1 = require("./model");
|
|
5
|
+
const service_1 = require("./service");
|
|
6
|
+
exports.model = new model_1.Model();
|
|
7
|
+
exports.service = new service_1.Service();
|
package/lib/model.d.ts
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import { Model as
|
|
2
|
-
|
|
3
|
-
export interface Options {
|
|
4
|
-
login(username: string, password: string, captcha: string): Promise<void>;
|
|
5
|
-
logout(username: string): Promise<void>;
|
|
6
|
-
register(username: string, password: string, confirmPassword: string, captcha: string): Promise<void>;
|
|
7
|
-
captcha(): Promise<Captcha>;
|
|
8
|
-
sendCaptchaToEmailOrOther(username: string): Promise<void>;
|
|
1
|
+
import { Model as DvaModel } from 'dva';
|
|
2
|
+
export interface ModelOptions {
|
|
9
3
|
}
|
|
10
4
|
export declare class Model {
|
|
11
|
-
readonly options
|
|
12
|
-
constructor(options
|
|
13
|
-
|
|
5
|
+
readonly options?: ModelOptions;
|
|
6
|
+
constructor(options?: ModelOptions);
|
|
7
|
+
get namespace(): string;
|
|
8
|
+
build(): DvaModel;
|
|
9
|
+
toDva(): DvaModel;
|
|
14
10
|
}
|
package/lib/model.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
const
|
|
3
|
+
exports.Model = void 0;
|
|
4
|
+
const doreamon_1 = require("@zodash/doreamon");
|
|
5
|
+
const service = require("@doreamonjs/plugin-service");
|
|
5
6
|
const constants_1 = require("./constants");
|
|
6
7
|
class Model {
|
|
7
8
|
constructor(options) {
|
|
8
9
|
this.options = options;
|
|
9
10
|
}
|
|
11
|
+
get namespace() {
|
|
12
|
+
return constants_1.NAMESPACE;
|
|
13
|
+
}
|
|
10
14
|
build() {
|
|
11
|
-
const { login, logout, register, captcha, sendCaptchaToEmailOrOther, } = this.options;
|
|
12
15
|
return {
|
|
13
16
|
namespace: constants_1.NAMESPACE,
|
|
14
17
|
state: {
|
|
@@ -20,67 +23,92 @@ class Model {
|
|
|
20
23
|
},
|
|
21
24
|
},
|
|
22
25
|
effects: {
|
|
23
|
-
*login({ payload: { username, password, captcha } }, { race, call, put }) {
|
|
24
|
-
yield call(
|
|
26
|
+
*login({ payload: { username, password, captcha }, done }, { race, call, put }) {
|
|
27
|
+
yield call(doreamon_1.default.delay, 1000);
|
|
25
28
|
try {
|
|
26
29
|
const { timeout } = yield race({
|
|
27
30
|
data: call(login, username, password, captcha),
|
|
28
|
-
timeout: call(
|
|
31
|
+
timeout: call(doreamon_1.default.delay, 10000),
|
|
29
32
|
});
|
|
30
|
-
if (
|
|
31
|
-
yield put({
|
|
33
|
+
if (timeout) {
|
|
34
|
+
yield put({
|
|
35
|
+
type: 'message/tip/error',
|
|
36
|
+
payload: '服务器开小差啦',
|
|
37
|
+
});
|
|
38
|
+
done();
|
|
32
39
|
return false;
|
|
33
40
|
}
|
|
34
41
|
}
|
|
35
42
|
catch (err) {
|
|
36
43
|
yield put({ type: 'refresh/captcha' });
|
|
37
44
|
setTimeout(() => {
|
|
45
|
+
// @TODO hack clear captcha
|
|
38
46
|
const node = document.querySelector('input#captcha');
|
|
39
47
|
if (node) {
|
|
40
48
|
node.value = '';
|
|
41
49
|
}
|
|
42
50
|
}, 0);
|
|
51
|
+
done();
|
|
43
52
|
throw err;
|
|
44
53
|
}
|
|
45
|
-
yield call(
|
|
46
|
-
|
|
54
|
+
yield call(doreamon_1.default.delay, 1000);
|
|
55
|
+
// router change
|
|
56
|
+
// @TODO should support redirect
|
|
57
|
+
const query = doreamon_1.default.qs.parse(window.location.search);
|
|
47
58
|
const redirect = query.redirect || '/';
|
|
48
59
|
window.location.href = redirect;
|
|
49
60
|
},
|
|
50
61
|
*logout(action, { select, race, call, put }) {
|
|
51
|
-
|
|
62
|
+
// @TODO request call backend api
|
|
63
|
+
const { username } = yield select((state) => state.user.values);
|
|
52
64
|
const { timeout } = yield race({
|
|
53
65
|
data: call(logout, username),
|
|
54
|
-
timeout: call(
|
|
66
|
+
timeout: call(doreamon_1.default.delay, 10000),
|
|
55
67
|
});
|
|
56
|
-
if (
|
|
57
|
-
yield put({
|
|
68
|
+
if (timeout) {
|
|
69
|
+
yield put({
|
|
70
|
+
type: 'message/tip/error',
|
|
71
|
+
payload: '服务器开小差啦',
|
|
72
|
+
});
|
|
58
73
|
return false;
|
|
59
74
|
}
|
|
75
|
+
// solution @2
|
|
76
|
+
// const currentPath = window.location.pathname;
|
|
77
|
+
// window.location.href = `/login?redirect=${encodeURIComponent(currentPath)}`;
|
|
60
78
|
const currentPath = window.location.pathname;
|
|
61
|
-
window.location.href = `/
|
|
79
|
+
window.location.href = `/logout?from=${encodeURIComponent(currentPath)}`;
|
|
62
80
|
},
|
|
63
81
|
*register({ payload }, { race, call, put }) {
|
|
64
82
|
const { username, password, confirmPassword, captcha } = payload;
|
|
65
83
|
const { data, timeout } = yield race({
|
|
66
84
|
data: call(register, username, password, confirmPassword, captcha),
|
|
67
|
-
timeout: call(
|
|
85
|
+
timeout: call(doreamon_1.default.delay, 10000),
|
|
68
86
|
});
|
|
69
|
-
if (
|
|
70
|
-
yield put({
|
|
87
|
+
if (timeout) {
|
|
88
|
+
yield put({
|
|
89
|
+
type: 'message/tip/error',
|
|
90
|
+
payload: '服务器开小差啦',
|
|
91
|
+
});
|
|
71
92
|
return false;
|
|
72
93
|
}
|
|
73
|
-
yield put({
|
|
74
|
-
|
|
94
|
+
yield put({
|
|
95
|
+
type: 'message/tip/success',
|
|
96
|
+
payload: '注册成功, 正在跳转登陆界面...',
|
|
97
|
+
});
|
|
98
|
+
yield call(doreamon_1.default.delay, 1000);
|
|
75
99
|
window.location.href = '/';
|
|
76
100
|
},
|
|
101
|
+
// login
|
|
77
102
|
*'refresh/captcha'(action, { race, call, put }) {
|
|
78
103
|
const { data, timeout } = yield race({
|
|
79
104
|
data: call(captcha),
|
|
80
|
-
timeout: call(
|
|
105
|
+
timeout: call(doreamon_1.default.delay, 10000),
|
|
81
106
|
});
|
|
82
|
-
if (
|
|
83
|
-
yield put({
|
|
107
|
+
if (timeout) {
|
|
108
|
+
yield put({
|
|
109
|
+
type: 'message/tip/error',
|
|
110
|
+
payload: '服务器开小差啦',
|
|
111
|
+
});
|
|
84
112
|
return false;
|
|
85
113
|
}
|
|
86
114
|
yield put({ type: 'captcha/save', payload: data.url });
|
|
@@ -88,17 +116,41 @@ class Model {
|
|
|
88
116
|
*'send/captcha/to/email_or_other'({ payload: { username } }, { race, call, put }) {
|
|
89
117
|
const { timeout } = yield race({
|
|
90
118
|
data: call(sendCaptchaToEmailOrOther, username),
|
|
91
|
-
timeout: call(
|
|
119
|
+
timeout: call(doreamon_1.default.delay, 10000),
|
|
92
120
|
});
|
|
93
|
-
if (
|
|
94
|
-
yield put({
|
|
121
|
+
if (timeout) {
|
|
122
|
+
yield put({
|
|
123
|
+
type: 'message/tip/error',
|
|
124
|
+
payload: '服务器开小差啦',
|
|
125
|
+
});
|
|
95
126
|
return false;
|
|
96
127
|
}
|
|
97
|
-
yield put({
|
|
128
|
+
yield put({
|
|
129
|
+
type: 'message/tip/success',
|
|
130
|
+
payload: '验证码发送成功,请查看邮箱',
|
|
131
|
+
});
|
|
98
132
|
},
|
|
99
133
|
},
|
|
100
134
|
};
|
|
101
135
|
}
|
|
136
|
+
toDva() {
|
|
137
|
+
return this.build();
|
|
138
|
+
}
|
|
102
139
|
}
|
|
103
140
|
exports.Model = Model;
|
|
104
|
-
|
|
141
|
+
//
|
|
142
|
+
function login(username, password, captcha) {
|
|
143
|
+
return service.authorization.login(username, password, captcha);
|
|
144
|
+
}
|
|
145
|
+
function logout(username) {
|
|
146
|
+
return service.authorization.logout(username);
|
|
147
|
+
}
|
|
148
|
+
function register(username, password, confirmPassword, captcha) {
|
|
149
|
+
return service.authorization.register(username, password, confirmPassword, captcha);
|
|
150
|
+
}
|
|
151
|
+
function captcha() {
|
|
152
|
+
return service.authorization.captcha();
|
|
153
|
+
}
|
|
154
|
+
function sendCaptchaToEmailOrOther(username) {
|
|
155
|
+
return service.authorization.sendCaptchaToEmailOrOther(username);
|
|
156
|
+
}
|
package/lib/service.d.ts
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import { Action, Dispatch } from './types';
|
|
2
1
|
export declare class Service {
|
|
3
|
-
private
|
|
4
|
-
|
|
5
|
-
protected dispatch(action: Action): any;
|
|
6
|
-
login(username: string, password: string, captcha: string): any;
|
|
7
|
-
logout(): any;
|
|
8
|
-
register(username: string, password: string, confirmPassword: string, captcha: string): any;
|
|
9
|
-
refreshCaptcha(): any;
|
|
10
|
-
sendCaptchaToEmailOrOther(username: string): any;
|
|
2
|
+
private logger;
|
|
3
|
+
get namespace(): string;
|
|
11
4
|
}
|
package/lib/service.js
CHANGED
|
@@ -1,31 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Service = void 0;
|
|
4
|
+
const shared = require("@doreamonjs/plugin-shared");
|
|
3
5
|
const constants_1 = require("./constants");
|
|
4
6
|
class Service {
|
|
5
|
-
constructor(
|
|
6
|
-
this.
|
|
7
|
+
constructor() {
|
|
8
|
+
this.logger = shared.logger.getLogger(constants_1.NAMESPACE);
|
|
7
9
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return this.dispatcher(action);
|
|
11
|
-
}
|
|
12
|
-
return window.g_app._store.dispatch(action);
|
|
13
|
-
}
|
|
14
|
-
login(username, password, captcha) {
|
|
15
|
-
return this.dispatch({ type: `${constants_1.NAMESPACE}/login`, payload: { username, password, captcha } });
|
|
16
|
-
}
|
|
17
|
-
logout() {
|
|
18
|
-
return this.dispatch({ type: `${constants_1.NAMESPACE}/logout` });
|
|
19
|
-
}
|
|
20
|
-
register(username, password, confirmPassword, captcha) {
|
|
21
|
-
return this.dispatch({ type: `${constants_1.NAMESPACE}/register`, payload: { username, password, confirmPassword, captcha } });
|
|
22
|
-
}
|
|
23
|
-
refreshCaptcha() {
|
|
24
|
-
return this.dispatch({ type: `${constants_1.NAMESPACE}/refresh/captcha` });
|
|
25
|
-
}
|
|
26
|
-
sendCaptchaToEmailOrOther(username) {
|
|
27
|
-
return this.dispatch({ type: `${constants_1.NAMESPACE}/send/captcha/to/email_or_other`, payload: { username } });
|
|
10
|
+
get namespace() {
|
|
11
|
+
return constants_1.NAMESPACE;
|
|
28
12
|
}
|
|
29
13
|
}
|
|
30
14
|
exports.Service = Service;
|
|
31
|
-
//# sourceMappingURL=service.js.map
|
package/lib/types.d.ts
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
type: string;
|
|
4
|
-
payload?: any;
|
|
5
|
-
}
|
|
6
|
-
export declare type Dispatch = (action: Action) => any | Promise<any>;
|
|
7
|
-
export interface Authorization {
|
|
8
|
-
captcha: string;
|
|
9
|
-
}
|
|
10
|
-
export interface Captcha {
|
|
11
|
-
url: string;
|
|
1
|
+
export interface State {
|
|
2
|
+
captcha?: string;
|
|
12
3
|
}
|
package/lib/types.js
CHANGED
package/package.json
CHANGED
|
@@ -1,41 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doreamonjs/plugin-authorization",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
5
|
-
"main": "lib/index.js",
|
|
6
|
-
"types": "lib/index.d.ts",
|
|
7
|
-
"sideEffects": false,
|
|
8
|
-
"scripts": {
|
|
9
|
-
"clean": "rm -rf lib",
|
|
10
|
-
"build": "npm run clean && tsc",
|
|
11
|
-
"test": "jest -w 1",
|
|
12
|
-
"coverage": "codecov",
|
|
13
|
-
"prepublishOnly": "npm run build"
|
|
14
|
-
},
|
|
15
|
-
"publishConfig": {
|
|
16
|
-
"access": "public"
|
|
17
|
-
},
|
|
18
|
-
"repository": {
|
|
19
|
-
"type": "git",
|
|
20
|
-
"url": "https://github.com/doreamonjs/doreamon"
|
|
21
|
-
},
|
|
22
|
-
"homepage": "https://github.com/doreamonjs/doreamon",
|
|
3
|
+
"version": "0.3.13",
|
|
4
|
+
"description": "authorization plugin for doreamonjs",
|
|
23
5
|
"keywords": [
|
|
24
6
|
"doreamonjs",
|
|
25
|
-
"plugin
|
|
7
|
+
"plugin"
|
|
26
8
|
],
|
|
27
9
|
"author": "zero <tobewhatwewant@gmail.com>",
|
|
10
|
+
"homepage": "https://github.com/zcorky/zodash#readme",
|
|
28
11
|
"license": "MIT",
|
|
12
|
+
"main": "lib/index.js",
|
|
13
|
+
"typings": "lib/index.d.ts",
|
|
29
14
|
"directories": {
|
|
30
|
-
"lib": "lib"
|
|
31
|
-
"test": "__tests__"
|
|
15
|
+
"lib": "lib"
|
|
32
16
|
},
|
|
33
17
|
"files": [
|
|
34
18
|
"lib"
|
|
35
19
|
],
|
|
36
|
-
"bugs": {
|
|
37
|
-
"url": "https://github.com/doreamonjs/doreamon/issues"
|
|
38
|
-
},
|
|
39
20
|
"jest": {
|
|
40
21
|
"roots": [
|
|
41
22
|
"__tests__"
|
|
@@ -61,21 +42,40 @@
|
|
|
61
42
|
],
|
|
62
43
|
"coverageThreshold": {
|
|
63
44
|
"global": {
|
|
64
|
-
"branches":
|
|
65
|
-
"functions":
|
|
66
|
-
"lines":
|
|
67
|
-
"statements":
|
|
45
|
+
"branches": 60,
|
|
46
|
+
"functions": 60,
|
|
47
|
+
"lines": 60,
|
|
48
|
+
"statements": -10
|
|
68
49
|
}
|
|
69
|
-
}
|
|
70
|
-
"preset": "ts-jest"
|
|
50
|
+
}
|
|
71
51
|
},
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
|
|
52
|
+
"publishConfig": {
|
|
53
|
+
"access": "public"
|
|
54
|
+
},
|
|
55
|
+
"repository": {
|
|
56
|
+
"type": "git",
|
|
57
|
+
"url": "git+https://github.com/zcorky/zodash.git"
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"build": "tsc",
|
|
61
|
+
"test": "jest -w 1",
|
|
62
|
+
"coverage": "codecov"
|
|
63
|
+
},
|
|
64
|
+
"bugs": {
|
|
65
|
+
"url": "https://github.com/zcorky/zodash/issues"
|
|
75
66
|
},
|
|
76
67
|
"dependencies": {
|
|
68
|
+
"@doreamonjs/plugin-request": "^0.3.2",
|
|
69
|
+
"@doreamonjs/plugin-shared": "^0.3.13",
|
|
70
|
+
"@sentry/browser": "^7.11.1",
|
|
71
|
+
"@sentry/tracing": "^7.11.1",
|
|
77
72
|
"@zcorky/delay": "^1.0.1",
|
|
78
|
-
"@zcorky/query-string": "^1.0.2"
|
|
73
|
+
"@zcorky/query-string": "^1.0.2",
|
|
74
|
+
"@zodash/doreamon": "^1.0.17",
|
|
75
|
+
"dva": "^2.4.1",
|
|
76
|
+
"immer": "^9.0.15",
|
|
77
|
+
"mixpanel-browser": "^2.45.0",
|
|
78
|
+
"thinkingdata-browser": "^1.6.0"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "1b28761e66cad9a1e9e3f35b39258a0e3c3caf6c"
|
|
81
81
|
}
|
package/lib/constants.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;AAAa,QAAA,SAAS,GAAG,eAAe,CAAC"}
|
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAEA,iCAA4B;AAE5B,6BAAwB;AAExB,gCAA2B;AAC3B,+BAA0B"}
|
package/lib/model.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":";;AACA,yCAAsC;AACtC,uDAA6C;AAG7C,2CAAwC;AAYxC,MAAa,KAAK;IAChB,YAA4B,OAAgB;QAAhB,YAAO,GAAP,OAAO,CAAS;IAE5C,CAAC;IAED,KAAK;QACH,MAAM,EACJ,KAAK,EAAE,MAAM,EAAE,QAAQ,EACvB,OAAO,EAAE,yBAAyB,GACnC,GAAG,IAAI,CAAC,OAAO,CAAC;QAEjB,OAAO;YACL,SAAS,EAAE,qBAAS;YAEpB,KAAK,EAAE;gBACL,OAAO,EAAE,eAAe,IAAI,CAAC,GAAG,EAAE,EAAE;aACrC;YAED,QAAQ,EAAE;gBACR,cAAc,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;oBACxC,OAAO,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,CAAC;gBAC/B,CAAC;aACF;YAED,OAAO,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AmB,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;wBAC7D,OAAO,KAAK,CAAC;qBACd;oBAED,MAAM,GAAG,CAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;gBACvE,CAAC;aACF;SACF,CAAC;IACJ,CAAC;CACF;AAnID,sBAmIC"}
|
package/lib/selector.d.ts
DELETED
package/lib/selector.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const constants_1 = require("./constants");
|
|
4
|
-
class Selector {
|
|
5
|
-
constructor(state) {
|
|
6
|
-
this.state = state;
|
|
7
|
-
}
|
|
8
|
-
get value() {
|
|
9
|
-
const state = this.state[constants_1.NAMESPACE];
|
|
10
|
-
return state;
|
|
11
|
-
}
|
|
12
|
-
get(key) {
|
|
13
|
-
return this.value[key];
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.Selector = Selector;
|
|
17
|
-
//# sourceMappingURL=selector.js.map
|
package/lib/selector.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"selector.js","sourceRoot":"","sources":["../src/selector.ts"],"names":[],"mappings":";;AACA,2CAAwC;AAExC,MAAa,QAAQ;IACnB,YAA6B,KAAkB;QAAlB,UAAK,GAAL,KAAK,CAAa;IAAG,CAAC;IAEnD,IAAI,KAAK;QACP,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAS,CAAC,CAAC;QACpC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,GAAG,CAAC,GAAwB;QAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;CACF;AAXD,4BAWC"}
|
package/lib/service.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../src/service.ts"],"names":[],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