@jctrans-materials/shared 1.0.40-beta.10 → 1.0.40-beta.12

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/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import { Emitter } from 'mitt';
3
3
 
4
4
  declare type ActionKeys = (typeof MODAL_ACTION)[keyof typeof MODAL_ACTION];
5
5
 
6
- declare interface ApiResponse<T = any> {
6
+ export declare interface ApiResponse<T = any> {
7
7
  code: number;
8
8
  msg: string;
9
9
  data: T;
@@ -16,10 +16,6 @@ export declare interface AppointSearch {
16
16
 
17
17
  export declare type AppointSearchName = "continentId" | "countryId" | "cityId" | "provinceId" | "seaportId" | "airportId" | "allCityByCountryId";
18
18
 
19
- /**
20
- * 1-1-2.TGC自动登录
21
- * @returns
22
- */
23
19
  export declare function autoLoginByTGC(data: {
24
20
  toSys: string;
25
21
  path: string;
@@ -41,18 +37,8 @@ export declare interface BaseResponse<T = any> {
41
37
  */
42
38
  export declare type BeforeSendCallback = (event: GioEvent) => GioEvent;
43
39
 
44
- /**
45
- * 验证验证码绑定第三方应用
46
- * @param data
47
- * @returns
48
- */
49
40
  export declare function bindThirdPartyByCodeApi(data: any): Promise<any>;
50
41
 
51
- /**
52
- * 验证密码绑定第三方应用
53
- * @param data
54
- * @returns
55
- */
56
42
  export declare function bindThirdPartyByPwdApi(data: any): Promise<any>;
57
43
 
58
44
  declare interface CarrierRequestPayload {
@@ -64,29 +50,14 @@ declare interface CarrierRequestPayload {
64
50
  [key: string]: any;
65
51
  }
66
52
 
67
- /**
68
- * 检查账号是否存在(忘记密码专用)
69
- * @param data
70
- * @returns
71
- */
72
53
  export declare function checkAccountExistsFPApi(data: any): Promise<any>;
73
54
 
74
- /**
75
- * 验证邮件验证码
76
- * @param data
77
- * @returns
78
- */
79
55
  export declare function checkEmailCodeApi(data: {
80
56
  uuid: string;
81
57
  code: string;
82
58
  target: string;
83
59
  }): Promise<any>;
84
60
 
85
- /**
86
- * 验证手机验证码
87
- * @param data
88
- * @returns
89
- */
90
61
  export declare function checkMobileCodeApi(data: {
91
62
  code: string;
92
63
  uuid: string;
@@ -107,6 +78,22 @@ export declare interface ClientIdPluginOptions {
107
78
  headerName?: string;
108
79
  }
109
80
 
81
+ /**
82
+ * 2. 可配置的常量定义
83
+ */
84
+ export declare interface CommonKeysConfig {
85
+ TokenKey: string;
86
+ HasLoginKey: string;
87
+ PrjId: string;
88
+ ExpiresInKey: string;
89
+ ExpiresInTimeKey: string;
90
+ RefreshTokenKey: string;
91
+ RefreshExpiresInKey: string;
92
+ RefreshExpiresInTimeKey: string;
93
+ RememberMeAccountKey: string;
94
+ RememberMePasswordKey: string;
95
+ }
96
+
110
97
  export declare interface CommonParams {
111
98
  current?: number;
112
99
  size?: number;
@@ -124,18 +111,8 @@ export declare interface CompanyOption {
124
111
  compName: string;
125
112
  }
126
113
 
127
- /**
128
- * 完善公司信息跳转
129
- * @param {*} data
130
- * @returns
131
- */
132
114
  export declare function completeCompRedirectApi(data: any): Promise<any>;
133
115
 
134
- /**
135
- * 完善信息加入公司
136
- * @param data
137
- * @returns
138
- */
139
116
  export declare function completeJoinCompanyRedirectApi(data: any): Promise<any>;
140
117
 
141
118
  /**
@@ -184,7 +161,7 @@ export declare function Decrypt(word: string): string;
184
161
  */
185
162
  export declare type DeviceIdCallback = (deviceId: string) => void;
186
163
 
187
- export declare type DisplayInfo = "Continent" | "Country" | "Province" | "City" | "Seaport" | "Airport";
164
+ export declare type DisplayInfo = "Continent" | "Country" | "Region" | "Province" | "City" | "Seaport" | "Airport";
188
165
 
189
166
  export declare const emitter: Emitter<ModalEvents>;
190
167
 
@@ -195,9 +172,9 @@ export declare const emitter: Emitter<ModalEvents>;
195
172
  */
196
173
  export declare function Encrypt(word: string): string;
197
174
 
198
- export declare const ExpiresInKey = "JC-Expires-In";
175
+ export declare const ExpiresInKey: string;
199
176
 
200
- export declare const ExpiresInTimeKey = "JC-Expires-Time-In";
177
+ export declare const ExpiresInTimeKey: string;
201
178
 
202
179
  /**
203
180
  * Fetch API ClientId 拦截器
@@ -219,15 +196,10 @@ export declare interface FetchClientIdOptions {
219
196
  * @param data
220
197
  * @returns
221
198
  */
222
- export declare function findDictAPi(data?: {
199
+ export declare function findDictApi(data?: {
223
200
  size: number;
224
201
  }): Promise<any>;
225
202
 
226
- /**
227
- * 根据手机邮箱获取重复列表
228
- * @param data
229
- * @returns
230
- */
231
203
  export declare function findListByMobileEmailApi(data: any): Promise<any>;
232
204
 
233
205
  /**
@@ -235,7 +207,7 @@ export declare function findListByMobileEmailApi(data: any): Promise<any>;
235
207
  * @param data
236
208
  * @returns
237
209
  */
238
- export declare function findPAreaCodeAPi(data?: {
210
+ export declare function findPAreaCodeApi(data?: {
239
211
  size: number;
240
212
  }): Promise<any>;
241
213
 
@@ -264,10 +236,6 @@ export declare function getAirport(params?: {
264
236
  */
265
237
  export declare function getAppId(): string;
266
238
 
267
- /**
268
- * 全局获取 session
269
- * @returns
270
- */
271
239
  export declare function getAuthSessionItems(): {
272
240
  activityCode: string | null;
273
241
  referenceUserId: string | null;
@@ -305,6 +273,11 @@ export declare function getCity(params?: {
305
273
  countryId?: number;
306
274
  }): Promise<BaseResponse<UnifiedItem>>;
307
275
 
276
+ /**
277
+ * 获取当前的常量配置
278
+ */
279
+ export declare const getCommonKeys: () => CommonKeysConfig;
280
+
308
281
  export declare const getCompanyOptionApi: (data: CompanyOption) => Promise<any>;
309
282
 
310
283
  /** 保留对外兼容函数:getContinent/getCountry/getCity/getProvince/getSeaport/getAirport */
@@ -334,10 +307,6 @@ export declare function getExpiresTimeIn(): number;
334
307
  */
335
308
  export declare function getFirstDomain(): string | undefined;
336
309
 
337
- /**
338
- * 全局获取 GIO 相关 session
339
- * @returns
340
- */
341
310
  export declare function getGioSessionItems(): {
342
311
  registerEntry: string | null;
343
312
  };
@@ -348,11 +317,6 @@ export declare function getGioSessionItems(): {
348
317
  */
349
318
  export declare const getIsEn: () => boolean;
350
319
 
351
- /**
352
- * 获取用户加入公司信息
353
- * @param data
354
- * @returns
355
- */
356
320
  export declare function getJoinCompanyApi(data: any): Promise<any>;
357
321
 
358
322
  /**
@@ -368,25 +332,10 @@ export declare function getLanguage(): string | undefined;
368
332
  */
369
333
  export declare function getLocalIpDataApi(data: any): Promise<any>;
370
334
 
371
- /**
372
- * 获取登录微信二维码
373
- * @param data
374
- * @returns
375
- */
376
335
  export declare function getLoginQrCode(data?: {}): Promise<any>;
377
336
 
378
- /**
379
- * 忘记密码发送验证码
380
- * @param data
381
- * @returns
382
- */
383
337
  export declare function getMEVCodeApi(data: any): Promise<any>;
384
338
 
385
- /**
386
- * 根据用户 id 获取手机号
387
- * @param data
388
- * @returns
389
- */
390
339
  export declare function getMobileEmailApi(data: {
391
340
  id: string;
392
341
  }): Promise<any>;
@@ -414,12 +363,6 @@ export declare function getProvince(params?: {
414
363
  countryId?: number;
415
364
  }): Promise<BaseResponse<UnifiedItem>>;
416
365
 
417
- /**
418
- * 跳转其他站
419
- * @param appId
420
- * @param path
421
- * @returns
422
- */
423
366
  export declare function getRedirectPathApi(appId: string, path: string): Promise<any>;
424
367
 
425
368
  /**
@@ -482,11 +425,6 @@ export declare function getToken(): string | undefined;
482
425
  */
483
426
  export declare function getTracker<T extends GioTracker>(trackerInstance?: T): T | null;
484
427
 
485
- /**
486
- * 获取用户手机号邮箱信息
487
- * @param data
488
- * @returns
489
- */
490
428
  export declare function getUserInfoApi(data: any): Promise<any>;
491
429
 
492
430
  export declare const GIO_CLICK_PAGE_REQUIRED_FIELDS: readonly ["companyID_var", "contactPerson_var", "inquiryID_var", "modulePosition_var", "moduleType_var", "pageCode_var", "pageClickName_var", "moduleName_var"];
@@ -590,6 +528,8 @@ export declare interface GioInitOptions {
590
528
  ignoreFields?: string[];
591
529
  /** 曝光比例(0-1),与曝光插件结合使用,默认 0 */
592
530
  impressionScale?: number;
531
+ /** 性能采集插件配置。集成后默认开启首屏加载监控和错误监控,默认关闭网络监控 */
532
+ performance?: GioPerformanceOptions;
593
533
  /** 与小程序打通时的配置项,SDK >= 4.3.0 支持 */
594
534
  embeddedAdapter?: {
595
535
  /** 圈选服务器地址,SaaS 客户不需要配置 */
@@ -608,6 +548,38 @@ export declare interface GioPageProps {
608
548
  title: string;
609
549
  }
610
550
 
551
+ /**
552
+ * 性能采集 - 网络监控排除配置
553
+ */
554
+ declare interface GioPerformanceNetwork {
555
+ /**
556
+ * 请求监控排除名单
557
+ * 值可以是域名字符串、正则表达式,或由两者组成的数组
558
+ * 配置此项即视为开启请求监控
559
+ * 注意:使用纯字符串校验时应尽可能使用长且准确的字符,过短的字符串可能会误过滤其他请求
560
+ */
561
+ exclude?: string | RegExp | Array<string | RegExp>;
562
+ }
563
+
564
+ /**
565
+ * 性能采集配置项
566
+ * 集成性能采集插件后,默认开启首屏加载监控和错误监控,默认关闭网络监控
567
+ */
568
+ declare interface GioPerformanceOptions {
569
+ /** 是否开启首屏加载监控,默认 true */
570
+ monitor?: boolean;
571
+ /** 是否开启错误监控,默认 true */
572
+ exception?: boolean;
573
+ /**
574
+ * 网络监控配置
575
+ * - 不配置时默认关闭网络监控
576
+ * - 设为 true 开启网络监控
577
+ * - 设为对象时开启网络监控并配置排除名单
578
+ * 注意:请求监控强制过滤了 Gio 上报的请求
579
+ */
580
+ network?: boolean | GioPerformanceNetwork;
581
+ }
582
+
611
583
  /**
612
584
  * 事件计时器 ID 类型
613
585
  */
@@ -870,7 +842,12 @@ export declare interface GioUserAttributes {
870
842
  [key: string]: GioAttributeValue;
871
843
  }
872
844
 
873
- export declare const HasLoginKey = "hasLogin";
845
+ export declare const HasLoginKey: string;
846
+
847
+ /**
848
+ * 全局初始化方法,在项目入口调用
849
+ */
850
+ export declare const initCommonKeys: (newKeys: Partial<CommonKeysConfig>) => void;
874
851
 
875
852
  /**
876
853
  * 全局初始化方法,在项目入口调用
@@ -901,14 +878,9 @@ export declare function installClientIdPlugin(instance: AxiosInstance, options?:
901
878
  */
902
879
  export declare function installFetchClientId(options?: FetchClientIdOptions): void;
903
880
 
904
- /**
905
- * 获取邀请加入公司信息
906
- * @param data
907
- * @returns
908
- */
909
881
  export declare function inviteJoinGetCompApi(data: any): Promise<any>;
910
882
 
911
- declare interface IResponse<T> {
883
+ export declare interface IResponse<T> {
912
884
  data: T;
913
885
  }
914
886
 
@@ -1184,39 +1156,14 @@ export declare interface LocationUnifiedItem {
1184
1156
  [key: string]: unknown;
1185
1157
  }
1186
1158
 
1187
- /**
1188
- * 用户登录
1189
- * @param loginData
1190
- * @returns
1191
- */
1192
1159
  export declare function loginApi(loginData: LoginDataParams): Promise<IResponse<ApiResponse<LoginResponseData>>>;
1193
1160
 
1194
- /**
1195
- * 验证码登录注册
1196
- * @param data
1197
- * @returns
1198
- */
1199
1161
  export declare function loginByEmailOrMobileCodeApi(data: any): Promise<IResponse<ApiResponse<LoginResponseData>>>;
1200
1162
 
1201
- /**
1202
- * Facebook 登录
1203
- * @param data
1204
- * @returns
1205
- */
1206
1163
  export declare function loginByFacebookApi(data: any): Promise<IResponse<ApiResponse<ThirdResponseData>>>;
1207
1164
 
1208
- /**
1209
- * LinkedIn 登录
1210
- * @param data
1211
- * @returns
1212
- */
1213
1165
  export declare function loginByLinkedinApi(data: any): Promise<IResponse<ApiResponse<ThirdResponseData>>>;
1214
1166
 
1215
- /**
1216
- * 微信二维码登录(1s轮询)
1217
- * @param data
1218
- * @returns
1219
- */
1220
1167
  export declare function loginByQrCode(data: {
1221
1168
  uniqueCode: string;
1222
1169
  appId: string;
@@ -1226,14 +1173,9 @@ export declare function loginByQrCode(data: {
1226
1173
  formEntry?: string;
1227
1174
  }): Promise<any>;
1228
1175
 
1229
- /**
1230
- * 微信二维码登录绑定用户(验证码)
1231
- * @param data
1232
- * @returns
1233
- */
1234
1176
  export declare function loginCodeBindWechatApi(data: any): Promise<any>;
1235
1177
 
1236
- declare interface LoginDataParams {
1178
+ export declare interface LoginDataParams {
1237
1179
  username: string;
1238
1180
  password: string;
1239
1181
  appId: string;
@@ -1245,14 +1187,9 @@ declare interface LoginDataParams {
1245
1187
  referenceUserId: string;
1246
1188
  }
1247
1189
 
1248
- /**
1249
- * 微信二维码登录绑定用户(账号密码)
1250
- * @param data
1251
- * @returns
1252
- */
1253
1190
  export declare function loginPwdBindWechatApi(data: any): Promise<any>;
1254
1191
 
1255
- declare interface LoginResponseData {
1192
+ export declare interface LoginResponseData {
1256
1193
  redirect: boolean;
1257
1194
  redirectPath?: string;
1258
1195
  tgc?: string;
@@ -1260,7 +1197,7 @@ declare interface LoginResponseData {
1260
1197
  hasLogon?: boolean;
1261
1198
  }
1262
1199
 
1263
- declare interface LoginResult {
1200
+ export declare interface LoginResult {
1264
1201
  accessToken: string;
1265
1202
  expireIn: number;
1266
1203
  refreshToken: string;
@@ -1296,59 +1233,29 @@ export declare interface PageParams {
1296
1233
  size?: number;
1297
1234
  }
1298
1235
 
1299
- export declare const PrjId = "prjId";
1236
+ export declare const PrjId: string;
1300
1237
 
1301
- export declare const RefreshExpiresInKey = "JC-Refresh-Expires-In";
1238
+ export declare const RefreshExpiresInKey: string;
1302
1239
 
1303
- export declare const RefreshExpiresInTimeKey = "JC-Refresh-Expires-Time-In";
1240
+ export declare const RefreshExpiresInTimeKey: string;
1304
1241
 
1305
- export declare const RefreshTokenKey = "JC-Refresh-Token";
1242
+ export declare const RefreshTokenKey: string;
1306
1243
 
1307
- /**
1308
- * 国际站峰会注册
1309
- * @param data
1310
- * @returns
1311
- */
1312
1244
  export declare function registerApi(data: any): Promise<any>;
1313
1245
 
1314
- /**
1315
- * 使用第三方应用注册用户公司
1316
- * @param data
1317
- * @returns
1318
- */
1319
1246
  export declare function registerByThirdPartyApi(data: any): Promise<any>;
1320
1247
 
1321
- /**
1322
- * 用户注册加入公司
1323
- * @param data
1324
- * @returns
1325
- */
1326
1248
  export declare function registerJoinCompanyApi(data: any): Promise<any>;
1327
1249
 
1328
- /**
1329
- * 微信二维码登录用户注册加入公司 🍉
1330
- * @param data
1331
- * @returns
1332
- */
1333
1250
  export declare function registerJoinCompanyBindWechatApi(data: any): Promise<any>;
1334
1251
 
1335
- /**
1336
- * 第三方应用注册加入公司
1337
- * @param data
1338
- * @returns
1339
- */
1340
1252
  export declare function registerJoinCompByThirdPartyApi(data: any): Promise<any>;
1341
1253
 
1342
- /**
1343
- * 微信二维码登录注册用户公司
1344
- * @param data
1345
- * @returns
1346
- */
1347
1254
  export declare function registerUserCompBindWechatApi(data: any): Promise<any>;
1348
1255
 
1349
- export declare const RememberMeAccountKey = "JC-Remember-Account";
1256
+ export declare const RememberMeAccountKey: string;
1350
1257
 
1351
- export declare const RememberMePasswordKey = "JC-Remember-Password";
1258
+ export declare const RememberMePasswordKey: string;
1352
1259
 
1353
1260
  export declare interface reportNewTypeData {
1354
1261
  reportData: string;
@@ -1379,22 +1286,10 @@ declare interface RequestOptions {
1379
1286
  fetch?: typeof fetch;
1380
1287
  }
1381
1288
 
1382
- /**
1383
- * 重置 session
1384
- */
1385
1289
  export declare function resetAuthSessionItems(): void;
1386
1290
 
1387
- /**
1388
- * 重置 GIO 相关 session
1389
- * @returns
1390
- */
1391
1291
  export declare function resetGioSessionItems(): void;
1392
1292
 
1393
- /**
1394
- * 重置密码
1395
- * @param data
1396
- * @returns
1397
- */
1398
1293
  export declare function resetPasswordApi(data: any): Promise<any>;
1399
1294
 
1400
1295
  /**
@@ -1481,11 +1376,6 @@ export declare interface SearchWithScopeParams extends SearchByNameParams {
1481
1376
  provinceId?: number;
1482
1377
  }
1483
1378
 
1484
- /**
1485
- * 发送邮箱验证码
1486
- * @param data
1487
- * @returns
1488
- */
1489
1379
  export declare function sendEmailCodeApi(data: {
1490
1380
  target: string;
1491
1381
  countryId?: number;
@@ -1493,11 +1383,6 @@ export declare function sendEmailCodeApi(data: {
1493
1383
  uuid?: string;
1494
1384
  }): Promise<any>;
1495
1385
 
1496
- /**
1497
- * 发送手机验证码
1498
- * @param data
1499
- * @returns
1500
- */
1501
1386
  export declare function sendMobileCodeApi(data: {
1502
1387
  target: string;
1503
1388
  countryId?: number;
@@ -1505,10 +1390,6 @@ export declare function sendMobileCodeApi(data: {
1505
1390
  uuid?: string;
1506
1391
  }): Promise<any>;
1507
1392
 
1508
- /**
1509
- * 全局设置 session
1510
- * @param data
1511
- */
1512
1393
  export declare function setAuthSessionItems(data: {
1513
1394
  activityCode?: string | null;
1514
1395
  referenceUserId?: string | null;
@@ -1521,10 +1402,6 @@ export declare function setAuthSessionItems(data: {
1521
1402
  compKey?: string | null;
1522
1403
  }): void;
1523
1404
 
1524
- /**
1525
- * 全局设置 GIO 相关 session
1526
- * @param data
1527
- */
1528
1405
  export declare function setGioSessionItems(data: {
1529
1406
  registerEntry?: string | null;
1530
1407
  }): void;
@@ -1547,6 +1424,7 @@ export declare interface SharedConfig {
1547
1424
  linePath: string;
1548
1425
  allLinePath: string;
1549
1426
  appId?: string;
1427
+ commonKeys?: Partial<CommonKeysConfig>;
1550
1428
  }
1551
1429
 
1552
1430
  /**
@@ -1569,7 +1447,7 @@ export declare function slideGetApi(data: {
1569
1447
  ts: number;
1570
1448
  }): Promise<any>;
1571
1449
 
1572
- declare interface ThirdPartyInfo {
1450
+ export declare interface ThirdPartyInfo {
1573
1451
  thirdPartyEmail: string;
1574
1452
  thirdPartyId: string;
1575
1453
  thirdPartyType: string;
@@ -1577,7 +1455,14 @@ declare interface ThirdPartyInfo {
1577
1455
  [property: string]: any;
1578
1456
  }
1579
1457
 
1580
- declare interface ThirdResponseData {
1458
+ export declare interface ThirdResponse {
1459
+ code: number;
1460
+ data: ThirdResponseData;
1461
+ msg: string;
1462
+ [property: string]: any;
1463
+ }
1464
+
1465
+ export declare interface ThirdResponseData {
1581
1466
  /**
1582
1467
  * 手机邮箱匹配列表 (修正为数组)
1583
1468
  */
@@ -1601,7 +1486,7 @@ declare interface ThirdResponseData {
1601
1486
  [property: string]: any;
1602
1487
  }
1603
1488
 
1604
- declare interface ThirdResponseMobileEmailList {
1489
+ export declare interface ThirdResponseMobileEmailList {
1605
1490
  account: string;
1606
1491
  cityId: number;
1607
1492
  cityNameCn: string;
@@ -1631,10 +1516,7 @@ export declare interface TokenData {
1631
1516
  refreshTokenExpireIn?: number;
1632
1517
  }
1633
1518
 
1634
- /**
1635
- * 2. 常量定义 (补全所有业务 Key)
1636
- */
1637
- export declare const TokenKey = "JC-JAVA-Token-Root";
1519
+ export declare const TokenKey: string;
1638
1520
 
1639
1521
  export declare function toSafeHeaderValue(value: string): string;
1640
1522
 
@@ -1654,27 +1536,12 @@ export declare interface UnifiedItem {
1654
1536
  raw?: any;
1655
1537
  }
1656
1538
 
1657
- /**
1658
- * 获取用户信息
1659
- * @param data
1660
- * @returns
1661
- */
1662
1539
  export declare function userCompPermsApi(data: any): Promise<any>;
1663
1540
 
1664
- /**
1665
- * 验证账号是否存在 /auth/validateAccountExist
1666
- * @param data
1667
- * @returns
1668
- */
1669
1541
  export declare function validateAccountExistApi(data: {
1670
1542
  target: string;
1671
1543
  }): Promise<any>;
1672
1544
 
1673
- /**
1674
- * 校验注册公司是否重名
1675
- * @param data
1676
- * @returns
1677
- */
1678
1545
  export declare function validateCompanyApi(data: {
1679
1546
  countryId: number;
1680
1547
  cityId: number;