@freelog/tools-lib 0.1.80 → 0.1.83
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/dist/service-API/activities.d.ts +8 -0
- package/dist/service-API/index.d.ts +2 -0
- package/dist/service-API/resources.d.ts +56 -4
- package/dist/service-API/tools/index.d.ts +5 -0
- package/dist/tools-lib.cjs.development.js +133 -78
- package/dist/tools-lib.cjs.development.js.map +1 -1
- package/dist/tools-lib.cjs.production.min.js +1 -1
- package/dist/tools-lib.cjs.production.min.js.map +1 -1
- package/dist/tools-lib.esm.js +133 -78
- package/dist/tools-lib.esm.js.map +1 -1
- package/dist/utils/linkTo.d.ts +31 -4
- package/package.json +1 -1
- package/src/service-API/activities.ts +26 -0
- package/src/service-API/captcha.ts +30 -30
- package/src/service-API/contracts.ts +84 -84
- package/src/service-API/index.ts +29 -27
- package/src/service-API/informalNodes.ts +237 -237
- package/src/service-API/nodes.ts +65 -65
- package/src/service-API/presentables.ts +282 -282
- package/src/service-API/resources.ts +496 -439
- package/src/service-API/storages.ts +345 -345
- package/src/service-API/tools/index.ts +5 -0
- package/src/service-API/transactions.ts +109 -109
- package/src/service-API/user.ts +188 -188
- package/src/utils/linkTo.ts +60 -14
- package/src/utils/predefined.ts +37 -37
package/src/utils/linkTo.ts
CHANGED
|
@@ -2,6 +2,46 @@ import * as querystring from 'querystring';
|
|
|
2
2
|
|
|
3
3
|
type TReturnType = string;
|
|
4
4
|
|
|
5
|
+
/************** www Start ******************************************************/
|
|
6
|
+
// 首页
|
|
7
|
+
interface HomeParamsType {
|
|
8
|
+
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function home({}: HomeParamsType = {}) {
|
|
12
|
+
return `/home`;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// 活动列表
|
|
16
|
+
interface ActivitiesParamsType {
|
|
17
|
+
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function activities({}: ActivitiesParamsType = {}) {
|
|
21
|
+
return `/activity`;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// 活动详情
|
|
25
|
+
interface ActivitiesParamsType {
|
|
26
|
+
activityID: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function activity({activityID}: ActivitiesParamsType) {
|
|
30
|
+
return `/activityDetail/${activityID}`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/************** www End ******************************************************/
|
|
34
|
+
|
|
35
|
+
/************** console Start ******************************************************/
|
|
36
|
+
// dashboard
|
|
37
|
+
interface DashboardParamsType {
|
|
38
|
+
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function dashboard({}: DashboardParamsType = {}) {
|
|
42
|
+
return `/dashboard`;
|
|
43
|
+
}
|
|
44
|
+
|
|
5
45
|
// 市场
|
|
6
46
|
interface MarketParamsType {
|
|
7
47
|
// nodeID: number;
|
|
@@ -197,6 +237,10 @@ export function exception403({...params}: Exception403ParamsType = {}) {
|
|
|
197
237
|
})}`;
|
|
198
238
|
}
|
|
199
239
|
|
|
240
|
+
/************** console End ******************************************************/
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
/************** user Start ******************************************************/
|
|
200
244
|
// 登录
|
|
201
245
|
interface LoginParamsType {
|
|
202
246
|
goTo?: string;
|
|
@@ -231,37 +275,40 @@ export function retrieveUserPassword({goTo}: RetrieveUserPasswordParamsType = {}
|
|
|
231
275
|
}
|
|
232
276
|
|
|
233
277
|
// 找回支付密码
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
278
|
+
interface RetrievePayPasswordParamsType {
|
|
279
|
+
goTo?: string;
|
|
280
|
+
}
|
|
237
281
|
|
|
238
|
-
export function retrievePayPassword() {
|
|
282
|
+
export function retrievePayPassword({}: RetrievePayPasswordParamsType = {}) {
|
|
239
283
|
return `/retrievePayPassword`;
|
|
240
284
|
}
|
|
241
285
|
|
|
242
286
|
// 我的钱包
|
|
243
|
-
|
|
244
|
-
|
|
287
|
+
interface WalletParamsType {
|
|
288
|
+
}
|
|
245
289
|
|
|
246
|
-
export function wallet() {
|
|
290
|
+
export function wallet({}: WalletParamsType = {}) {
|
|
247
291
|
return `/logged/wallet`;
|
|
248
292
|
}
|
|
249
293
|
|
|
250
294
|
// 我的合约
|
|
251
|
-
|
|
252
|
-
|
|
295
|
+
interface ContractParamsType {
|
|
296
|
+
}
|
|
253
297
|
|
|
254
|
-
export function contract() {
|
|
298
|
+
export function contract({}: ContractParamsType = {}) {
|
|
255
299
|
return `/logged/contract`;
|
|
256
300
|
}
|
|
257
301
|
|
|
258
302
|
// 个人设置
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
303
|
+
interface SettingParamsType {
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export function setting({}: SettingParamsType = {}) {
|
|
262
307
|
return `/logged/setting`;
|
|
263
308
|
}
|
|
264
309
|
|
|
310
|
+
/************** user End ******************************************************/
|
|
311
|
+
|
|
265
312
|
function handleQuery(query: object): string {
|
|
266
313
|
const obj: any = {};
|
|
267
314
|
for (const [key, value] of Object.entries(query)) {
|
|
@@ -274,4 +321,3 @@ function handleQuery(query: object): string {
|
|
|
274
321
|
}
|
|
275
322
|
|
|
276
323
|
|
|
277
|
-
|
package/src/utils/predefined.ts
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
// export const apiHost = `${window.location.protocol}//qi.${(window.location.host.match(/(?<=\.).*/) || [''])[0]}`;
|
|
2
|
-
|
|
3
|
-
// 预设资源类型
|
|
4
|
-
export const resourceTypes: string[] = ['json', 'widget', 'image', 'audio', 'markdown', 'theme', 'reveal_slide', 'license', 'video', 'catalog'];
|
|
5
|
-
|
|
6
|
-
// 全局列表加载条目数
|
|
7
|
-
export const pageSize: number = 100;
|
|
8
|
-
|
|
9
|
-
// Moment 日期时间格式
|
|
10
|
-
export const momentDateFormat: string = 'YYYY-MM-DD'
|
|
11
|
-
export const momentDateTimeFormat: string = 'YYYY-MM-DD HH:mm';
|
|
12
|
-
|
|
13
|
-
// 签约方用户的身份类型定义
|
|
14
|
-
export enum EnumContractPartyIdentityType {
|
|
15
|
-
resource = 1,
|
|
16
|
-
node,
|
|
17
|
-
consumer,
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// 标的物类型定义
|
|
21
|
-
export enum EnumSubjectType {
|
|
22
|
-
resource = 1,
|
|
23
|
-
exhibit,
|
|
24
|
-
user,
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// 合约状态定义
|
|
28
|
-
export enum EnumContractStatus {
|
|
29
|
-
pending,
|
|
30
|
-
authorized,
|
|
31
|
-
stopped,
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// 合约授权状态定义
|
|
35
|
-
// export enum ContractAuthStatus {
|
|
36
|
-
//
|
|
37
|
-
// }
|
|
1
|
+
// export const apiHost = `${window.location.protocol}//qi.${(window.location.host.match(/(?<=\.).*/) || [''])[0]}`;
|
|
2
|
+
|
|
3
|
+
// 预设资源类型
|
|
4
|
+
export const resourceTypes: string[] = ['json', 'widget', 'image', 'audio', 'markdown', 'theme', 'reveal_slide', 'license', 'video', 'catalog'];
|
|
5
|
+
|
|
6
|
+
// 全局列表加载条目数
|
|
7
|
+
export const pageSize: number = 100;
|
|
8
|
+
|
|
9
|
+
// Moment 日期时间格式
|
|
10
|
+
export const momentDateFormat: string = 'YYYY-MM-DD'
|
|
11
|
+
export const momentDateTimeFormat: string = 'YYYY-MM-DD HH:mm';
|
|
12
|
+
|
|
13
|
+
// 签约方用户的身份类型定义
|
|
14
|
+
export enum EnumContractPartyIdentityType {
|
|
15
|
+
resource = 1,
|
|
16
|
+
node,
|
|
17
|
+
consumer,
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// 标的物类型定义
|
|
21
|
+
export enum EnumSubjectType {
|
|
22
|
+
resource = 1,
|
|
23
|
+
exhibit,
|
|
24
|
+
user,
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// 合约状态定义
|
|
28
|
+
export enum EnumContractStatus {
|
|
29
|
+
pending,
|
|
30
|
+
authorized,
|
|
31
|
+
stopped,
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// 合约授权状态定义
|
|
35
|
+
// export enum ContractAuthStatus {
|
|
36
|
+
//
|
|
37
|
+
// }
|