@freelog/tools-lib 0.1.78 → 0.1.82
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 +61 -6
- 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 +61 -6
- package/dist/tools-lib.esm.js.map +1 -1
- package/dist/utils/regexp.d.ts +2 -0
- package/dist/utils/tools.d.ts +9 -0
- 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 +276 -275
- package/src/utils/predefined.ts +37 -37
- package/src/utils/regexp.ts +52 -46
- package/src/utils/tools.ts +31 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface List4ClientParamsType {
|
|
2
|
+
}
|
|
3
|
+
export declare function list4Client(params: List4ClientParamsType): Promise<any>;
|
|
4
|
+
interface Find4ClientParamsType {
|
|
5
|
+
_id: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function find4Client(params: Find4ClientParamsType): Promise<any>;
|
|
8
|
+
export {};
|
|
@@ -9,6 +9,7 @@ import * as Contract from './contracts';
|
|
|
9
9
|
import * as Transaction from './transactions';
|
|
10
10
|
import * as Captcha from './captcha';
|
|
11
11
|
import * as Event from './events';
|
|
12
|
+
import * as Activity from './activities';
|
|
12
13
|
declare const FServiceAPI: {
|
|
13
14
|
Node: typeof Node;
|
|
14
15
|
Exhibit: typeof Exhibit;
|
|
@@ -21,5 +22,6 @@ declare const FServiceAPI: {
|
|
|
21
22
|
Transaction: typeof Transaction;
|
|
22
23
|
Captcha: typeof Captcha;
|
|
23
24
|
Event: typeof Event;
|
|
25
|
+
Activity: typeof Activity;
|
|
24
26
|
};
|
|
25
27
|
export default FServiceAPI;
|
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
import { CommonReturn } from "./tools";
|
|
2
|
+
interface IResourceInfo {
|
|
3
|
+
baseUpcastResources: {
|
|
4
|
+
resourceId: string;
|
|
5
|
+
resourceName: string;
|
|
6
|
+
}[];
|
|
7
|
+
coverImages: string[];
|
|
8
|
+
createDate: string;
|
|
9
|
+
intro: string;
|
|
10
|
+
latestVersion: string;
|
|
11
|
+
policies: {
|
|
12
|
+
policyId: string;
|
|
13
|
+
policyName: string;
|
|
14
|
+
status: 0 | 1;
|
|
15
|
+
}[];
|
|
16
|
+
resourceId: string;
|
|
17
|
+
resourceName: string;
|
|
18
|
+
resourceType: string;
|
|
19
|
+
resourceVersions: {
|
|
20
|
+
createDate: string;
|
|
21
|
+
version: string;
|
|
22
|
+
versionId: string;
|
|
23
|
+
}[];
|
|
24
|
+
status: 0 | 1 | 2 | 3;
|
|
25
|
+
tags: string[];
|
|
26
|
+
updateDate: string;
|
|
27
|
+
userId: number;
|
|
28
|
+
username: string;
|
|
29
|
+
}
|
|
1
30
|
export interface CreateParamsType {
|
|
2
31
|
name: string;
|
|
3
32
|
resourceType: string;
|
|
@@ -36,7 +65,10 @@ interface ListParamsType {
|
|
|
36
65
|
isLoadLatestVersionInfo?: 0 | 1;
|
|
37
66
|
projection?: string;
|
|
38
67
|
}
|
|
39
|
-
|
|
68
|
+
interface ListReturnType extends CommonReturn {
|
|
69
|
+
data: IResourceInfo[];
|
|
70
|
+
}
|
|
71
|
+
export declare function list(params: ListParamsType): Promise<ListReturnType>;
|
|
40
72
|
interface InfoParamsType {
|
|
41
73
|
resourceIdOrName: string;
|
|
42
74
|
isLoadPolicyInfo?: 0 | 1;
|
|
@@ -44,7 +76,10 @@ interface InfoParamsType {
|
|
|
44
76
|
isLoadLatestVersionInfo?: 0 | 1;
|
|
45
77
|
projection?: string;
|
|
46
78
|
}
|
|
47
|
-
|
|
79
|
+
interface InfoReturnType extends CommonReturn {
|
|
80
|
+
data: IResourceInfo;
|
|
81
|
+
}
|
|
82
|
+
export declare function info({ resourceIdOrName, ...params }: InfoParamsType): Promise<InfoReturnType>;
|
|
48
83
|
interface BatchInfoParamsType {
|
|
49
84
|
resourceIds?: string;
|
|
50
85
|
resourceNames?: string;
|
|
@@ -53,7 +88,10 @@ interface BatchInfoParamsType {
|
|
|
53
88
|
isLoadLatestVersionInfo?: 0 | 1;
|
|
54
89
|
projection?: string;
|
|
55
90
|
}
|
|
56
|
-
|
|
91
|
+
interface BatchInfoReturnType extends CommonReturn {
|
|
92
|
+
data: IResourceInfo[];
|
|
93
|
+
}
|
|
94
|
+
export declare function batchInfo(params: BatchInfoParamsType): Promise<BatchInfoReturnType>;
|
|
57
95
|
interface DependencyTreeParamsType {
|
|
58
96
|
resourceId: string;
|
|
59
97
|
version?: string;
|
|
@@ -160,7 +198,21 @@ export declare function batchGetCoverageVersions({ resourceId, ...params }: Batc
|
|
|
160
198
|
interface ResolveResourcesParamsType {
|
|
161
199
|
resourceId: string;
|
|
162
200
|
}
|
|
163
|
-
|
|
201
|
+
interface CreateVersionReturnType extends CommonReturn {
|
|
202
|
+
data: {
|
|
203
|
+
resourceId: string;
|
|
204
|
+
resourceName: string;
|
|
205
|
+
versions: {
|
|
206
|
+
version: string;
|
|
207
|
+
versionId: string;
|
|
208
|
+
contracts: {
|
|
209
|
+
policyId: string;
|
|
210
|
+
contractId: string;
|
|
211
|
+
}[];
|
|
212
|
+
}[];
|
|
213
|
+
}[];
|
|
214
|
+
}
|
|
215
|
+
export declare function resolveResources(params: ResolveResourcesParamsType): Promise<CreateVersionReturnType>;
|
|
164
216
|
interface BatchSetContractsParamsType {
|
|
165
217
|
resourceId: string;
|
|
166
218
|
subjects: {
|
|
@@ -984,7 +984,11 @@ var USERNAME = /*#__PURE__*/new RegExp(/^([A-Za-z0-9][A-Za-z0-9-]{0,28})?[A-Za-z
|
|
|
984
984
|
|
|
985
985
|
var PASSWORD = /*#__PURE__*/new RegExp(/^(?=.*[0-9])(?=.*[a-zA-Z])(.{6,24})$/); // 自然数
|
|
986
986
|
|
|
987
|
-
var NATURAL_NUMBER = /*#__PURE__*/new RegExp(/^[0-9]*$/); //
|
|
987
|
+
var NATURAL_NUMBER = /*#__PURE__*/new RegExp(/^[0-9]*$/); // 正整数
|
|
988
|
+
|
|
989
|
+
var POSITIVE_INTEGER = /*#__PURE__*/new RegExp(/^[1-9]\d*$/); // 最多两位小数的正数
|
|
990
|
+
|
|
991
|
+
var MAX_2_DECIMAL_POSITIVE_NUMBER = /*#__PURE__*/new RegExp(/^\d+(.\d{1,2})?$/); // 对象的Bucket名称
|
|
988
992
|
|
|
989
993
|
var BUCKET_NAME = /*#__PURE__*/new RegExp(/^([a-z0-9][a-z0-9-]{0,61})?[a-z0-9]$/); // JS变量名称
|
|
990
994
|
|
|
@@ -1004,6 +1008,8 @@ var Regexp = {
|
|
|
1004
1008
|
USERNAME: USERNAME,
|
|
1005
1009
|
PASSWORD: PASSWORD,
|
|
1006
1010
|
NATURAL_NUMBER: NATURAL_NUMBER,
|
|
1011
|
+
POSITIVE_INTEGER: POSITIVE_INTEGER,
|
|
1012
|
+
MAX_2_DECIMAL_POSITIVE_NUMBER: MAX_2_DECIMAL_POSITIVE_NUMBER,
|
|
1007
1013
|
BUCKET_NAME: BUCKET_NAME,
|
|
1008
1014
|
JS_VARIABLE_NAME: JS_VARIABLE_NAME
|
|
1009
1015
|
};
|
|
@@ -1161,18 +1167,20 @@ function retrieveUserPassword(_temp10) {
|
|
|
1161
1167
|
|
|
1162
1168
|
function retrievePayPassword() {
|
|
1163
1169
|
return "/retrievePayPassword";
|
|
1164
|
-
} //
|
|
1170
|
+
} // 我的钱包
|
|
1165
1171
|
// interface WalletParamsType {
|
|
1166
1172
|
// }
|
|
1167
1173
|
|
|
1168
1174
|
function wallet() {
|
|
1169
1175
|
return "/logged/wallet";
|
|
1170
|
-
} //
|
|
1176
|
+
} // 我的合约
|
|
1177
|
+
// interface ContractParamsType {
|
|
1171
1178
|
// }
|
|
1172
1179
|
|
|
1173
1180
|
function contract() {
|
|
1174
1181
|
return "/logged/contract";
|
|
1175
|
-
} //
|
|
1182
|
+
} // 个人设置
|
|
1183
|
+
// interface SettingParamsType {
|
|
1176
1184
|
// }
|
|
1177
1185
|
|
|
1178
1186
|
function setting() {
|
|
@@ -1478,12 +1486,37 @@ function getUserIDByCookies() {
|
|
|
1478
1486
|
|
|
1479
1487
|
return Number(uid.replace('uid=', ''));
|
|
1480
1488
|
}
|
|
1489
|
+
function transformServerAPIContractState(_ref) {
|
|
1490
|
+
var status = _ref.status,
|
|
1491
|
+
authStatus = _ref.authStatus;
|
|
1492
|
+
|
|
1493
|
+
if (status === 0) {
|
|
1494
|
+
if (authStatus === 1 || authStatus === 3) {
|
|
1495
|
+
return 'active';
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
if (authStatus === 2) {
|
|
1499
|
+
return 'testActive';
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
if (authStatus === 128) {
|
|
1503
|
+
return 'inactive';
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
if (status === 1) {
|
|
1508
|
+
return 'terminal';
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
return 'exception';
|
|
1512
|
+
}
|
|
1481
1513
|
|
|
1482
1514
|
var Tool = {
|
|
1483
1515
|
__proto__: null,
|
|
1484
1516
|
getSHA1Hash: getSHA1Hash,
|
|
1485
1517
|
generateRandomCode: generateRandomCode,
|
|
1486
|
-
getUserIDByCookies: getUserIDByCookies
|
|
1518
|
+
getUserIDByCookies: getUserIDByCookies,
|
|
1519
|
+
transformServerAPIContractState: transformServerAPIContractState
|
|
1487
1520
|
};
|
|
1488
1521
|
|
|
1489
1522
|
var FUtil = {
|
|
@@ -2749,6 +2782,27 @@ var Event = {
|
|
|
2749
2782
|
transaction: transaction
|
|
2750
2783
|
};
|
|
2751
2784
|
|
|
2785
|
+
function list4Client(params) {
|
|
2786
|
+
return FUtil.Request({
|
|
2787
|
+
method: 'GET',
|
|
2788
|
+
url: "/v2/activities/list4Client",
|
|
2789
|
+
params: params
|
|
2790
|
+
});
|
|
2791
|
+
}
|
|
2792
|
+
function find4Client(params) {
|
|
2793
|
+
return FUtil.Request({
|
|
2794
|
+
method: 'GET',
|
|
2795
|
+
url: "/v2/activities/find4Client",
|
|
2796
|
+
params: params
|
|
2797
|
+
});
|
|
2798
|
+
}
|
|
2799
|
+
|
|
2800
|
+
var Activity = {
|
|
2801
|
+
__proto__: null,
|
|
2802
|
+
list4Client: list4Client,
|
|
2803
|
+
find4Client: find4Client
|
|
2804
|
+
};
|
|
2805
|
+
|
|
2752
2806
|
var FServiceAPI = {
|
|
2753
2807
|
Node: Node,
|
|
2754
2808
|
Exhibit: Exhibit,
|
|
@@ -2760,7 +2814,8 @@ var FServiceAPI = {
|
|
|
2760
2814
|
Contract: Contract,
|
|
2761
2815
|
Transaction: Transaction,
|
|
2762
2816
|
Captcha: Captcha,
|
|
2763
|
-
Event: Event
|
|
2817
|
+
Event: Event,
|
|
2818
|
+
Activity: Activity
|
|
2764
2819
|
};
|
|
2765
2820
|
|
|
2766
2821
|
exports.FServiceAPI = FServiceAPI;
|