@jctrans-materials/shared 1.0.16 → 1.0.18
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/api/applyData.d.ts +1 -1
- package/dist/api/auth.d.ts +6 -0
- package/dist/api/searchV2.d.ts +133 -3
- package/dist/config/index.d.ts +6 -0
- package/dist/index.cjs.js +6 -6
- package/dist/index.esm.js +1994 -1864
- package/package.json +1 -1
package/dist/api/applyData.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export type ReportType = "City" | "Seaport" | "Airport" | "Line";
|
|
|
2
2
|
export interface reportNewTypeData {
|
|
3
3
|
reportData: string;
|
|
4
4
|
reportType: ReportType;
|
|
5
|
-
countryId
|
|
5
|
+
countryId?: string | number;
|
|
6
6
|
}
|
|
7
7
|
declare function reportNewTypeDataApi(payload: reportNewTypeData): Promise<{}>;
|
|
8
8
|
export { reportNewTypeDataApi };
|
package/dist/api/auth.d.ts
CHANGED
|
@@ -55,6 +55,12 @@ export declare function autoLoginByTGC(data: {
|
|
|
55
55
|
* @returns
|
|
56
56
|
*/
|
|
57
57
|
export declare function completeCompRedirectApi(data: any): Promise<any>;
|
|
58
|
+
/**
|
|
59
|
+
* 完善信息加入公司
|
|
60
|
+
* @param data
|
|
61
|
+
* @returns
|
|
62
|
+
*/
|
|
63
|
+
export declare function completeJoinCompanyRedirectApi(data: any): Promise<any>;
|
|
58
64
|
export declare function checkAccountExistsFPApi(data: any): Promise<any>;
|
|
59
65
|
export declare function getMEVCodeApi(data: any): Promise<any>;
|
|
60
66
|
export declare function resetPasswordApi(data: any): Promise<any>;
|
package/dist/api/searchV2.d.ts
CHANGED
|
@@ -1,10 +1,28 @@
|
|
|
1
|
-
export type LocationType = "Continent" | "Country" | "Region" | "Province" | "City" | "Seaport" | "Airport" | "Street" | "Town" | "Wharf";
|
|
1
|
+
export type LocationType = "Continent" | "Country" | "Region" | "Province" | "City" | "Seaport" | "Airport" | "Street" | "Town" | "Wharf" | "Carrier" | "Line";
|
|
2
2
|
export interface LocationUnifiedItem {
|
|
3
3
|
id: number | string;
|
|
4
4
|
type: LocationType;
|
|
5
5
|
nameCn?: string;
|
|
6
6
|
nameEn?: string;
|
|
7
7
|
display?: string;
|
|
8
|
+
displayEn?: string;
|
|
9
|
+
displayCn?: string;
|
|
10
|
+
/** * 通用代码字段 (自动取 scacCode 或 carrierCode)
|
|
11
|
+
* 适用于仅展示用途
|
|
12
|
+
*/
|
|
13
|
+
code?: string;
|
|
14
|
+
/** * SCAC 代码 (Standard Carrier Alpha Code) - 通常用于船司
|
|
15
|
+
*/
|
|
16
|
+
scacCode?: string;
|
|
17
|
+
/** * IATA 代码 - 通常用于航司
|
|
18
|
+
*/
|
|
19
|
+
iataCode?: string;
|
|
20
|
+
/** * 承运人通用代码
|
|
21
|
+
*/
|
|
22
|
+
carrierCode?: string;
|
|
23
|
+
/** * 承运人类型: 'air' | 'shipping'
|
|
24
|
+
*/
|
|
25
|
+
lineType?: string;
|
|
8
26
|
continent?: Record<string, any>;
|
|
9
27
|
country?: Record<string, any>;
|
|
10
28
|
city?: Record<string, any>;
|
|
@@ -27,6 +45,22 @@ export interface SearchWithScopeParams extends SearchByNameParams {
|
|
|
27
45
|
export interface SearchGenericParams extends SearchByNameParams {
|
|
28
46
|
displayInfo: LocationType[];
|
|
29
47
|
}
|
|
48
|
+
interface CarrierRequestPayload {
|
|
49
|
+
current: number;
|
|
50
|
+
size: number;
|
|
51
|
+
lineType: "air" | "shipping";
|
|
52
|
+
searchkey?: string;
|
|
53
|
+
ids?: number[];
|
|
54
|
+
[key: string]: any;
|
|
55
|
+
}
|
|
56
|
+
interface LineRequestPayload {
|
|
57
|
+
current: number;
|
|
58
|
+
size: number;
|
|
59
|
+
lineType: "air" | "shipping";
|
|
60
|
+
searchkey?: string;
|
|
61
|
+
ids?: number[];
|
|
62
|
+
[key: string]: any;
|
|
63
|
+
}
|
|
30
64
|
export declare const locationSearchV2: {
|
|
31
65
|
SEARCH_VERSION: string;
|
|
32
66
|
searchByName: (params: SearchGenericParams) => Promise<{
|
|
@@ -35,7 +69,9 @@ export declare const locationSearchV2: {
|
|
|
35
69
|
current: number;
|
|
36
70
|
size: number;
|
|
37
71
|
}>;
|
|
38
|
-
searchByIdWithType: (id: number | string | Array<number | string>, type: LocationType
|
|
72
|
+
searchByIdWithType: (id: number | string | Array<number | string>, type: LocationType, extraParams?: {
|
|
73
|
+
lineType?: "air" | "shipping";
|
|
74
|
+
}) => Promise<{
|
|
39
75
|
records: LocationUnifiedItem[];
|
|
40
76
|
total: number;
|
|
41
77
|
current: number;
|
|
@@ -125,6 +161,100 @@ export declare const locationSearchV2: {
|
|
|
125
161
|
size: number;
|
|
126
162
|
}>;
|
|
127
163
|
};
|
|
164
|
+
carrier: {
|
|
165
|
+
/**
|
|
166
|
+
* 内部私有方法:构建符合 Carrier 接口要求的 payload
|
|
167
|
+
*/
|
|
168
|
+
_buildPayload: (params: Partial<SearchByNameParams> & {
|
|
169
|
+
ids?: number[];
|
|
170
|
+
}, lineType: "air" | "shipping") => CarrierRequestPayload;
|
|
171
|
+
/**
|
|
172
|
+
* 搜索船公司 (Shipping Line)
|
|
173
|
+
*/
|
|
174
|
+
searchShipping: (params: SearchByNameParams) => Promise<{
|
|
175
|
+
records: LocationUnifiedItem[];
|
|
176
|
+
total: number;
|
|
177
|
+
current: number;
|
|
178
|
+
size: number;
|
|
179
|
+
}>;
|
|
180
|
+
/**
|
|
181
|
+
* 搜索航空公司 (Airline)
|
|
182
|
+
*/
|
|
183
|
+
searchAir: (params: SearchByNameParams) => Promise<{
|
|
184
|
+
records: LocationUnifiedItem[];
|
|
185
|
+
total: number;
|
|
186
|
+
current: number;
|
|
187
|
+
size: number;
|
|
188
|
+
}>;
|
|
189
|
+
/**
|
|
190
|
+
* 通用搜索 (需要手动传入 type)
|
|
191
|
+
* 场景:如果前端有一个下拉框让用户选类型,则调用此方法
|
|
192
|
+
*/
|
|
193
|
+
search: (params: SearchByNameParams, lineType: "air" | "shipping") => Promise<{
|
|
194
|
+
records: LocationUnifiedItem[];
|
|
195
|
+
total: number;
|
|
196
|
+
current: number;
|
|
197
|
+
size: number;
|
|
198
|
+
}>;
|
|
199
|
+
/**
|
|
200
|
+
* 根据 ID 获取详情
|
|
201
|
+
* 注意:根据你的 Interface,ID 查询可能也需要传 lineType,
|
|
202
|
+
* 默认设为 shipping,或者你需要拆分成两个 ID 方法
|
|
203
|
+
*/
|
|
204
|
+
getByIds: (ids: number[], lineType?: "air" | "shipping") => Promise<{
|
|
205
|
+
records: LocationUnifiedItem[];
|
|
206
|
+
total: number;
|
|
207
|
+
current: number;
|
|
208
|
+
size: number;
|
|
209
|
+
}>;
|
|
210
|
+
};
|
|
211
|
+
line: {
|
|
212
|
+
/**
|
|
213
|
+
* 内部私有方法:构建符合后端要求的 Payload
|
|
214
|
+
*/
|
|
215
|
+
_buildPayload: (params: Partial<SearchByNameParams> & {
|
|
216
|
+
ids?: number[];
|
|
217
|
+
}, lineType: "air" | "shipping") => LineRequestPayload;
|
|
218
|
+
/**
|
|
219
|
+
* 搜索海运航线 (Shipping Line)
|
|
220
|
+
* 例如:AE1, TP9
|
|
221
|
+
*/
|
|
222
|
+
searchShipping: (params: SearchByNameParams) => Promise<{
|
|
223
|
+
records: LocationUnifiedItem[];
|
|
224
|
+
total: number;
|
|
225
|
+
current: number;
|
|
226
|
+
size: number;
|
|
227
|
+
}>;
|
|
228
|
+
/**
|
|
229
|
+
* 搜索空运航线 (Air Line)
|
|
230
|
+
* 业务上较少见,但接口支持
|
|
231
|
+
*/
|
|
232
|
+
searchAir: (params: SearchByNameParams) => Promise<{
|
|
233
|
+
records: LocationUnifiedItem[];
|
|
234
|
+
total: number;
|
|
235
|
+
current: number;
|
|
236
|
+
size: number;
|
|
237
|
+
}>;
|
|
238
|
+
/**
|
|
239
|
+
* 通用搜索 (需要手动传 lineType)
|
|
240
|
+
*/
|
|
241
|
+
search: (params: SearchByNameParams, lineType: "air" | "shipping") => Promise<{
|
|
242
|
+
records: LocationUnifiedItem[];
|
|
243
|
+
total: number;
|
|
244
|
+
current: number;
|
|
245
|
+
size: number;
|
|
246
|
+
}>;
|
|
247
|
+
/**
|
|
248
|
+
* 根据 ID 获取航线详情
|
|
249
|
+
* 默认默认为 shipping,如需查空运航线需显式传入
|
|
250
|
+
*/
|
|
251
|
+
getByIds: (ids: number[], lineType?: "air" | "shipping") => Promise<{
|
|
252
|
+
records: LocationUnifiedItem[];
|
|
253
|
+
total: number;
|
|
254
|
+
current: number;
|
|
255
|
+
size: number;
|
|
256
|
+
}>;
|
|
257
|
+
};
|
|
128
258
|
/** 获取某个国家下的所有城市 */
|
|
129
259
|
getCitiesByCountry: (countryId: number, params?: PageParams) => Promise<{
|
|
130
260
|
records: LocationUnifiedItem[];
|
|
@@ -132,7 +262,7 @@ export declare const locationSearchV2: {
|
|
|
132
262
|
current: number;
|
|
133
263
|
size: number;
|
|
134
264
|
}>;
|
|
135
|
-
/**
|
|
265
|
+
/** 获取某个城市下的子实体 */
|
|
136
266
|
getChildrenByCity: (cityId: number, childTypes: Array<"Seaport" | "Airport" | "Wharf">, params?: PageParams) => Promise<{
|
|
137
267
|
records: LocationUnifiedItem[];
|
|
138
268
|
total: number;
|
package/dist/config/index.d.ts
CHANGED
|
@@ -2,10 +2,14 @@ export interface SharedConfig {
|
|
|
2
2
|
prefixPath: string;
|
|
3
3
|
searchPath: string;
|
|
4
4
|
oldSearchPath: string;
|
|
5
|
+
carrierPath: string;
|
|
6
|
+
linePath: string;
|
|
5
7
|
appId?: string;
|
|
6
8
|
}
|
|
7
9
|
export declare const currentConfig: {
|
|
8
10
|
readonly basePath: string;
|
|
11
|
+
readonly carrierPath: string;
|
|
12
|
+
readonly linePath: string;
|
|
9
13
|
readonly oldBasePath: string;
|
|
10
14
|
readonly prefixPath: string;
|
|
11
15
|
};
|
|
@@ -18,6 +22,8 @@ export declare const initSharedConfig: (newConfig: Partial<SharedConfig>) => voi
|
|
|
18
22
|
*/
|
|
19
23
|
export declare const getSharedConfig: () => {
|
|
20
24
|
readonly basePath: string;
|
|
25
|
+
readonly carrierPath: string;
|
|
26
|
+
readonly linePath: string;
|
|
21
27
|
readonly oldBasePath: string;
|
|
22
28
|
readonly prefixPath: string;
|
|
23
29
|
};
|