@jctrans-materials/shared 1.0.40-beta.12 → 1.0.40-beta.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/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ import { Emitter } from 'mitt';
3
3
 
4
4
  declare type ActionKeys = (typeof MODAL_ACTION)[keyof typeof MODAL_ACTION];
5
5
 
6
+ /** 通用 API 响应结构 (最外层) */
6
7
  export declare interface ApiResponse<T = any> {
7
8
  code: number;
8
9
  msg: string;
@@ -14,8 +15,16 @@ export declare interface AppointSearch {
14
15
  val: string;
15
16
  }
16
17
 
18
+ /** baseSearch 的 appointSearch 条目 */
17
19
  export declare type AppointSearchName = "continentId" | "countryId" | "cityId" | "provinceId" | "seaportId" | "airportId" | "allCityByCountryId";
18
20
 
21
+ /** Auth session key 映射表 */
22
+ declare const AUTH_SESSION_KEYS: Record<string, string>;
23
+
24
+ declare type AuthSessionData = {
25
+ [K in keyof typeof AUTH_SESSION_KEYS]?: string | null;
26
+ };
27
+
19
28
  export declare function autoLoginByTGC(data: {
20
29
  toSys: string;
21
30
  path: string;
@@ -23,6 +32,7 @@ export declare function autoLoginByTGC(data: {
23
32
  tokenId?: string;
24
33
  }): Promise<any>;
25
34
 
35
+ /** 分页响应结构 */
26
36
  export declare interface BaseResponse<T = any> {
27
37
  records: T[];
28
38
  total: number;
@@ -41,16 +51,7 @@ export declare function bindThirdPartyByCodeApi(data: any): Promise<any>;
41
51
 
42
52
  export declare function bindThirdPartyByPwdApi(data: any): Promise<any>;
43
53
 
44
- declare interface CarrierRequestPayload {
45
- current: number;
46
- size: number;
47
- lineType: "air" | "shipping";
48
- searchkey?: string;
49
- ids?: number[];
50
- [key: string]: any;
51
- }
52
-
53
- export declare function checkAccountExistsFPApi(data: any): Promise<any>;
54
+ export declare function checkAccountExistsFPApi(data: ForgotPasswordAccountData): Promise<any>;
54
55
 
55
56
  export declare function checkEmailCodeApi(data: {
56
57
  uuid: string;
@@ -78,9 +79,6 @@ export declare interface ClientIdPluginOptions {
78
79
  headerName?: string;
79
80
  }
80
81
 
81
- /**
82
- * 2. 可配置的常量定义
83
- */
84
82
  export declare interface CommonKeysConfig {
85
83
  TokenKey: string;
86
84
  HasLoginKey: string;
@@ -94,6 +92,7 @@ export declare interface CommonKeysConfig {
94
92
  RememberMePasswordKey: string;
95
93
  }
96
94
 
95
+ /** baseSearch 的通用请求参数 */
97
96
  export declare interface CommonParams {
98
97
  current?: number;
99
98
  size?: number;
@@ -149,28 +148,31 @@ export declare const currentConfig: {
149
148
  readonly appId: string | undefined;
150
149
  };
151
150
 
151
+ /** 兼容旧名 */
152
+ export declare const Decrypt: typeof decrypt;
153
+
152
154
  /**
153
- * 解密方法
154
- * @param word
155
- * @returns
155
+ * 解密
156
156
  */
157
- export declare function Decrypt(word: string): string;
157
+ export declare function decrypt(word: string): string;
158
158
 
159
159
  /**
160
160
  * 设备 ID 回调
161
161
  */
162
162
  export declare type DeviceIdCallback = (deviceId: string) => void;
163
163
 
164
- export declare type DisplayInfo = "Continent" | "Country" | "Region" | "Province" | "City" | "Seaport" | "Airport";
164
+ /** 兼容旧名:baseSearch.DisplayInfo */
165
+ export declare type DisplayInfo = LocationType;
165
166
 
166
167
  export declare const emitter: Emitter<ModalEvents>;
167
168
 
169
+ /** 兼容旧名 */
170
+ export declare const Encrypt: typeof encrypt;
171
+
168
172
  /**
169
- * 加密方法
170
- * @param word
171
- * @returns
173
+ * 加密
172
174
  */
173
- export declare function Encrypt(word: string): string;
175
+ export declare function encrypt(word: string): string;
174
176
 
175
177
  export declare const ExpiresInKey: string;
176
178
 
@@ -191,26 +193,30 @@ export declare interface FetchClientIdOptions {
191
193
  injectRequest?: boolean;
192
194
  }
193
195
 
194
- /**
195
- * 获取字典列表
196
- * @param data
197
- * @returns
198
- */
199
196
  export declare function findDictApi(data?: {
200
197
  size: number;
201
198
  }): Promise<any>;
202
199
 
203
200
  export declare function findListByMobileEmailApi(data: any): Promise<any>;
204
201
 
205
- /**
206
- * 查询区号列表
207
- * @param data
208
- * @returns
209
- */
210
202
  export declare function findPAreaCodeApi(data?: {
211
203
  size: number;
212
204
  }): Promise<any>;
213
205
 
206
+ declare interface ForgotPasswordAccountData {
207
+ account?: string;
208
+ email?: string;
209
+ mobile?: string;
210
+ [key: string]: any;
211
+ }
212
+
213
+ declare interface ForgotPasswordVerifyData {
214
+ account?: string;
215
+ code?: string;
216
+ uuid?: string;
217
+ [key: string]: any;
218
+ }
219
+
214
220
  /**
215
221
  * ClientId 管理工具
216
222
  * 用于生成和管理唯一的客户端标识符
@@ -223,30 +229,19 @@ export declare function findPAreaCodeApi(data?: {
223
229
  */
224
230
  export declare function generateClientId(): string;
225
231
 
226
- export declare function getAirport(params?: {
232
+ export declare const getAirport: (params?: {
227
233
  page?: number;
228
234
  size?: number;
229
235
  ids?: number[];
230
- cityId?: number;
231
236
  countryId?: number;
232
- }): Promise<BaseResponse<UnifiedItem>>;
237
+ cityId?: number;
238
+ }) => Promise<BaseResponse<UnifiedItem>>;
239
+
240
+ export declare function getAirportByNameEnShow(nameEnShow: string): Promise<any>;
233
241
 
234
- /**
235
- * 跨环境获取 AppId (兼容 Vite, Webpack, Nuxt)
236
- */
237
242
  export declare function getAppId(): string;
238
243
 
239
- export declare function getAuthSessionItems(): {
240
- activityCode: string | null;
241
- referenceUserId: string | null;
242
- empNo: string | null;
243
- uniqueCode: string | null;
244
- path: string | null;
245
- clickSource: string | null;
246
- registerEvent?: string | null;
247
- registerType?: string | null;
248
- compKey?: string | null;
249
- };
244
+ export declare function getAuthSessionItems(): AuthSessionData;
250
245
 
251
246
  /** 单 id 版本 */
252
247
  export declare function getById(type: DisplayInfo, id: number): Promise<UnifiedItem | null>;
@@ -266,50 +261,48 @@ export declare function getCitiesByCountry(countryId: number, opts?: {
266
261
  size?: number;
267
262
  }): Promise<BaseResponse<UnifiedItem>>;
268
263
 
269
- export declare function getCity(params?: {
264
+ export declare const getCity: (params?: {
270
265
  page?: number;
271
266
  size?: number;
272
267
  ids?: number[];
273
268
  countryId?: number;
274
- }): Promise<BaseResponse<UnifiedItem>>;
269
+ cityId?: number;
270
+ }) => Promise<BaseResponse<UnifiedItem>>;
271
+
272
+ export declare function getCityByNameEnShow(nameEnShow: string): Promise<any>;
275
273
 
276
- /**
277
- * 获取当前的常量配置
278
- */
279
274
  export declare const getCommonKeys: () => CommonKeysConfig;
280
275
 
281
276
  export declare const getCompanyOptionApi: (data: CompanyOption) => Promise<any>;
282
277
 
283
- /** 保留对外兼容函数:getContinent/getCountry/getCity/getProvince/getSeaport/getAirport */
284
- export declare function getContinent(params?: {
278
+ export declare const getContinent: (params?: {
285
279
  page?: number;
286
280
  size?: number;
287
- }): Promise<BaseResponse<UnifiedItem>>;
281
+ ids?: number[];
282
+ countryId?: number;
283
+ cityId?: number;
284
+ }) => Promise<BaseResponse<UnifiedItem>>;
288
285
 
289
- export declare function getCountry(params?: {
286
+ export declare const getCountry: (params?: {
290
287
  page?: number;
291
288
  size?: number;
292
289
  ids?: number[];
293
- }): Promise<BaseResponse<UnifiedItem>>;
290
+ countryId?: number;
291
+ cityId?: number;
292
+ }) => Promise<BaseResponse<UnifiedItem>>;
293
+
294
+ export declare function getCountryByNameEnShow(nameEnShow: string): Promise<any>;
294
295
 
295
296
  /**
296
297
  * 获取当前的 clientId(不会创建新的)
297
298
  */
298
299
  export declare function getCurrentClientId(): string | null;
299
300
 
300
- /**
301
- * 🚀 补全:获取 Access Token 的过期时间戳 (用于判断是否需要刷新)
302
- */
303
301
  export declare function getExpiresTimeIn(): number;
304
302
 
305
- /**
306
- * 获取一级域名 (用于 Cookie 跨域共享)
307
- */
308
303
  export declare function getFirstDomain(): string | undefined;
309
304
 
310
- export declare function getGioSessionItems(): {
311
- registerEntry: string | null;
312
- };
305
+ export declare function getGioSessionItems(): GioSessionData;
313
306
 
314
307
  /**
315
308
  * 兼容全环境的语言判断方法
@@ -319,22 +312,13 @@ export declare const getIsEn: () => boolean;
319
312
 
320
313
  export declare function getJoinCompanyApi(data: any): Promise<any>;
321
314
 
322
- /**
323
- * 获取当前语言
324
- * @returns
325
- */
326
315
  export declare function getLanguage(): string | undefined;
327
316
 
328
- /**
329
- * 获取本地 IP 数据
330
- * @param data
331
- * @returns
332
- */
333
- export declare function getLocalIpDataApi(data: any): Promise<any>;
317
+ export declare function getLocalIpDataApi(data: Record<string, any>): Promise<any>;
334
318
 
335
319
  export declare function getLoginQrCode(data?: {}): Promise<any>;
336
320
 
337
- export declare function getMEVCodeApi(data: any): Promise<any>;
321
+ export declare function getMEVCodeApi(data: ForgotPasswordVerifyData): Promise<any>;
338
322
 
339
323
  export declare function getMobileEmailApi(data: {
340
324
  id: string;
@@ -346,45 +330,36 @@ export declare function getMobileEmailApi(data: {
346
330
  */
347
331
  export declare function getOrCreateClientId(): string;
348
332
 
349
- /**
350
- * 跨环境获取 Path
351
- */
352
333
  export declare function getPathFromConfig(config: any): string;
353
334
 
354
- /**
355
- * 4. 导出操作方法
356
- */
357
335
  export declare function getProjectId(): string | undefined;
358
336
 
359
- export declare function getProvince(params?: {
337
+ export declare const getProvince: (params?: {
360
338
  page?: number;
361
339
  size?: number;
362
340
  ids?: number[];
363
341
  countryId?: number;
364
- }): Promise<BaseResponse<UnifiedItem>>;
342
+ cityId?: number;
343
+ }) => Promise<BaseResponse<UnifiedItem>>;
365
344
 
366
345
  export declare function getRedirectPathApi(appId: string, path: string): Promise<any>;
367
346
 
368
- /**
369
- * 🚀 补全:获取当前的 Refresh Token
370
- */
371
347
  export declare function getRefreshToken(): string | undefined;
372
348
 
373
- /**
374
- * 获取记住的账号
375
- */
376
349
  export declare function getRememberAccount(): {
377
350
  account?: string;
378
351
  password?: string;
379
352
  };
380
353
 
381
- export declare function getSeaport(params?: {
354
+ export declare const getSeaport: (params?: {
382
355
  page?: number;
383
356
  size?: number;
384
357
  ids?: number[];
385
- cityId?: number;
386
358
  countryId?: number;
387
- }): Promise<BaseResponse<UnifiedItem>>;
359
+ cityId?: number;
360
+ }) => Promise<BaseResponse<UnifiedItem>>;
361
+
362
+ export declare function getSeaportByNameEnShow(nameEnShow: string): Promise<any>;
388
363
 
389
364
  export declare function getSessionHeaderValue(key: string): string;
390
365
 
@@ -401,9 +376,6 @@ export declare const getSharedConfig: () => {
401
376
  readonly appId: string | undefined;
402
377
  };
403
378
 
404
- /**
405
- * 获取当前的 Access Token
406
- */
407
379
  export declare function getToken(): string | undefined;
408
380
 
409
381
  /**
@@ -425,10 +397,16 @@ export declare function getToken(): string | undefined;
425
397
  */
426
398
  export declare function getTracker<T extends GioTracker>(trackerInstance?: T): T | null;
427
399
 
428
- export declare function getUserInfoApi(data: any): Promise<any>;
400
+ export declare function getUserInfoApi(data: Record<string, any>): Promise<any>;
429
401
 
430
402
  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"];
431
403
 
404
+ /** clickPage 事件名常量 */
405
+ export declare const GIO_EVENT_CLICK_PAGE = "clickPage";
406
+
407
+ /** GIO session key 映射表 */
408
+ declare const GIO_SESSION_KEYS: Record<string, string>;
409
+
432
410
  /**
433
411
  * GIO 属性对象
434
412
  */
@@ -580,53 +558,15 @@ declare interface GioPerformanceOptions {
580
558
  network?: boolean | GioPerformanceNetwork;
581
559
  }
582
560
 
561
+ declare type GioSessionData = {
562
+ [K in keyof typeof GIO_SESSION_KEYS]?: string | null;
563
+ };
564
+
583
565
  /**
584
566
  * 事件计时器 ID 类型
585
567
  */
586
568
  export declare type GioTimerId = string;
587
569
 
588
- /**
589
- * GrowingIO SDK 封装模块
590
- * 基于 gio-webjs-sdk npm 包
591
- *
592
- * @module gio
593
- *
594
- * @example
595
- * ```typescript
596
- * import { tracker, type GioAttributes, type GioInitOptions } from '@jctrans-materials/shared';
597
- *
598
- * // 基础初始化
599
- * tracker.init('your-account-id', 'your-datasource-id', {
600
- * debug: true,
601
- * trackPage: false,
602
- * });
603
- *
604
- * // 微信公众号 H5(需要 appId 和 forceLogin)
605
- * tracker.init('accountId', 'dataSourceId', 'wx-app-id', {
606
- * forceLogin: true,
607
- * debug: true,
608
- * });
609
- *
610
- * // 设置登录用户 ID
611
- * tracker.setUserId('user-123');
612
- * tracker.setUserId('user-123', 'user_id', () => {
613
- * console.log('set user id with userKey done');
614
- * });
615
- *
616
- * // 埋点事件
617
- * tracker.track('order_submit', {
618
- * order_type: 'freight',
619
- * price: 5000,
620
- * services: ['ocean', 'customs']
621
- * });
622
- *
623
- * // 设置全局属性
624
- * tracker.setGeneralProps({
625
- * platform: 'jctrans_web',
626
- * locale: 'zh-CN'
627
- * });
628
- * ```
629
- */
630
570
  export declare type GioTrackAttrs = Record<string, string | number | Array<string | number> | null | undefined>;
631
571
 
632
572
  declare class GioTracker {
@@ -844,9 +784,6 @@ export declare interface GioUserAttributes {
844
784
 
845
785
  export declare const HasLoginKey: string;
846
786
 
847
- /**
848
- * 全局初始化方法,在项目入口调用
849
- */
850
787
  export declare const initCommonKeys: (newKeys: Partial<CommonKeysConfig>) => void;
851
788
 
852
789
  /**
@@ -880,15 +817,11 @@ export declare function installFetchClientId(options?: FetchClientIdOptions): vo
880
817
 
881
818
  export declare function inviteJoinGetCompApi(data: any): Promise<any>;
882
819
 
883
- export declare interface IResponse<T> {
820
+ /** 简化响应结构(仅 data 字段)— 兼容旧名 IResponse */
821
+ export declare type IResponse<T> = {
884
822
  data: T;
885
- }
823
+ };
886
824
 
887
- /**
888
- * 检查值是否为空
889
- * @param value 要检查的值
890
- * @returns 是否为空
891
- */
892
825
  export declare function isEmpty(value: any): boolean;
893
826
 
894
827
  /**
@@ -903,238 +836,68 @@ export declare function isEmpty(value: any): boolean;
903
836
  */
904
837
  export declare function isGioAvailable(trackerInstance?: typeof tracker): boolean;
905
838
 
906
- /**
907
- * 判断域名是否为 IP
908
- */
909
839
  export declare function isIpAddress(hostname: string): boolean;
910
840
 
911
- declare interface LineRequestPayload {
912
- current: number;
913
- size: number;
914
- lineType: "air" | "shipping";
915
- searchkey?: string;
916
- ids?: number[];
917
- [key: string]: any;
918
- }
919
-
920
841
  export declare const locationSearchV2: {
921
- SEARCH_VERSION: string;
922
- searchByName: (params: SearchGenericParams) => Promise<{
923
- records: LocationUnifiedItem[];
924
- total: number;
925
- current: number;
926
- size: number;
927
- }>;
842
+ searchByName: (params: SearchGenericParams) => Promise<BaseResponse<LocationUnifiedItem>>;
928
843
  searchByIdWithType: (id: number | string | Array<number | string>, type: LocationType, extraParams?: {
929
844
  lineType?: "air" | "shipping";
930
- }) => Promise<{
931
- records: LocationUnifiedItem[];
932
- total: number;
933
- current: number;
934
- size: number;
935
- }>;
845
+ }) => any;
936
846
  country: {
937
- searchByName: (params: SearchByNameParams) => Promise<{
938
- records: LocationUnifiedItem[];
939
- total: number;
940
- current: number;
941
- size: number;
942
- }>;
943
- getByIds: (ids: number[]) => Promise<{
944
- records: LocationUnifiedItem[];
945
- total: number;
946
- current: number;
947
- size: number;
948
- }>;
847
+ searchRegionByName: (params: SearchByNameParams) => Promise<BaseResponse<LocationUnifiedItem>>;
848
+ getRegionByIds: (ids: number[]) => Promise<BaseResponse<LocationUnifiedItem>>;
849
+ searchByName: (params: SearchWithScopeParams) => Promise<BaseResponse<LocationUnifiedItem>>;
850
+ getByIds: (ids: number[] | string[]) => Promise<BaseResponse<LocationUnifiedItem>>;
949
851
  };
950
852
  region: {
951
- searchByName: (params: SearchByNameParams) => Promise<{
952
- records: LocationUnifiedItem[];
953
- total: number;
954
- current: number;
955
- size: number;
956
- }>;
957
- getByIds: (ids: number[]) => Promise<{
958
- records: LocationUnifiedItem[];
959
- total: number;
960
- current: number;
961
- size: number;
962
- }>;
853
+ searchByName: (params: SearchByNameParams) => Promise<BaseResponse<LocationUnifiedItem>>;
854
+ getByIds: (ids: number[]) => Promise<BaseResponse<LocationUnifiedItem>>;
963
855
  };
964
856
  city: {
965
- searchByName: (params: SearchWithScopeParams) => Promise<{
966
- records: LocationUnifiedItem[];
967
- total: number;
968
- current: number;
969
- size: number;
970
- }>;
971
- getByIds: (ids: number[]) => Promise<{
972
- records: LocationUnifiedItem[];
973
- total: number;
974
- current: number;
975
- size: number;
976
- }>;
977
- getCitiesByCountry: (countryId: number, params?: PageParams) => Promise<{
978
- records: LocationUnifiedItem[];
979
- total: number;
980
- current: number;
981
- size: number;
982
- }>;
857
+ getCitiesByCountry: (countryId: number, params?: PageParams) => Promise<BaseResponse<LocationUnifiedItem>>;
858
+ searchByName: (params: SearchWithScopeParams) => Promise<BaseResponse<LocationUnifiedItem>>;
859
+ getByIds: (ids: number[] | string[]) => Promise<BaseResponse<LocationUnifiedItem>>;
983
860
  };
984
861
  seaport: {
985
- searchByName: (params: SearchWithScopeParams) => Promise<{
986
- records: LocationUnifiedItem[];
987
- total: number;
988
- current: number;
989
- size: number;
990
- }>;
991
- getByIds: (ids: number[]) => Promise<{
992
- records: LocationUnifiedItem[];
993
- total: number;
994
- current: number;
995
- size: number;
996
- }>;
862
+ searchByName: (params: SearchWithScopeParams) => Promise<BaseResponse<LocationUnifiedItem>>;
863
+ getByIds: (ids: number[] | string[]) => Promise<BaseResponse<LocationUnifiedItem>>;
997
864
  };
998
865
  airport: {
999
- searchByName: (params: SearchWithScopeParams) => Promise<{
1000
- records: LocationUnifiedItem[];
1001
- total: number;
1002
- current: number;
1003
- size: number;
1004
- }>;
1005
- getByIds: (ids: number[]) => Promise<{
1006
- records: LocationUnifiedItem[];
1007
- total: number;
1008
- current: number;
1009
- size: number;
1010
- }>;
866
+ searchByName: (params: SearchWithScopeParams) => Promise<BaseResponse<LocationUnifiedItem>>;
867
+ getByIds: (ids: number[] | string[]) => Promise<BaseResponse<LocationUnifiedItem>>;
868
+ };
869
+ province: {
870
+ searchByName: (params: SearchWithScopeParams) => Promise<BaseResponse<LocationUnifiedItem>>;
871
+ getByIds: (ids: number[] | string[]) => Promise<BaseResponse<LocationUnifiedItem>>;
872
+ };
873
+ continent: {
874
+ searchByName: (params: SearchWithScopeParams) => Promise<BaseResponse<LocationUnifiedItem>>;
875
+ getByIds: (ids: number[] | string[]) => Promise<BaseResponse<LocationUnifiedItem>>;
1011
876
  };
1012
877
  wharf: {
1013
- getByIds: (ids: string[]) => Promise<{
1014
- records: LocationUnifiedItem[];
1015
- total: number;
1016
- current: number;
1017
- size: number;
1018
- }>;
878
+ getByIds: (ids: string[]) => Promise<BaseResponse<LocationUnifiedItem>>;
1019
879
  };
1020
880
  carrier: {
1021
- /**
1022
- * 内部私有方法:构建符合 Carrier 接口要求的 payload
1023
- */
1024
- _buildPayload: (params: Partial<SearchByNameParams> & {
1025
- ids?: number[];
1026
- }, lineType: "air" | "shipping") => CarrierRequestPayload;
1027
- /**
1028
- * 搜索船公司 (Shipping Line)
1029
- */
1030
- searchShipping: (params: SearchByNameParams) => Promise<{
1031
- records: LocationUnifiedItem[];
1032
- total: number;
1033
- current: number;
1034
- size: number;
1035
- }>;
1036
- /**
1037
- * 搜索航空公司 (Airline)
1038
- */
1039
- searchAir: (params: SearchByNameParams) => Promise<{
1040
- records: LocationUnifiedItem[];
1041
- total: number;
1042
- current: number;
1043
- size: number;
1044
- }>;
1045
- /**
1046
- * 通用搜索 (需要手动传入 type)
1047
- * 场景:如果前端有一个下拉框让用户选类型,则调用此方法
1048
- */
1049
- search: (params: SearchByNameParams, lineType: "air" | "shipping") => Promise<{
1050
- records: LocationUnifiedItem[];
1051
- total: number;
1052
- current: number;
1053
- size: number;
1054
- }>;
1055
- /**
1056
- * 根据 ID 获取详情
1057
- * 注意:根据你的 Interface,ID 查询可能也需要传 lineType,
1058
- * 默认设为 shipping,或者你需要拆分成两个 ID 方法
1059
- */
1060
- getByIds: (ids: number[], lineType?: "air" | "shipping") => Promise<{
1061
- records: LocationUnifiedItem[];
1062
- total: number;
1063
- current: number;
1064
- size: number;
1065
- }>;
881
+ searchShipping: (params: SearchByNameParams) => Promise<BaseResponse<LocationUnifiedItem>>;
882
+ searchAir: (params: SearchByNameParams) => Promise<BaseResponse<LocationUnifiedItem>>;
883
+ search: (params: SearchByNameParams, lineType: "air" | "shipping") => Promise<BaseResponse<LocationUnifiedItem>>;
884
+ getByIds: (ids: number[], lineType?: "air" | "shipping") => Promise<BaseResponse<LocationUnifiedItem>>;
1066
885
  };
1067
886
  line: {
1068
- /**
1069
- * 内部私有方法:构建符合后端要求的 Payload
1070
- */
1071
- _buildPayload: (params: Partial<SearchByNameParams> & {
1072
- ids?: number[];
1073
- }, lineType: "air" | "shipping") => LineRequestPayload;
1074
- searchAllByCountry: (lineType: "air" | "shipping", countryId?: number) => Promise<{
1075
- records: LocationUnifiedItem[];
1076
- total: number;
1077
- current: number;
1078
- size: number;
1079
- }>;
1080
- /**
1081
- * 搜索海运航线 (Shipping Line)
1082
- * 例如:AE1, TP9
1083
- */
1084
- searchShipping: (params: SearchByNameParams) => Promise<{
1085
- records: LocationUnifiedItem[];
1086
- total: number;
1087
- current: number;
1088
- size: number;
1089
- }>;
1090
- /**
1091
- * 搜索空运航线 (Air Line)
1092
- * 业务上较少见,但接口支持
1093
- */
1094
- searchAir: (params: SearchByNameParams) => Promise<{
1095
- records: LocationUnifiedItem[];
1096
- total: number;
1097
- current: number;
1098
- size: number;
1099
- }>;
1100
- /**
1101
- * 通用搜索 (需要手动传 lineType)
1102
- */
1103
- search: (params: SearchByNameParams, lineType: "air" | "shipping") => Promise<{
1104
- records: LocationUnifiedItem[];
1105
- total: number;
1106
- current: number;
1107
- size: number;
1108
- }>;
1109
- /**
1110
- * 根据 ID 获取航线详情
1111
- * 默认默认为 shipping,如需查空运航线需显式传入
1112
- */
1113
- getByIds: (ids: number[], lineType?: "air" | "shipping") => Promise<{
1114
- records: LocationUnifiedItem[];
1115
- total: number;
1116
- current: number;
1117
- size: number;
1118
- }>;
887
+ searchAllByCountry: (lineType: "air" | "shipping", countryId?: number) => Promise<BaseResponse<LocationUnifiedItem>>;
888
+ searchShipping: (params: SearchByNameParams) => Promise<BaseResponse<LocationUnifiedItem>>;
889
+ searchAir: (params: SearchByNameParams) => Promise<BaseResponse<LocationUnifiedItem>>;
890
+ search: (params: SearchByNameParams, lineType: "air" | "shipping") => Promise<BaseResponse<LocationUnifiedItem>>;
891
+ getByIds: (ids: number[], lineType?: "air" | "shipping") => Promise<BaseResponse<LocationUnifiedItem>>;
1119
892
  };
1120
- /** 获取某个国家下的所有城市 */
1121
- getCitiesByCountry: (countryId: number, params?: PageParams) => Promise<{
1122
- records: LocationUnifiedItem[];
1123
- total: number;
1124
- current: number;
1125
- size: number;
1126
- }>;
1127
- /** 获取某个城市下的子实体 */
1128
- getChildrenByCity: (cityId: number, childTypes: Array<"Seaport" | "Airport" | "Wharf">, params?: PageParams) => Promise<{
1129
- records: LocationUnifiedItem[];
1130
- total: number;
1131
- current: number;
1132
- size: number;
1133
- }>;
893
+ getCitiesByCountry: (countryId: number, params?: PageParams) => Promise<BaseResponse<LocationUnifiedItem>>;
894
+ getChildrenByCity: (cityId: number, childTypes: Array<"Seaport" | "Airport" | "Wharf">, params?: PageParams) => Promise<BaseResponse<LocationUnifiedItem>>;
1134
895
  };
1135
896
 
897
+ /** 所有支持的搜索实体类型(V1 + V2 的 superset) */
1136
898
  export declare type LocationType = "Continent" | "Country" | "Region" | "Province" | "City" | "Seaport" | "Airport" | "Street" | "Town" | "Wharf" | "Carrier" | "Line";
1137
899
 
900
+ /** 标准化后的实体对象(V1 + V2 的 superset) */
1138
901
  export declare interface LocationUnifiedItem {
1139
902
  id: number | string;
1140
903
  type: LocationType;
@@ -1160,9 +923,9 @@ export declare function loginApi(loginData: LoginDataParams): Promise<IResponse<
1160
923
 
1161
924
  export declare function loginByEmailOrMobileCodeApi(data: any): Promise<IResponse<ApiResponse<LoginResponseData>>>;
1162
925
 
1163
- export declare function loginByFacebookApi(data: any): Promise<IResponse<ApiResponse<ThirdResponseData>>>;
926
+ export declare const loginByFacebookApi: (data: any) => Promise<IResponse<ApiResponse<ThirdResponseData>>>;
1164
927
 
1165
- export declare function loginByLinkedinApi(data: any): Promise<IResponse<ApiResponse<ThirdResponseData>>>;
928
+ export declare const loginByLinkedinApi: (data: any) => Promise<IResponse<ApiResponse<ThirdResponseData>>>;
1166
929
 
1167
930
  export declare function loginByQrCode(data: {
1168
931
  uniqueCode: string;
@@ -1175,6 +938,7 @@ export declare function loginByQrCode(data: {
1175
938
 
1176
939
  export declare function loginCodeBindWechatApi(data: any): Promise<any>;
1177
940
 
941
+ /** 登录请求参数 */
1178
942
  export declare interface LoginDataParams {
1179
943
  username: string;
1180
944
  password: string;
@@ -1189,6 +953,7 @@ export declare interface LoginDataParams {
1189
953
 
1190
954
  export declare function loginPwdBindWechatApi(data: any): Promise<any>;
1191
955
 
956
+ /** 登录响应的 data 层 */
1192
957
  export declare interface LoginResponseData {
1193
958
  redirect: boolean;
1194
959
  redirectPath?: string;
@@ -1197,6 +962,7 @@ export declare interface LoginResponseData {
1197
962
  hasLogon?: boolean;
1198
963
  }
1199
964
 
965
+ /** 登录结果中的 Token 信息 */
1200
966
  export declare interface LoginResult {
1201
967
  accessToken: string;
1202
968
  expireIn: number;
@@ -1228,6 +994,7 @@ export declare const normalizeClickPageAttrs: (eventName: string, attrs?: GioTra
1228
994
  */
1229
995
  export declare type PageListenerCallback = (pageProps: GioPageProps) => void;
1230
996
 
997
+ /** 分页参数 */
1231
998
  export declare interface PageParams {
1232
999
  current?: number;
1233
1000
  size?: number;
@@ -1257,13 +1024,13 @@ export declare const RememberMeAccountKey: string;
1257
1024
 
1258
1025
  export declare const RememberMePasswordKey: string;
1259
1026
 
1260
- export declare interface reportNewTypeData {
1027
+ export declare interface ReportNewTypeData {
1261
1028
  reportData: string;
1262
1029
  reportType: ReportType;
1263
1030
  countryId?: string | number;
1264
1031
  }
1265
1032
 
1266
- export declare function reportNewTypeDataApi(payload: reportNewTypeData): Promise<{}>;
1033
+ export declare function reportNewTypeDataApi(payload: ReportNewTypeData): Promise<Record<string, any>>;
1267
1034
 
1268
1035
  export declare type ReportType = "City" | "Seaport" | "Airport" | "Line" | "Carrier" | "shipping_line" | "shipping_carrier" | "air_line" | "air_carrier";
1269
1036
 
@@ -1290,7 +1057,14 @@ export declare function resetAuthSessionItems(): void;
1290
1057
 
1291
1058
  export declare function resetGioSessionItems(): void;
1292
1059
 
1293
- export declare function resetPasswordApi(data: any): Promise<any>;
1060
+ export declare function resetPasswordApi(data: ResetPasswordData): Promise<any>;
1061
+
1062
+ declare interface ResetPasswordData {
1063
+ account?: string;
1064
+ password?: string;
1065
+ code?: string;
1066
+ [key: string]: any;
1067
+ }
1294
1068
 
1295
1069
  /**
1296
1070
  * 保存 clientId 到 localStorage
@@ -1304,8 +1078,6 @@ export declare function saveClientIdToSessionStorage(clientId: string): void;
1304
1078
 
1305
1079
  /**
1306
1080
  * 统一搜索接口
1307
- * - 支持 keyword(模糊), displayInfo(数组), ids(按 type), scope(countryId/cityId/provinceId)
1308
- * - 返回扁平化的 UnifiedItem 列表 + 分页信息
1309
1081
  */
1310
1082
  export declare function search(params: {
1311
1083
  keyword?: string;
@@ -1330,7 +1102,7 @@ export declare function searchAirportByName(keyword: string, opts?: {
1330
1102
  page?: number;
1331
1103
  size?: number;
1332
1104
  cityId?: number;
1333
- }): Promise<BaseResponse<UnifiedItem>>;
1105
+ }): Promise<BaseResponse<LocationUnifiedItem>>;
1334
1106
 
1335
1107
  /**
1336
1108
  * 按名称搜索指定类型
@@ -1344,6 +1116,7 @@ export declare function searchByName(params: {
1344
1116
  sort?: string;
1345
1117
  }): Promise<BaseResponse<UnifiedItem>>;
1346
1118
 
1119
+ /** 按名称搜索参数 */
1347
1120
  export declare interface SearchByNameParams extends PageParams {
1348
1121
  keyword: string;
1349
1122
  searchMode?: "0" | "1" | "2";
@@ -1353,13 +1126,14 @@ export declare function searchCityByName(keyword: string, opts?: {
1353
1126
  page?: number;
1354
1127
  size?: number;
1355
1128
  countryId?: number;
1356
- }): Promise<BaseResponse<UnifiedItem>>;
1129
+ }): Promise<BaseResponse<LocationUnifiedItem>>;
1357
1130
 
1358
1131
  export declare function searchCountryByName(keyword: string, opts?: {
1359
1132
  page?: number;
1360
1133
  size?: number;
1361
- }): Promise<BaseResponse<UnifiedItem>>;
1134
+ }): Promise<BaseResponse<LocationUnifiedItem>>;
1362
1135
 
1136
+ /** 通用搜索参数(需指定 displayInfo) */
1363
1137
  export declare interface SearchGenericParams extends SearchByNameParams {
1364
1138
  displayInfo: LocationType[];
1365
1139
  }
@@ -1368,8 +1142,9 @@ export declare function searchSeaportByName(keyword: string, opts?: {
1368
1142
  page?: number;
1369
1143
  size?: number;
1370
1144
  cityId?: number;
1371
- }): Promise<BaseResponse<UnifiedItem>>;
1145
+ }): Promise<BaseResponse<LocationUnifiedItem>>;
1372
1146
 
1147
+ /** 带范围约束的搜索参数 */
1373
1148
  export declare interface SearchWithScopeParams extends SearchByNameParams {
1374
1149
  countryId?: number;
1375
1150
  cityId?: number;
@@ -1390,30 +1165,12 @@ export declare function sendMobileCodeApi(data: {
1390
1165
  uuid?: string;
1391
1166
  }): Promise<any>;
1392
1167
 
1393
- export declare function setAuthSessionItems(data: {
1394
- activityCode?: string | null;
1395
- referenceUserId?: string | null;
1396
- empNo?: string | null;
1397
- uniqueCode?: string | null;
1398
- path?: string | null;
1399
- clickSource?: string | null;
1400
- registerEvent?: string | null;
1401
- registerType?: string | null;
1402
- compKey?: string | null;
1403
- }): void;
1404
-
1405
- export declare function setGioSessionItems(data: {
1406
- registerEntry?: string | null;
1407
- }): void;
1168
+ export declare function setAuthSessionItems(data: AuthSessionData): void;
1169
+
1170
+ export declare function setGioSessionItems(data: GioSessionData): void;
1408
1171
 
1409
- /**
1410
- * 记住账号 (替代存密码)
1411
- */
1412
1172
  export declare function setRememberMe(account: string, password: string, remember: boolean): void;
1413
1173
 
1414
- /**
1415
- * 整体设置所有凭证
1416
- */
1417
1174
  export declare function setTokenAll(data: TokenData | null | undefined): void;
1418
1175
 
1419
1176
  export declare interface SharedConfig {
@@ -1427,21 +1184,11 @@ export declare interface SharedConfig {
1427
1184
  commonKeys?: Partial<CommonKeysConfig>;
1428
1185
  }
1429
1186
 
1430
- /**
1431
- * 滑动或者点选验证
1432
- * @param data
1433
- * @returns
1434
- */
1435
1187
  export declare function slideCheckApi(data: {
1436
1188
  pointJson: string;
1437
1189
  uuid: string;
1438
1190
  }): Promise<any>;
1439
1191
 
1440
- /**
1441
- * 获取验证图片 以及token
1442
- * @param data
1443
- * @returns
1444
- */
1445
1192
  export declare function slideGetApi(data: {
1446
1193
  clientUid: string;
1447
1194
  ts: number;
@@ -1455,6 +1202,7 @@ export declare interface ThirdPartyInfo {
1455
1202
  [property: string]: any;
1456
1203
  }
1457
1204
 
1205
+ /** 第三方登录响应 */
1458
1206
  export declare interface ThirdResponse {
1459
1207
  code: number;
1460
1208
  data: ThirdResponseData;
@@ -1463,25 +1211,10 @@ export declare interface ThirdResponse {
1463
1211
  }
1464
1212
 
1465
1213
  export declare interface ThirdResponseData {
1466
- /**
1467
- * 手机邮箱匹配列表 (修正为数组)
1468
- */
1469
1214
  mobileEmailList: ThirdResponseMobileEmailList[];
1470
- /**
1471
- * 是否跳转, true跳转 false不跳转
1472
- */
1473
1215
  redirect: boolean;
1474
- /**
1475
- * 跳转路径
1476
- */
1477
1216
  redirectPath: string;
1478
- /**
1479
- * tgc
1480
- */
1481
1217
  tgc: string;
1482
- /**
1483
- * 三方信息
1484
- */
1485
1218
  thirdPartyInfo: ThirdPartyInfo;
1486
1219
  [property: string]: any;
1487
1220
  }
@@ -1506,9 +1239,6 @@ export declare interface ThirdResponseMobileEmailList {
1506
1239
 
1507
1240
  export declare const TOKEN_ENDPOINTS: Set<string>;
1508
1241
 
1509
- /**
1510
- * 3. 类型定义
1511
- */
1512
1242
  export declare interface TokenData {
1513
1243
  accessToken?: string;
1514
1244
  expireIn?: number;
@@ -1522,21 +1252,10 @@ export declare function toSafeHeaderValue(value: string): string;
1522
1252
 
1523
1253
  export declare const tracker: GioTracker;
1524
1254
 
1525
- /** 归一化之后的实体 */
1526
- export declare interface UnifiedItem {
1527
- id: number | string;
1528
- type: DisplayInfo;
1529
- nameCn?: string;
1530
- nameEn?: string;
1531
- display?: string;
1532
- continent?: Record<string, any>;
1533
- country?: Record<string, any>;
1534
- city?: Record<string, any>;
1535
- province?: Record<string, any>;
1536
- raw?: any;
1537
- }
1255
+ /** 兼容旧名:baseSearch.UnifiedItem */
1256
+ export declare type UnifiedItem = LocationUnifiedItem;
1538
1257
 
1539
- export declare function userCompPermsApi(data: any): Promise<any>;
1258
+ export declare function userCompPermsApi(data: Record<string, any>): Promise<any>;
1540
1259
 
1541
1260
  export declare function validateAccountExistApi(data: {
1542
1261
  target: string;