@orm-plugin/ghg-data-converter 0.1.1 → 0.1.3
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/ccs/src/client.d.ts +5 -1
- package/dist/ccs/src/eems-template.d.ts +43 -0
- package/dist/ccs/src/index.d.ts +1 -0
- package/dist/ccs/src/noon-converter.d.ts +41 -0
- package/dist/dnv/src/index.d.ts +1 -0
- package/dist/dnv/src/noon-converter.d.ts +28 -0
- package/dist/index.js +533 -152
- package/dist/index.umd.cjs +2 -2
- package/package.json +1 -1
package/dist/ccs/src/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CcsDeletePort, CcsResponse, CcsVoyageData } from './eems-template';
|
|
1
|
+
import { CcsDeletePort, CcsImoVoyageData, CcsResponse, CcsVoyageData } from './eems-template';
|
|
2
2
|
|
|
3
3
|
export interface CcsClientOptions {
|
|
4
4
|
/** 公司license,向CCS申请 */
|
|
@@ -37,6 +37,10 @@ export declare class CcsEemsClient {
|
|
|
37
37
|
* 数据上报接口:船舶航次能效数据(覆盖式,船舶号+航次号+航次首港离港年份判断)
|
|
38
38
|
*/
|
|
39
39
|
reportVoyageData(voyageData: CcsVoyageData): Promise<CcsResponse>;
|
|
40
|
+
/**
|
|
41
|
+
* IMO新规数据上报接口:定速航行存油量与各排放源燃油消耗
|
|
42
|
+
*/
|
|
43
|
+
reportImoFuelData(voyageData: CcsImoVoyageData): Promise<CcsResponse>;
|
|
40
44
|
/**
|
|
41
45
|
* 数据删除接口:按港口唯一识别码删除
|
|
42
46
|
*/
|
|
@@ -218,6 +218,40 @@ export interface CcsDeletePort {
|
|
|
218
218
|
imoNo: string;
|
|
219
219
|
refCodes: string[];
|
|
220
220
|
}
|
|
221
|
+
export declare enum CcsOspType {
|
|
222
|
+
FOSP = "1",
|
|
223
|
+
EOSP = "2"
|
|
224
|
+
}
|
|
225
|
+
export interface CcsImoPortOil {
|
|
226
|
+
oilId: CcsOilCode;
|
|
227
|
+
addBillNo?: string;
|
|
228
|
+
stockTons: number;
|
|
229
|
+
}
|
|
230
|
+
export interface CcsFuelConsumer {
|
|
231
|
+
consumerType: CcsConsumerType;
|
|
232
|
+
oilId: CcsOilCode;
|
|
233
|
+
oilTons: number;
|
|
234
|
+
}
|
|
235
|
+
export interface CcsImoVoyageInfo {
|
|
236
|
+
imoNo: string;
|
|
237
|
+
refCode: string;
|
|
238
|
+
/** 定速时间(本地时间),格式:yyyy-mm-dd 24HH:MI */
|
|
239
|
+
ospTm: string;
|
|
240
|
+
ospZone: number;
|
|
241
|
+
ospType: CcsOspType;
|
|
242
|
+
pointType?: string;
|
|
243
|
+
/** 经度,表示方法:39°54′ E/W */
|
|
244
|
+
longitude: string;
|
|
245
|
+
/** 纬度,表示方法:39°54′ N/S */
|
|
246
|
+
latitude: string;
|
|
247
|
+
/** 定速航行距离(定速开始时置空) */
|
|
248
|
+
distance?: number;
|
|
249
|
+
voyagePortoils: CcsImoPortOil[];
|
|
250
|
+
fuelConsumers: CcsFuelConsumer[];
|
|
251
|
+
}
|
|
252
|
+
export interface CcsImoVoyageData {
|
|
253
|
+
voyageInfos: CcsImoVoyageInfo[];
|
|
254
|
+
}
|
|
221
255
|
export interface CcsResponse {
|
|
222
256
|
imoNo?: string;
|
|
223
257
|
voyageCode?: string;
|
|
@@ -234,6 +268,7 @@ export interface CcsValidateError {
|
|
|
234
268
|
reason: string;
|
|
235
269
|
}
|
|
236
270
|
export declare const CCS_TM_PATTERN: RegExp;
|
|
271
|
+
export declare const CCS_TM_MINUTE_PATTERN: RegExp;
|
|
237
272
|
export declare class CcsEemsTemplate {
|
|
238
273
|
/**
|
|
239
274
|
* 解析本系统Port字段:`NEWCASTLE (AUSTRALIA) | AUNTL | +10.0`
|
|
@@ -252,6 +287,10 @@ export declare class CcsEemsTemplate {
|
|
|
252
287
|
* UTC时间转指定时区的本地时间,格式:yyyy-mm-dd 24HH:MI:SS
|
|
253
288
|
*/
|
|
254
289
|
formatLocalTime(utcDate: Date | string, zone: number | null): string;
|
|
290
|
+
/**
|
|
291
|
+
* UTC时间转指定时区的本地时间,格式:yyyy-mm-dd 24HH:MI(IMO新规接口)
|
|
292
|
+
*/
|
|
293
|
+
formatLocalTimeMinute(utcDate: Date | string, zone: number | null): string;
|
|
255
294
|
/**
|
|
256
295
|
* 十进制度转度分格式:39°54′ N / 122°06′ E
|
|
257
296
|
*/
|
|
@@ -273,5 +312,9 @@ export declare class CcsEemsTemplate {
|
|
|
273
312
|
* 报文校验:必填节点、格式与字典值检查
|
|
274
313
|
*/
|
|
275
314
|
validate(voyageData: CcsVoyageData, errors?: CcsValidateError[]): CcsValidateError[];
|
|
315
|
+
/**
|
|
316
|
+
* IMO新规上报接口报文校验:必填节点、格式与字典值检查
|
|
317
|
+
*/
|
|
318
|
+
validateImo(voyageData: CcsImoVoyageData, errors?: CcsValidateError[]): CcsValidateError[];
|
|
276
319
|
}
|
|
277
320
|
export declare const ccsEemsTemplate: CcsEemsTemplate;
|
package/dist/ccs/src/index.d.ts
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { CcsImoVoyageData, CcsVoyageData } from './eems-template';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 船报输入的最小字段契约;其余船报字段通过索引签名透传
|
|
5
|
+
*/
|
|
6
|
+
export interface CcsNoonReport {
|
|
7
|
+
/** BOSP / NOON / EOSP / ... */
|
|
8
|
+
Type: string;
|
|
9
|
+
Date: Date | string;
|
|
10
|
+
IMO?: number | string | null;
|
|
11
|
+
Port?: string | null;
|
|
12
|
+
Offset?: string | null;
|
|
13
|
+
Lat?: number | string | null;
|
|
14
|
+
Lng?: number | string | null;
|
|
15
|
+
DistSLR?: number | null;
|
|
16
|
+
CargoWeight?: number | null;
|
|
17
|
+
Ballast?: number | null;
|
|
18
|
+
voyage?: {
|
|
19
|
+
number?: string | null;
|
|
20
|
+
} | null;
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
}
|
|
23
|
+
export type CcsBuildWarn = (message: string, ...args: any[]) => void;
|
|
24
|
+
export interface CcsVoyageBuildOptions {
|
|
25
|
+
/** 航次编号,缺省取 noons[0].voyage.number */
|
|
26
|
+
voyageCode?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface CcsImoBuildOptions {
|
|
29
|
+
warn?: CcsBuildWarn;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* 船报转CCS能效数据:EOSP为抵港,其后首个BOSP为离港;
|
|
33
|
+
* distance为上次离港至本次抵港间各船报DistSLR之和
|
|
34
|
+
*/
|
|
35
|
+
export declare function buildCcsVoyageData(voyageId: string, noons: CcsNoonReport[], options?: CcsVoyageBuildOptions): CcsVoyageData;
|
|
36
|
+
/**
|
|
37
|
+
* 船报转CCS IMO新规报文:BOSP为定速开始(FOSP)、EOSP为定速结束(EOSP);
|
|
38
|
+
* FOSP消耗=上一EOSP至本BOSP区间,EOSP消耗=本BOSP至本EOSP区间,均按船报逐条区间消耗累加;
|
|
39
|
+
* 缺少前序定速事件时跳过该事件的fuelConsumers
|
|
40
|
+
*/
|
|
41
|
+
export declare function buildCcsImoVoyageData(voyageId: string, noons: CcsNoonReport[], options?: CcsImoBuildOptions): CcsImoVoyageData;
|
package/dist/dnv/src/index.d.ts
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 船报输入的最小字段契约;其余船报字段通过索引签名透传
|
|
3
|
+
*/
|
|
4
|
+
export interface DnvNoonReport {
|
|
5
|
+
/** BOSP / NOON / EOSP / ... */
|
|
6
|
+
Type: string;
|
|
7
|
+
Date: Date | string;
|
|
8
|
+
IMO?: number | string | null;
|
|
9
|
+
Port?: string | null;
|
|
10
|
+
NextPort?: string | null;
|
|
11
|
+
PortActivity?: string | null;
|
|
12
|
+
Lat?: number | string | null;
|
|
13
|
+
Lng?: number | string | null;
|
|
14
|
+
DistSLR?: number | null;
|
|
15
|
+
TimeSLR?: number | null;
|
|
16
|
+
CargoWeight?: number | null;
|
|
17
|
+
WindBF?: number | null;
|
|
18
|
+
Remarks?: string | null;
|
|
19
|
+
VoyNum?: string | null;
|
|
20
|
+
voyage?: {
|
|
21
|
+
voyNum?: string | null;
|
|
22
|
+
} | null;
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 船报数组转 OVDLA(Log Abstract) 二维表,首行为表头
|
|
27
|
+
*/
|
|
28
|
+
export declare function buildDnvOvdData(noons: DnvNoonReport[]): string[][];
|