agc-api-cli 1.0.0
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 +109 -0
- package/dist/chunk-CSXIZ7GI.mjs +411 -0
- package/dist/chunk-CSXIZ7GI.mjs.map +1 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +981 -0
- package/dist/cli.js.map +1 -0
- package/dist/cli.mjs +562 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/index.d.mts +347 -0
- package/dist/index.d.ts +347 -0
- package/dist/index.js +455 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +17 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +35 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import * as axios from 'axios';
|
|
2
|
+
|
|
3
|
+
interface ConnectRet {
|
|
4
|
+
code: number;
|
|
5
|
+
msg: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface TokenResponse {
|
|
9
|
+
access_token?: string;
|
|
10
|
+
expires_in?: number;
|
|
11
|
+
ret?: ConnectRet;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare class AuthService {
|
|
15
|
+
/**
|
|
16
|
+
* 获取访问API的Token
|
|
17
|
+
*/
|
|
18
|
+
static getToken(): Promise<TokenResponse>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface AppIdPair {
|
|
22
|
+
key: string;
|
|
23
|
+
value: string;
|
|
24
|
+
}
|
|
25
|
+
interface AppIdListResponse {
|
|
26
|
+
ret: ConnectRet;
|
|
27
|
+
appids?: AppIdPair[];
|
|
28
|
+
}
|
|
29
|
+
interface AppInfoResponse {
|
|
30
|
+
ret: ConnectRet;
|
|
31
|
+
appInfo?: Record<string, any>;
|
|
32
|
+
auditInfo?: Record<string, any>;
|
|
33
|
+
languages?: Array<Record<string, any>>;
|
|
34
|
+
phasedReleaseInfo?: Record<string, any>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
declare class PublishService {
|
|
38
|
+
/**
|
|
39
|
+
* 查询应用包名对应的appid
|
|
40
|
+
* @param packageName 需要查询的应用包名,多个包名以逗号分隔,最多支持50个
|
|
41
|
+
*/
|
|
42
|
+
static getAppIdList(packageName: string): Promise<AppIdListResponse>;
|
|
43
|
+
/**
|
|
44
|
+
* 查询应用信息
|
|
45
|
+
* @param appId 需要查询的应用ID
|
|
46
|
+
* @param lang 需要查询的语言 (例如: 'zh-CN'),不传则查询全部语言
|
|
47
|
+
*/
|
|
48
|
+
static getAppInfo(appId: string, lang?: string): Promise<AppInfoResponse>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface CommonUrlInfo {
|
|
52
|
+
url: string;
|
|
53
|
+
method: string;
|
|
54
|
+
headers: Record<string, string>;
|
|
55
|
+
}
|
|
56
|
+
interface FilePartUploadInfo {
|
|
57
|
+
url: string;
|
|
58
|
+
method: string;
|
|
59
|
+
headers: Record<string, string>;
|
|
60
|
+
partObjectId?: string;
|
|
61
|
+
}
|
|
62
|
+
interface FilePartInfo {
|
|
63
|
+
length: number;
|
|
64
|
+
sha256?: string;
|
|
65
|
+
}
|
|
66
|
+
interface FilePartComposeInfo {
|
|
67
|
+
partObjectId: string;
|
|
68
|
+
etag: string;
|
|
69
|
+
}
|
|
70
|
+
interface UploadUrlRequest {
|
|
71
|
+
appId: string;
|
|
72
|
+
fileName: string;
|
|
73
|
+
contentLength: number;
|
|
74
|
+
sha256?: string;
|
|
75
|
+
releaseType?: number;
|
|
76
|
+
chineseMainlandFlag?: number;
|
|
77
|
+
}
|
|
78
|
+
interface UploadUrlResponse {
|
|
79
|
+
ret: ConnectRet;
|
|
80
|
+
urlInfo?: CommonUrlInfo;
|
|
81
|
+
}
|
|
82
|
+
interface MultipartInitRequest {
|
|
83
|
+
appId: string;
|
|
84
|
+
fileName: string;
|
|
85
|
+
releaseType?: number;
|
|
86
|
+
chineseMainlandFlag?: number;
|
|
87
|
+
}
|
|
88
|
+
interface MultipartInitResponse {
|
|
89
|
+
ret: ConnectRet;
|
|
90
|
+
objectId?: string;
|
|
91
|
+
nspUploadId?: string;
|
|
92
|
+
nspPartMinSize?: number | string;
|
|
93
|
+
nspPartMaxSize?: number | string;
|
|
94
|
+
}
|
|
95
|
+
interface MultipartPartsRequest {
|
|
96
|
+
objectId: string;
|
|
97
|
+
nspUploadId: string;
|
|
98
|
+
parts: Record<string, FilePartInfo>;
|
|
99
|
+
}
|
|
100
|
+
interface MultipartPartsResponse {
|
|
101
|
+
ret: ConnectRet;
|
|
102
|
+
uploadInfoMap?: Record<string, FilePartUploadInfo>;
|
|
103
|
+
}
|
|
104
|
+
interface MultipartComposeRequest {
|
|
105
|
+
objectId: string;
|
|
106
|
+
nspUploadId: string;
|
|
107
|
+
parts: Record<string, FilePartComposeInfo>;
|
|
108
|
+
}
|
|
109
|
+
interface MultipartComposeResponse {
|
|
110
|
+
ret: ConnectRet;
|
|
111
|
+
}
|
|
112
|
+
interface UploadFileOptions {
|
|
113
|
+
appId: string;
|
|
114
|
+
filePath: string;
|
|
115
|
+
releaseType?: number;
|
|
116
|
+
chineseMainlandFlag?: number;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
declare class UploadService {
|
|
120
|
+
static getUploadUrl(req: UploadUrlRequest): Promise<UploadUrlResponse>;
|
|
121
|
+
static initMultipart(req: MultipartInitRequest): Promise<MultipartInitResponse>;
|
|
122
|
+
static getMultipartParts(req: MultipartPartsRequest): Promise<MultipartPartsResponse>;
|
|
123
|
+
static composeMultipart(req: MultipartComposeRequest): Promise<MultipartComposeResponse>;
|
|
124
|
+
/**
|
|
125
|
+
* 封装好的上传文件核心流程(支持根据文件大小自动单文件或分片上传)
|
|
126
|
+
* 文件大小 < 5MB 时使用单文件上传,否则使用分片上传
|
|
127
|
+
*/
|
|
128
|
+
static uploadFile(options: UploadFileOptions): Promise<void>;
|
|
129
|
+
/**
|
|
130
|
+
* 单文件上传流程
|
|
131
|
+
*/
|
|
132
|
+
private static uploadSingleFile;
|
|
133
|
+
/**
|
|
134
|
+
* 分片上传流程
|
|
135
|
+
*/
|
|
136
|
+
private static uploadMultipartFile;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
interface CertInfo {
|
|
140
|
+
id?: string;
|
|
141
|
+
certName?: string;
|
|
142
|
+
certType?: number;
|
|
143
|
+
createTime?: number;
|
|
144
|
+
expireTime?: number;
|
|
145
|
+
certDownloadUrl?: string;
|
|
146
|
+
}
|
|
147
|
+
interface CertCreateRequest {
|
|
148
|
+
csr: string;
|
|
149
|
+
certName: string;
|
|
150
|
+
certType: number;
|
|
151
|
+
}
|
|
152
|
+
interface CertCreateResponse {
|
|
153
|
+
ret: ConnectRet;
|
|
154
|
+
certInfo?: CertInfo;
|
|
155
|
+
}
|
|
156
|
+
interface CertListRequest {
|
|
157
|
+
certType?: number;
|
|
158
|
+
certIds?: string[];
|
|
159
|
+
}
|
|
160
|
+
interface CertListResponse {
|
|
161
|
+
ret: ConnectRet;
|
|
162
|
+
certList?: CertInfo[];
|
|
163
|
+
}
|
|
164
|
+
interface CertDeleteRequest {
|
|
165
|
+
certIds: string[];
|
|
166
|
+
}
|
|
167
|
+
interface CertDeleteResponse {
|
|
168
|
+
ret: ConnectRet;
|
|
169
|
+
}
|
|
170
|
+
interface AddDeviceInfo {
|
|
171
|
+
deviceName: string;
|
|
172
|
+
udid: string;
|
|
173
|
+
deviceType: number;
|
|
174
|
+
}
|
|
175
|
+
interface AddDeviceResult {
|
|
176
|
+
addDeviceInfo?: AddDeviceInfo;
|
|
177
|
+
result?: ConnectRet;
|
|
178
|
+
}
|
|
179
|
+
interface DeviceInfo {
|
|
180
|
+
id?: string;
|
|
181
|
+
deviceName?: string;
|
|
182
|
+
udid?: string;
|
|
183
|
+
deviceType?: number;
|
|
184
|
+
createTime?: string;
|
|
185
|
+
}
|
|
186
|
+
interface DeviceAddRequest {
|
|
187
|
+
deviceList: AddDeviceInfo[];
|
|
188
|
+
}
|
|
189
|
+
interface DeviceAddResponse {
|
|
190
|
+
ret: ConnectRet;
|
|
191
|
+
successedCount: number;
|
|
192
|
+
failedCount: number;
|
|
193
|
+
failedAddDeviceDetail?: AddDeviceResult[];
|
|
194
|
+
}
|
|
195
|
+
interface DeviceListRequest {
|
|
196
|
+
deviceName?: string;
|
|
197
|
+
fromRecCount?: number;
|
|
198
|
+
maxReqCount?: number;
|
|
199
|
+
order?: number;
|
|
200
|
+
}
|
|
201
|
+
interface DeviceListResponse {
|
|
202
|
+
ret: ConnectRet;
|
|
203
|
+
totalCount: number;
|
|
204
|
+
deviceList?: DeviceInfo[];
|
|
205
|
+
}
|
|
206
|
+
interface DeviceDeleteRequest {
|
|
207
|
+
deviceIdList: string[];
|
|
208
|
+
}
|
|
209
|
+
interface DeviceDeleteResponse {
|
|
210
|
+
ret: ConnectRet;
|
|
211
|
+
}
|
|
212
|
+
interface ProvisionInfo {
|
|
213
|
+
id?: string;
|
|
214
|
+
provisionName?: string;
|
|
215
|
+
provisionType?: number;
|
|
216
|
+
certName?: string;
|
|
217
|
+
deviceList?: DeviceInfo[];
|
|
218
|
+
aclPermissionList?: string[];
|
|
219
|
+
aclPermissionAuditState?: number;
|
|
220
|
+
provisionDownloadUrl?: string;
|
|
221
|
+
updateTime?: number;
|
|
222
|
+
expireTime?: number;
|
|
223
|
+
appId?: string;
|
|
224
|
+
tempFlag?: number;
|
|
225
|
+
}
|
|
226
|
+
interface ProvisionCreateRequest {
|
|
227
|
+
provisionName: string;
|
|
228
|
+
provisionType: number;
|
|
229
|
+
certId: string;
|
|
230
|
+
appId: string;
|
|
231
|
+
deviceIdList?: string[];
|
|
232
|
+
aclPermissionList?: string[];
|
|
233
|
+
}
|
|
234
|
+
interface ProvisionCreateResponse {
|
|
235
|
+
ret: ConnectRet;
|
|
236
|
+
provisionInfo?: ProvisionInfo;
|
|
237
|
+
}
|
|
238
|
+
interface ProvisionListRequest {
|
|
239
|
+
appId: string;
|
|
240
|
+
provisionId?: string;
|
|
241
|
+
fromRecCount?: number;
|
|
242
|
+
maxReqCount?: number;
|
|
243
|
+
}
|
|
244
|
+
interface ProvisionListResponse {
|
|
245
|
+
ret: ConnectRet;
|
|
246
|
+
totalCount?: number;
|
|
247
|
+
provisionList?: ProvisionInfo[];
|
|
248
|
+
}
|
|
249
|
+
interface ProvisionUpdateRequest {
|
|
250
|
+
provisionId: string;
|
|
251
|
+
deviceIdList: string[];
|
|
252
|
+
}
|
|
253
|
+
interface ProvisionUpdateResponse {
|
|
254
|
+
ret: ConnectRet;
|
|
255
|
+
provisionInfo?: ProvisionInfo;
|
|
256
|
+
}
|
|
257
|
+
interface ProvisionDeleteRequest {
|
|
258
|
+
id: string;
|
|
259
|
+
}
|
|
260
|
+
interface ProvisionDeleteResponse {
|
|
261
|
+
ret: ConnectRet;
|
|
262
|
+
}
|
|
263
|
+
interface FingerprintAddRequest {
|
|
264
|
+
appId: string;
|
|
265
|
+
fingerprintList: string[];
|
|
266
|
+
}
|
|
267
|
+
interface FingerprintAddResponse {
|
|
268
|
+
ret: ConnectRet;
|
|
269
|
+
}
|
|
270
|
+
interface FingerprintListRequest {
|
|
271
|
+
appId: string;
|
|
272
|
+
}
|
|
273
|
+
interface FingerprintListResponse {
|
|
274
|
+
ret: ConnectRet;
|
|
275
|
+
fingerprintList: string[];
|
|
276
|
+
}
|
|
277
|
+
interface FingerprintDeleteRequest {
|
|
278
|
+
appId: string;
|
|
279
|
+
fingerprintList: string[];
|
|
280
|
+
}
|
|
281
|
+
interface FingerprintDeleteResponse {
|
|
282
|
+
ret: ConnectRet;
|
|
283
|
+
}
|
|
284
|
+
interface OpenApplyPermissionInfo {
|
|
285
|
+
name: string;
|
|
286
|
+
reason: string;
|
|
287
|
+
}
|
|
288
|
+
interface OpenApplyPermissionStatusInfo {
|
|
289
|
+
name?: string;
|
|
290
|
+
status?: number;
|
|
291
|
+
}
|
|
292
|
+
interface UserPermission {
|
|
293
|
+
aclPermissionList?: string;
|
|
294
|
+
createTime?: number;
|
|
295
|
+
updateTime?: number;
|
|
296
|
+
}
|
|
297
|
+
interface ACLApplyRequest {
|
|
298
|
+
appId: string;
|
|
299
|
+
aclPermissionList: OpenApplyPermissionInfo[];
|
|
300
|
+
attachment?: string;
|
|
301
|
+
}
|
|
302
|
+
interface ACLApplyResponse {
|
|
303
|
+
ret: ConnectRet;
|
|
304
|
+
}
|
|
305
|
+
interface ACLStatusRequest {
|
|
306
|
+
appId: string;
|
|
307
|
+
}
|
|
308
|
+
interface ACLStatusResponse {
|
|
309
|
+
aclPermissionList?: OpenApplyPermissionStatusInfo[];
|
|
310
|
+
}
|
|
311
|
+
interface ACLQueryRequest {
|
|
312
|
+
appId: string;
|
|
313
|
+
}
|
|
314
|
+
interface ACLQueryResponse {
|
|
315
|
+
ret: ConnectRet;
|
|
316
|
+
userPermission?: UserPermission;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
declare class ProvisionService {
|
|
320
|
+
static createCert(req: CertCreateRequest): Promise<CertCreateResponse>;
|
|
321
|
+
static getCertList(req: CertListRequest): Promise<CertListResponse>;
|
|
322
|
+
static deleteCert(req: CertDeleteRequest): Promise<CertDeleteResponse>;
|
|
323
|
+
static addDevice(req: DeviceAddRequest): Promise<DeviceAddResponse>;
|
|
324
|
+
static getDeviceList(req: DeviceListRequest): Promise<DeviceListResponse>;
|
|
325
|
+
static deleteDevice(req: DeviceDeleteRequest): Promise<DeviceDeleteResponse>;
|
|
326
|
+
static createProvision(req: ProvisionCreateRequest): Promise<ProvisionCreateResponse>;
|
|
327
|
+
static getProvisionList(req: ProvisionListRequest): Promise<ProvisionListResponse>;
|
|
328
|
+
static updateProvision(req: ProvisionUpdateRequest): Promise<ProvisionUpdateResponse>;
|
|
329
|
+
static deleteProvision(req: ProvisionDeleteRequest): Promise<ProvisionDeleteResponse>;
|
|
330
|
+
static addFingerprint(req: FingerprintAddRequest): Promise<FingerprintAddResponse>;
|
|
331
|
+
static getFingerprintList(req: FingerprintListRequest): Promise<FingerprintListResponse>;
|
|
332
|
+
static deleteFingerprint(req: FingerprintDeleteRequest): Promise<FingerprintDeleteResponse>;
|
|
333
|
+
static applyACL(req: ACLApplyRequest): Promise<ACLApplyResponse>;
|
|
334
|
+
static getACLStatus(req: ACLStatusRequest): Promise<ACLStatusResponse>;
|
|
335
|
+
static getACLQuery(req: ACLQueryRequest): Promise<ACLQueryResponse>;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
declare const agcClient: axios.AxiosInstance;
|
|
339
|
+
|
|
340
|
+
interface AgcConfig {
|
|
341
|
+
clientId: string;
|
|
342
|
+
clientSecret: string;
|
|
343
|
+
domain: string;
|
|
344
|
+
}
|
|
345
|
+
declare function getConfig(): AgcConfig;
|
|
346
|
+
|
|
347
|
+
export { type AgcConfig, AuthService, ProvisionService, PublishService, UploadService, agcClient, getConfig };
|