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

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
@@ -1,8 +1,13 @@
1
1
  import { AxiosInstance } from 'axios';
2
+ import { BoardQueryResult } from '@jctrans/dw-sdk';
3
+ import { DateType } from '@jctrans/dw-sdk';
2
4
  import { Emitter } from 'mitt';
5
+ import { GraphQLClientError } from '@jctrans/dw-sdk';
6
+ import { OpportunityBoardParams } from '@jctrans/dw-sdk';
3
7
 
4
8
  declare type ActionKeys = (typeof MODAL_ACTION)[keyof typeof MODAL_ACTION];
5
9
 
10
+ /** 通用 API 响应结构 (最外层) */
6
11
  export declare interface ApiResponse<T = any> {
7
12
  code: number;
8
13
  msg: string;
@@ -14,8 +19,16 @@ export declare interface AppointSearch {
14
19
  val: string;
15
20
  }
16
21
 
22
+ /** baseSearch 的 appointSearch 条目 */
17
23
  export declare type AppointSearchName = "continentId" | "countryId" | "cityId" | "provinceId" | "seaportId" | "airportId" | "allCityByCountryId";
18
24
 
25
+ /** Auth session key 映射表 */
26
+ declare const AUTH_SESSION_KEYS: Record<string, string>;
27
+
28
+ declare type AuthSessionData = {
29
+ [K in keyof typeof AUTH_SESSION_KEYS]?: string | null;
30
+ };
31
+
19
32
  export declare function autoLoginByTGC(data: {
20
33
  toSys: string;
21
34
  path: string;
@@ -23,6 +36,7 @@ export declare function autoLoginByTGC(data: {
23
36
  tokenId?: string;
24
37
  }): Promise<any>;
25
38
 
39
+ /** 分页响应结构 */
26
40
  export declare interface BaseResponse<T = any> {
27
41
  records: T[];
28
42
  total: number;
@@ -41,16 +55,9 @@ export declare function bindThirdPartyByCodeApi(data: any): Promise<any>;
41
55
 
42
56
  export declare function bindThirdPartyByPwdApi(data: any): Promise<any>;
43
57
 
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
- }
58
+ export { BoardQueryResult }
52
59
 
53
- export declare function checkAccountExistsFPApi(data: any): Promise<any>;
60
+ export declare function checkAccountExistsFPApi(data: ForgotPasswordAccountData): Promise<any>;
54
61
 
55
62
  export declare function checkEmailCodeApi(data: {
56
63
  uuid: string;
@@ -78,9 +85,6 @@ export declare interface ClientIdPluginOptions {
78
85
  headerName?: string;
79
86
  }
80
87
 
81
- /**
82
- * 2. 可配置的常量定义
83
- */
84
88
  export declare interface CommonKeysConfig {
85
89
  TokenKey: string;
86
90
  HasLoginKey: string;
@@ -94,6 +98,7 @@ export declare interface CommonKeysConfig {
94
98
  RememberMePasswordKey: string;
95
99
  }
96
100
 
101
+ /** baseSearch 的通用请求参数 */
97
102
  export declare interface CommonParams {
98
103
  current?: number;
99
104
  size?: number;
@@ -149,28 +154,33 @@ export declare const currentConfig: {
149
154
  readonly appId: string | undefined;
150
155
  };
151
156
 
157
+ export { DateType }
158
+
159
+ /** 兼容旧名 */
160
+ export declare const Decrypt: typeof decrypt;
161
+
152
162
  /**
153
- * 解密方法
154
- * @param word
155
- * @returns
163
+ * 解密
156
164
  */
157
- export declare function Decrypt(word: string): string;
165
+ export declare function decrypt(word: string): string;
158
166
 
159
167
  /**
160
168
  * 设备 ID 回调
161
169
  */
162
170
  export declare type DeviceIdCallback = (deviceId: string) => void;
163
171
 
164
- export declare type DisplayInfo = "Continent" | "Country" | "Region" | "Province" | "City" | "Seaport" | "Airport";
172
+ /** 兼容旧名:baseSearch.DisplayInfo */
173
+ export declare type DisplayInfo = LocationType;
165
174
 
166
175
  export declare const emitter: Emitter<ModalEvents>;
167
176
 
177
+ /** 兼容旧名 */
178
+ export declare const Encrypt: typeof encrypt;
179
+
168
180
  /**
169
- * 加密方法
170
- * @param word
171
- * @returns
181
+ * 加密
172
182
  */
173
- export declare function Encrypt(word: string): string;
183
+ export declare function encrypt(word: string): string;
174
184
 
175
185
  export declare const ExpiresInKey: string;
176
186
 
@@ -191,26 +201,30 @@ export declare interface FetchClientIdOptions {
191
201
  injectRequest?: boolean;
192
202
  }
193
203
 
194
- /**
195
- * 获取字典列表
196
- * @param data
197
- * @returns
198
- */
199
204
  export declare function findDictApi(data?: {
200
205
  size: number;
201
206
  }): Promise<any>;
202
207
 
203
208
  export declare function findListByMobileEmailApi(data: any): Promise<any>;
204
209
 
205
- /**
206
- * 查询区号列表
207
- * @param data
208
- * @returns
209
- */
210
210
  export declare function findPAreaCodeApi(data?: {
211
211
  size: number;
212
212
  }): Promise<any>;
213
213
 
214
+ declare interface ForgotPasswordAccountData {
215
+ account?: string;
216
+ email?: string;
217
+ mobile?: string;
218
+ [key: string]: any;
219
+ }
220
+
221
+ declare interface ForgotPasswordVerifyData {
222
+ account?: string;
223
+ code?: string;
224
+ uuid?: string;
225
+ [key: string]: any;
226
+ }
227
+
214
228
  /**
215
229
  * ClientId 管理工具
216
230
  * 用于生成和管理唯一的客户端标识符
@@ -223,30 +237,19 @@ export declare function findPAreaCodeApi(data?: {
223
237
  */
224
238
  export declare function generateClientId(): string;
225
239
 
226
- export declare function getAirport(params?: {
240
+ export declare const getAirport: (params?: {
227
241
  page?: number;
228
242
  size?: number;
229
243
  ids?: number[];
230
- cityId?: number;
231
244
  countryId?: number;
232
- }): Promise<BaseResponse<UnifiedItem>>;
245
+ cityId?: number;
246
+ }) => Promise<BaseResponse<UnifiedItem>>;
247
+
248
+ export declare function getAirportByNameEnShow(nameEnShow: string): Promise<any>;
233
249
 
234
- /**
235
- * 跨环境获取 AppId (兼容 Vite, Webpack, Nuxt)
236
- */
237
250
  export declare function getAppId(): string;
238
251
 
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
- };
252
+ export declare function getAuthSessionItems(): AuthSessionData;
250
253
 
251
254
  /** 单 id 版本 */
252
255
  export declare function getById(type: DisplayInfo, id: number): Promise<UnifiedItem | null>;
@@ -266,50 +269,48 @@ export declare function getCitiesByCountry(countryId: number, opts?: {
266
269
  size?: number;
267
270
  }): Promise<BaseResponse<UnifiedItem>>;
268
271
 
269
- export declare function getCity(params?: {
272
+ export declare const getCity: (params?: {
270
273
  page?: number;
271
274
  size?: number;
272
275
  ids?: number[];
273
276
  countryId?: number;
274
- }): Promise<BaseResponse<UnifiedItem>>;
277
+ cityId?: number;
278
+ }) => Promise<BaseResponse<UnifiedItem>>;
279
+
280
+ export declare function getCityByNameEnShow(nameEnShow: string): Promise<any>;
275
281
 
276
- /**
277
- * 获取当前的常量配置
278
- */
279
282
  export declare const getCommonKeys: () => CommonKeysConfig;
280
283
 
281
284
  export declare const getCompanyOptionApi: (data: CompanyOption) => Promise<any>;
282
285
 
283
- /** 保留对外兼容函数:getContinent/getCountry/getCity/getProvince/getSeaport/getAirport */
284
- export declare function getContinent(params?: {
286
+ export declare const getContinent: (params?: {
285
287
  page?: number;
286
288
  size?: number;
287
- }): Promise<BaseResponse<UnifiedItem>>;
289
+ ids?: number[];
290
+ countryId?: number;
291
+ cityId?: number;
292
+ }) => Promise<BaseResponse<UnifiedItem>>;
288
293
 
289
- export declare function getCountry(params?: {
294
+ export declare const getCountry: (params?: {
290
295
  page?: number;
291
296
  size?: number;
292
297
  ids?: number[];
293
- }): Promise<BaseResponse<UnifiedItem>>;
298
+ countryId?: number;
299
+ cityId?: number;
300
+ }) => Promise<BaseResponse<UnifiedItem>>;
301
+
302
+ export declare function getCountryByNameEnShow(nameEnShow: string): Promise<any>;
294
303
 
295
304
  /**
296
305
  * 获取当前的 clientId(不会创建新的)
297
306
  */
298
307
  export declare function getCurrentClientId(): string | null;
299
308
 
300
- /**
301
- * 🚀 补全:获取 Access Token 的过期时间戳 (用于判断是否需要刷新)
302
- */
303
309
  export declare function getExpiresTimeIn(): number;
304
310
 
305
- /**
306
- * 获取一级域名 (用于 Cookie 跨域共享)
307
- */
308
311
  export declare function getFirstDomain(): string | undefined;
309
312
 
310
- export declare function getGioSessionItems(): {
311
- registerEntry: string | null;
312
- };
313
+ export declare function getGioSessionItems(): GioSessionData;
313
314
 
314
315
  /**
315
316
  * 兼容全环境的语言判断方法
@@ -319,22 +320,13 @@ export declare const getIsEn: () => boolean;
319
320
 
320
321
  export declare function getJoinCompanyApi(data: any): Promise<any>;
321
322
 
322
- /**
323
- * 获取当前语言
324
- * @returns
325
- */
326
323
  export declare function getLanguage(): string | undefined;
327
324
 
328
- /**
329
- * 获取本地 IP 数据
330
- * @param data
331
- * @returns
332
- */
333
- export declare function getLocalIpDataApi(data: any): Promise<any>;
325
+ export declare function getLocalIpDataApi(data: Record<string, any>): Promise<any>;
334
326
 
335
327
  export declare function getLoginQrCode(data?: {}): Promise<any>;
336
328
 
337
- export declare function getMEVCodeApi(data: any): Promise<any>;
329
+ export declare function getMEVCodeApi(data: ForgotPasswordVerifyData): Promise<any>;
338
330
 
339
331
  export declare function getMobileEmailApi(data: {
340
332
  id: string;
@@ -346,45 +338,36 @@ export declare function getMobileEmailApi(data: {
346
338
  */
347
339
  export declare function getOrCreateClientId(): string;
348
340
 
349
- /**
350
- * 跨环境获取 Path
351
- */
352
341
  export declare function getPathFromConfig(config: any): string;
353
342
 
354
- /**
355
- * 4. 导出操作方法
356
- */
357
343
  export declare function getProjectId(): string | undefined;
358
344
 
359
- export declare function getProvince(params?: {
345
+ export declare const getProvince: (params?: {
360
346
  page?: number;
361
347
  size?: number;
362
348
  ids?: number[];
363
349
  countryId?: number;
364
- }): Promise<BaseResponse<UnifiedItem>>;
350
+ cityId?: number;
351
+ }) => Promise<BaseResponse<UnifiedItem>>;
365
352
 
366
353
  export declare function getRedirectPathApi(appId: string, path: string): Promise<any>;
367
354
 
368
- /**
369
- * 🚀 补全:获取当前的 Refresh Token
370
- */
371
355
  export declare function getRefreshToken(): string | undefined;
372
356
 
373
- /**
374
- * 获取记住的账号
375
- */
376
357
  export declare function getRememberAccount(): {
377
358
  account?: string;
378
359
  password?: string;
379
360
  };
380
361
 
381
- export declare function getSeaport(params?: {
362
+ export declare const getSeaport: (params?: {
382
363
  page?: number;
383
364
  size?: number;
384
365
  ids?: number[];
385
- cityId?: number;
386
366
  countryId?: number;
387
- }): Promise<BaseResponse<UnifiedItem>>;
367
+ cityId?: number;
368
+ }) => Promise<BaseResponse<UnifiedItem>>;
369
+
370
+ export declare function getSeaportByNameEnShow(nameEnShow: string): Promise<any>;
388
371
 
389
372
  export declare function getSessionHeaderValue(key: string): string;
390
373
 
@@ -401,9 +384,6 @@ export declare const getSharedConfig: () => {
401
384
  readonly appId: string | undefined;
402
385
  };
403
386
 
404
- /**
405
- * 获取当前的 Access Token
406
- */
407
387
  export declare function getToken(): string | undefined;
408
388
 
409
389
  /**
@@ -425,10 +405,16 @@ export declare function getToken(): string | undefined;
425
405
  */
426
406
  export declare function getTracker<T extends GioTracker>(trackerInstance?: T): T | null;
427
407
 
428
- export declare function getUserInfoApi(data: any): Promise<any>;
408
+ export declare function getUserInfoApi(data: Record<string, any>): Promise<any>;
429
409
 
430
410
  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
411
 
412
+ /** clickPage 事件名常量 */
413
+ export declare const GIO_EVENT_CLICK_PAGE = "clickPage";
414
+
415
+ /** GIO session key 映射表 */
416
+ declare const GIO_SESSION_KEYS: Record<string, string>;
417
+
432
418
  /**
433
419
  * GIO 属性对象
434
420
  */
@@ -580,53 +566,15 @@ declare interface GioPerformanceOptions {
580
566
  network?: boolean | GioPerformanceNetwork;
581
567
  }
582
568
 
569
+ declare type GioSessionData = {
570
+ [K in keyof typeof GIO_SESSION_KEYS]?: string | null;
571
+ };
572
+
583
573
  /**
584
574
  * 事件计时器 ID 类型
585
575
  */
586
576
  export declare type GioTimerId = string;
587
577
 
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
578
  export declare type GioTrackAttrs = Record<string, string | number | Array<string | number> | null | undefined>;
631
579
 
632
580
  declare class GioTracker {
@@ -842,11 +790,10 @@ export declare interface GioUserAttributes {
842
790
  [key: string]: GioAttributeValue;
843
791
  }
844
792
 
793
+ export { GraphQLClientError }
794
+
845
795
  export declare const HasLoginKey: string;
846
796
 
847
- /**
848
- * 全局初始化方法,在项目入口调用
849
- */
850
797
  export declare const initCommonKeys: (newKeys: Partial<CommonKeysConfig>) => void;
851
798
 
852
799
  /**
@@ -880,15 +827,11 @@ export declare function installFetchClientId(options?: FetchClientIdOptions): vo
880
827
 
881
828
  export declare function inviteJoinGetCompApi(data: any): Promise<any>;
882
829
 
883
- export declare interface IResponse<T> {
830
+ /** 简化响应结构(仅 data 字段)— 兼容旧名 IResponse */
831
+ export declare type IResponse<T> = {
884
832
  data: T;
885
- }
833
+ };
886
834
 
887
- /**
888
- * 检查值是否为空
889
- * @param value 要检查的值
890
- * @returns 是否为空
891
- */
892
835
  export declare function isEmpty(value: any): boolean;
893
836
 
894
837
  /**
@@ -903,238 +846,68 @@ export declare function isEmpty(value: any): boolean;
903
846
  */
904
847
  export declare function isGioAvailable(trackerInstance?: typeof tracker): boolean;
905
848
 
906
- /**
907
- * 判断域名是否为 IP
908
- */
909
849
  export declare function isIpAddress(hostname: string): boolean;
910
850
 
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
851
  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
- }>;
852
+ searchByName: (params: SearchGenericParams) => Promise<BaseResponse<LocationUnifiedItem>>;
928
853
  searchByIdWithType: (id: number | string | Array<number | string>, type: LocationType, extraParams?: {
929
854
  lineType?: "air" | "shipping";
930
- }) => Promise<{
931
- records: LocationUnifiedItem[];
932
- total: number;
933
- current: number;
934
- size: number;
935
- }>;
855
+ }) => any;
936
856
  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
- }>;
857
+ searchRegionByName: (params: SearchByNameParams) => Promise<BaseResponse<LocationUnifiedItem>>;
858
+ getRegionByIds: (ids: number[]) => Promise<BaseResponse<LocationUnifiedItem>>;
859
+ searchByName: (params: SearchWithScopeParams) => Promise<BaseResponse<LocationUnifiedItem>>;
860
+ getByIds: (ids: number[] | string[]) => Promise<BaseResponse<LocationUnifiedItem>>;
949
861
  };
950
862
  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
- }>;
863
+ searchByName: (params: SearchByNameParams) => Promise<BaseResponse<LocationUnifiedItem>>;
864
+ getByIds: (ids: number[]) => Promise<BaseResponse<LocationUnifiedItem>>;
963
865
  };
964
866
  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
- }>;
867
+ getCitiesByCountry: (countryId: number, params?: PageParams) => Promise<BaseResponse<LocationUnifiedItem>>;
868
+ searchByName: (params: SearchWithScopeParams) => Promise<BaseResponse<LocationUnifiedItem>>;
869
+ getByIds: (ids: number[] | string[]) => Promise<BaseResponse<LocationUnifiedItem>>;
983
870
  };
984
871
  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
- }>;
872
+ searchByName: (params: SearchWithScopeParams) => Promise<BaseResponse<LocationUnifiedItem>>;
873
+ getByIds: (ids: number[] | string[]) => Promise<BaseResponse<LocationUnifiedItem>>;
997
874
  };
998
875
  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
- }>;
876
+ searchByName: (params: SearchWithScopeParams) => Promise<BaseResponse<LocationUnifiedItem>>;
877
+ getByIds: (ids: number[] | string[]) => Promise<BaseResponse<LocationUnifiedItem>>;
878
+ };
879
+ province: {
880
+ searchByName: (params: SearchWithScopeParams) => Promise<BaseResponse<LocationUnifiedItem>>;
881
+ getByIds: (ids: number[] | string[]) => Promise<BaseResponse<LocationUnifiedItem>>;
882
+ };
883
+ continent: {
884
+ searchByName: (params: SearchWithScopeParams) => Promise<BaseResponse<LocationUnifiedItem>>;
885
+ getByIds: (ids: number[] | string[]) => Promise<BaseResponse<LocationUnifiedItem>>;
1011
886
  };
1012
887
  wharf: {
1013
- getByIds: (ids: string[]) => Promise<{
1014
- records: LocationUnifiedItem[];
1015
- total: number;
1016
- current: number;
1017
- size: number;
1018
- }>;
888
+ getByIds: (ids: string[]) => Promise<BaseResponse<LocationUnifiedItem>>;
1019
889
  };
1020
890
  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
- }>;
891
+ searchShipping: (params: SearchByNameParams) => Promise<BaseResponse<LocationUnifiedItem>>;
892
+ searchAir: (params: SearchByNameParams) => Promise<BaseResponse<LocationUnifiedItem>>;
893
+ search: (params: SearchByNameParams, lineType: "air" | "shipping") => Promise<BaseResponse<LocationUnifiedItem>>;
894
+ getByIds: (ids: number[], lineType?: "air" | "shipping") => Promise<BaseResponse<LocationUnifiedItem>>;
1066
895
  };
1067
896
  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
- }>;
897
+ searchAllByCountry: (lineType: "air" | "shipping", countryId?: number) => Promise<BaseResponse<LocationUnifiedItem>>;
898
+ searchShipping: (params: SearchByNameParams) => Promise<BaseResponse<LocationUnifiedItem>>;
899
+ searchAir: (params: SearchByNameParams) => Promise<BaseResponse<LocationUnifiedItem>>;
900
+ search: (params: SearchByNameParams, lineType: "air" | "shipping") => Promise<BaseResponse<LocationUnifiedItem>>;
901
+ getByIds: (ids: number[], lineType?: "air" | "shipping") => Promise<BaseResponse<LocationUnifiedItem>>;
1119
902
  };
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
- }>;
903
+ getCitiesByCountry: (countryId: number, params?: PageParams) => Promise<BaseResponse<LocationUnifiedItem>>;
904
+ getChildrenByCity: (cityId: number, childTypes: Array<"Seaport" | "Airport" | "Wharf">, params?: PageParams) => Promise<BaseResponse<LocationUnifiedItem>>;
1134
905
  };
1135
906
 
907
+ /** 所有支持的搜索实体类型(V1 + V2 的 superset) */
1136
908
  export declare type LocationType = "Continent" | "Country" | "Region" | "Province" | "City" | "Seaport" | "Airport" | "Street" | "Town" | "Wharf" | "Carrier" | "Line";
1137
909
 
910
+ /** 标准化后的实体对象(V1 + V2 的 superset) */
1138
911
  export declare interface LocationUnifiedItem {
1139
912
  id: number | string;
1140
913
  type: LocationType;
@@ -1160,9 +933,9 @@ export declare function loginApi(loginData: LoginDataParams): Promise<IResponse<
1160
933
 
1161
934
  export declare function loginByEmailOrMobileCodeApi(data: any): Promise<IResponse<ApiResponse<LoginResponseData>>>;
1162
935
 
1163
- export declare function loginByFacebookApi(data: any): Promise<IResponse<ApiResponse<ThirdResponseData>>>;
936
+ export declare const loginByFacebookApi: (data: any) => Promise<IResponse<ApiResponse<ThirdResponseData>>>;
1164
937
 
1165
- export declare function loginByLinkedinApi(data: any): Promise<IResponse<ApiResponse<ThirdResponseData>>>;
938
+ export declare const loginByLinkedinApi: (data: any) => Promise<IResponse<ApiResponse<ThirdResponseData>>>;
1166
939
 
1167
940
  export declare function loginByQrCode(data: {
1168
941
  uniqueCode: string;
@@ -1175,6 +948,7 @@ export declare function loginByQrCode(data: {
1175
948
 
1176
949
  export declare function loginCodeBindWechatApi(data: any): Promise<any>;
1177
950
 
951
+ /** 登录请求参数 */
1178
952
  export declare interface LoginDataParams {
1179
953
  username: string;
1180
954
  password: string;
@@ -1189,6 +963,7 @@ export declare interface LoginDataParams {
1189
963
 
1190
964
  export declare function loginPwdBindWechatApi(data: any): Promise<any>;
1191
965
 
966
+ /** 登录响应的 data 层 */
1192
967
  export declare interface LoginResponseData {
1193
968
  redirect: boolean;
1194
969
  redirectPath?: string;
@@ -1197,6 +972,7 @@ export declare interface LoginResponseData {
1197
972
  hasLogon?: boolean;
1198
973
  }
1199
974
 
975
+ /** 登录结果中的 Token 信息 */
1200
976
  export declare interface LoginResult {
1201
977
  accessToken: string;
1202
978
  expireIn: number;
@@ -1223,11 +999,14 @@ export declare const normalizeAttrs: (attrs?: GioTrackAttrs) => GioTrackAttrs;
1223
999
 
1224
1000
  export declare const normalizeClickPageAttrs: (eventName: string, attrs?: GioTrackAttrs) => GioTrackAttrs;
1225
1001
 
1002
+ export { OpportunityBoardParams }
1003
+
1226
1004
  /**
1227
1005
  * 页面变更回调
1228
1006
  */
1229
1007
  export declare type PageListenerCallback = (pageProps: GioPageProps) => void;
1230
1008
 
1009
+ /** 分页参数 */
1231
1010
  export declare interface PageParams {
1232
1011
  current?: number;
1233
1012
  size?: number;
@@ -1235,6 +1014,28 @@ export declare interface PageParams {
1235
1014
 
1236
1015
  export declare const PrjId: string;
1237
1016
 
1017
+ /**
1018
+ * 查询商机有效看板数据(分页)。
1019
+ *
1020
+ * 【每次调用新建 SDK 实例,无状态污染】
1021
+ *
1022
+ * @example
1023
+ * ```ts
1024
+ * import { queryOpportunityBoard } from '@jctrans-materials/shared'
1025
+ *
1026
+ * const result = await queryOpportunityBoard({
1027
+ * compId: 12345,
1028
+ * dateType: 'QUARTER',
1029
+ * dateValue: '2026-Q2',
1030
+ * })
1031
+ *
1032
+ * if (result.success) {
1033
+ * console.log(result.data.records)
1034
+ * }
1035
+ * ```
1036
+ */
1037
+ export declare function queryOpportunityBoard(params: OpportunityBoardParams): Promise<BoardQueryResult>;
1038
+
1238
1039
  export declare const RefreshExpiresInKey: string;
1239
1040
 
1240
1041
  export declare const RefreshExpiresInTimeKey: string;
@@ -1257,13 +1058,13 @@ export declare const RememberMeAccountKey: string;
1257
1058
 
1258
1059
  export declare const RememberMePasswordKey: string;
1259
1060
 
1260
- export declare interface reportNewTypeData {
1061
+ export declare interface ReportNewTypeData {
1261
1062
  reportData: string;
1262
1063
  reportType: ReportType;
1263
1064
  countryId?: string | number;
1264
1065
  }
1265
1066
 
1266
- export declare function reportNewTypeDataApi(payload: reportNewTypeData): Promise<{}>;
1067
+ export declare function reportNewTypeDataApi(payload: ReportNewTypeData): Promise<Record<string, any>>;
1267
1068
 
1268
1069
  export declare type ReportType = "City" | "Seaport" | "Airport" | "Line" | "Carrier" | "shipping_line" | "shipping_carrier" | "air_line" | "air_carrier";
1269
1070
 
@@ -1290,7 +1091,14 @@ export declare function resetAuthSessionItems(): void;
1290
1091
 
1291
1092
  export declare function resetGioSessionItems(): void;
1292
1093
 
1293
- export declare function resetPasswordApi(data: any): Promise<any>;
1094
+ export declare function resetPasswordApi(data: ResetPasswordData): Promise<any>;
1095
+
1096
+ declare interface ResetPasswordData {
1097
+ account?: string;
1098
+ password?: string;
1099
+ code?: string;
1100
+ [key: string]: any;
1101
+ }
1294
1102
 
1295
1103
  /**
1296
1104
  * 保存 clientId 到 localStorage
@@ -1304,8 +1112,6 @@ export declare function saveClientIdToSessionStorage(clientId: string): void;
1304
1112
 
1305
1113
  /**
1306
1114
  * 统一搜索接口
1307
- * - 支持 keyword(模糊), displayInfo(数组), ids(按 type), scope(countryId/cityId/provinceId)
1308
- * - 返回扁平化的 UnifiedItem 列表 + 分页信息
1309
1115
  */
1310
1116
  export declare function search(params: {
1311
1117
  keyword?: string;
@@ -1330,7 +1136,7 @@ export declare function searchAirportByName(keyword: string, opts?: {
1330
1136
  page?: number;
1331
1137
  size?: number;
1332
1138
  cityId?: number;
1333
- }): Promise<BaseResponse<UnifiedItem>>;
1139
+ }): Promise<BaseResponse<LocationUnifiedItem>>;
1334
1140
 
1335
1141
  /**
1336
1142
  * 按名称搜索指定类型
@@ -1344,6 +1150,7 @@ export declare function searchByName(params: {
1344
1150
  sort?: string;
1345
1151
  }): Promise<BaseResponse<UnifiedItem>>;
1346
1152
 
1153
+ /** 按名称搜索参数 */
1347
1154
  export declare interface SearchByNameParams extends PageParams {
1348
1155
  keyword: string;
1349
1156
  searchMode?: "0" | "1" | "2";
@@ -1353,13 +1160,14 @@ export declare function searchCityByName(keyword: string, opts?: {
1353
1160
  page?: number;
1354
1161
  size?: number;
1355
1162
  countryId?: number;
1356
- }): Promise<BaseResponse<UnifiedItem>>;
1163
+ }): Promise<BaseResponse<LocationUnifiedItem>>;
1357
1164
 
1358
1165
  export declare function searchCountryByName(keyword: string, opts?: {
1359
1166
  page?: number;
1360
1167
  size?: number;
1361
- }): Promise<BaseResponse<UnifiedItem>>;
1168
+ }): Promise<BaseResponse<LocationUnifiedItem>>;
1362
1169
 
1170
+ /** 通用搜索参数(需指定 displayInfo) */
1363
1171
  export declare interface SearchGenericParams extends SearchByNameParams {
1364
1172
  displayInfo: LocationType[];
1365
1173
  }
@@ -1368,8 +1176,9 @@ export declare function searchSeaportByName(keyword: string, opts?: {
1368
1176
  page?: number;
1369
1177
  size?: number;
1370
1178
  cityId?: number;
1371
- }): Promise<BaseResponse<UnifiedItem>>;
1179
+ }): Promise<BaseResponse<LocationUnifiedItem>>;
1372
1180
 
1181
+ /** 带范围约束的搜索参数 */
1373
1182
  export declare interface SearchWithScopeParams extends SearchByNameParams {
1374
1183
  countryId?: number;
1375
1184
  cityId?: number;
@@ -1390,30 +1199,12 @@ export declare function sendMobileCodeApi(data: {
1390
1199
  uuid?: string;
1391
1200
  }): Promise<any>;
1392
1201
 
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;
1202
+ export declare function setAuthSessionItems(data: AuthSessionData): void;
1203
+
1204
+ export declare function setGioSessionItems(data: GioSessionData): void;
1408
1205
 
1409
- /**
1410
- * 记住账号 (替代存密码)
1411
- */
1412
1206
  export declare function setRememberMe(account: string, password: string, remember: boolean): void;
1413
1207
 
1414
- /**
1415
- * 整体设置所有凭证
1416
- */
1417
1208
  export declare function setTokenAll(data: TokenData | null | undefined): void;
1418
1209
 
1419
1210
  export declare interface SharedConfig {
@@ -1427,21 +1218,11 @@ export declare interface SharedConfig {
1427
1218
  commonKeys?: Partial<CommonKeysConfig>;
1428
1219
  }
1429
1220
 
1430
- /**
1431
- * 滑动或者点选验证
1432
- * @param data
1433
- * @returns
1434
- */
1435
1221
  export declare function slideCheckApi(data: {
1436
1222
  pointJson: string;
1437
1223
  uuid: string;
1438
1224
  }): Promise<any>;
1439
1225
 
1440
- /**
1441
- * 获取验证图片 以及token
1442
- * @param data
1443
- * @returns
1444
- */
1445
1226
  export declare function slideGetApi(data: {
1446
1227
  clientUid: string;
1447
1228
  ts: number;
@@ -1455,6 +1236,7 @@ export declare interface ThirdPartyInfo {
1455
1236
  [property: string]: any;
1456
1237
  }
1457
1238
 
1239
+ /** 第三方登录响应 */
1458
1240
  export declare interface ThirdResponse {
1459
1241
  code: number;
1460
1242
  data: ThirdResponseData;
@@ -1463,25 +1245,10 @@ export declare interface ThirdResponse {
1463
1245
  }
1464
1246
 
1465
1247
  export declare interface ThirdResponseData {
1466
- /**
1467
- * 手机邮箱匹配列表 (修正为数组)
1468
- */
1469
1248
  mobileEmailList: ThirdResponseMobileEmailList[];
1470
- /**
1471
- * 是否跳转, true跳转 false不跳转
1472
- */
1473
1249
  redirect: boolean;
1474
- /**
1475
- * 跳转路径
1476
- */
1477
1250
  redirectPath: string;
1478
- /**
1479
- * tgc
1480
- */
1481
1251
  tgc: string;
1482
- /**
1483
- * 三方信息
1484
- */
1485
1252
  thirdPartyInfo: ThirdPartyInfo;
1486
1253
  [property: string]: any;
1487
1254
  }
@@ -1506,9 +1273,6 @@ export declare interface ThirdResponseMobileEmailList {
1506
1273
 
1507
1274
  export declare const TOKEN_ENDPOINTS: Set<string>;
1508
1275
 
1509
- /**
1510
- * 3. 类型定义
1511
- */
1512
1276
  export declare interface TokenData {
1513
1277
  accessToken?: string;
1514
1278
  expireIn?: number;
@@ -1522,21 +1286,10 @@ export declare function toSafeHeaderValue(value: string): string;
1522
1286
 
1523
1287
  export declare const tracker: GioTracker;
1524
1288
 
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
- }
1289
+ /** 兼容旧名:baseSearch.UnifiedItem */
1290
+ export declare type UnifiedItem = LocationUnifiedItem;
1538
1291
 
1539
- export declare function userCompPermsApi(data: any): Promise<any>;
1292
+ export declare function userCompPermsApi(data: Record<string, any>): Promise<any>;
1540
1293
 
1541
1294
  export declare function validateAccountExistApi(data: {
1542
1295
  target: string;