@fatehan/tsrp 1.0.3 → 1.0.5
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/fatehan/reports/report.d.ts +7 -6
- package/dist/fatehan/reports/report.d.ts.map +1 -1
- package/dist/fatehan/reports/report.js +176 -159
- package/dist/fatehan/trips/trip.js +86 -86
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/package.json +15 -7
- package/readme.md +25 -1
|
@@ -1972,20 +1972,20 @@ exports.Trip = {
|
|
|
1972
1972
|
fromJSON(object) {
|
|
1973
1973
|
return {
|
|
1974
1974
|
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
|
1975
|
-
deviceId: isSet(object.
|
|
1975
|
+
deviceId: isSet(object.device_id) ? globalThis.Number(object.device_id) : 0,
|
|
1976
1976
|
mileage: isSet(object.mileage) ? globalThis.Number(object.mileage) : 0,
|
|
1977
1977
|
idling: isSet(object.idling) ? globalThis.Number(object.idling) : 0,
|
|
1978
1978
|
parking: isSet(object.parking) ? globalThis.Number(object.parking) : 0,
|
|
1979
1979
|
moving: isSet(object.moving) ? globalThis.Number(object.moving) : 0,
|
|
1980
1980
|
towing: isSet(object.towing) ? globalThis.Number(object.towing) : 0,
|
|
1981
|
-
totalSpeed: isSet(object.
|
|
1982
|
-
sumSpeed: isSet(object.
|
|
1983
|
-
maxSpeed: isSet(object.
|
|
1981
|
+
totalSpeed: isSet(object.total_speed) ? globalThis.Number(object.total_speed) : 0,
|
|
1982
|
+
sumSpeed: isSet(object.sum_speed) ? globalThis.Number(object.sum_speed) : 0,
|
|
1983
|
+
maxSpeed: isSet(object.max_speed) ? globalThis.Number(object.max_speed) : 0,
|
|
1984
1984
|
compact: isSet(object.compact) ? exports.TripCompact.fromJSON(object.compact) : undefined,
|
|
1985
|
-
startedAt: isSet(object.
|
|
1986
|
-
finishedAt: isSet(object.
|
|
1987
|
-
createdAt: isSet(object.
|
|
1988
|
-
updatedAt: isSet(object.
|
|
1985
|
+
startedAt: isSet(object.started_at) ? fromJsonTimestamp(object.started_at) : undefined,
|
|
1986
|
+
finishedAt: isSet(object.finished_at) ? fromJsonTimestamp(object.finished_at) : undefined,
|
|
1987
|
+
createdAt: isSet(object.created_at) ? fromJsonTimestamp(object.created_at) : undefined,
|
|
1988
|
+
updatedAt: isSet(object.updated_at) ? fromJsonTimestamp(object.updated_at) : undefined,
|
|
1989
1989
|
};
|
|
1990
1990
|
},
|
|
1991
1991
|
toJSON(message) {
|
|
@@ -1994,7 +1994,7 @@ exports.Trip = {
|
|
|
1994
1994
|
obj.id = Math.round(message.id);
|
|
1995
1995
|
}
|
|
1996
1996
|
if (message.deviceId !== 0) {
|
|
1997
|
-
obj.
|
|
1997
|
+
obj.device_id = Math.round(message.deviceId);
|
|
1998
1998
|
}
|
|
1999
1999
|
if (message.mileage !== 0) {
|
|
2000
2000
|
obj.mileage = Math.round(message.mileage);
|
|
@@ -2012,28 +2012,28 @@ exports.Trip = {
|
|
|
2012
2012
|
obj.towing = Math.round(message.towing);
|
|
2013
2013
|
}
|
|
2014
2014
|
if (message.totalSpeed !== 0) {
|
|
2015
|
-
obj.
|
|
2015
|
+
obj.total_speed = Math.round(message.totalSpeed);
|
|
2016
2016
|
}
|
|
2017
2017
|
if (message.sumSpeed !== 0) {
|
|
2018
|
-
obj.
|
|
2018
|
+
obj.sum_speed = Math.round(message.sumSpeed);
|
|
2019
2019
|
}
|
|
2020
2020
|
if (message.maxSpeed !== 0) {
|
|
2021
|
-
obj.
|
|
2021
|
+
obj.max_speed = Math.round(message.maxSpeed);
|
|
2022
2022
|
}
|
|
2023
2023
|
if (message.compact !== undefined) {
|
|
2024
2024
|
obj.compact = exports.TripCompact.toJSON(message.compact);
|
|
2025
2025
|
}
|
|
2026
2026
|
if (message.startedAt !== undefined) {
|
|
2027
|
-
obj.
|
|
2027
|
+
obj.started_at = message.startedAt.toISOString();
|
|
2028
2028
|
}
|
|
2029
2029
|
if (message.finishedAt !== undefined) {
|
|
2030
|
-
obj.
|
|
2030
|
+
obj.finished_at = message.finishedAt.toISOString();
|
|
2031
2031
|
}
|
|
2032
2032
|
if (message.createdAt !== undefined) {
|
|
2033
|
-
obj.
|
|
2033
|
+
obj.created_at = message.createdAt.toISOString();
|
|
2034
2034
|
}
|
|
2035
2035
|
if (message.updatedAt !== undefined) {
|
|
2036
|
-
obj.
|
|
2036
|
+
obj.updated_at = message.updatedAt.toISOString();
|
|
2037
2037
|
}
|
|
2038
2038
|
return obj;
|
|
2039
2039
|
},
|
|
@@ -2303,8 +2303,8 @@ exports.TripCompact = {
|
|
|
2303
2303
|
records: isSet(object.records) ? globalThis.Number(object.records) : 0,
|
|
2304
2304
|
start: isSet(object.start) ? exports.TripPoint.fromJSON(object.start) : undefined,
|
|
2305
2305
|
finish: isSet(object.finish) ? exports.TripPoint.fromJSON(object.finish) : undefined,
|
|
2306
|
-
greenDriving: isObject(object.
|
|
2307
|
-
? Object.entries(object.
|
|
2306
|
+
greenDriving: isObject(object.green_driving)
|
|
2307
|
+
? Object.entries(object.green_driving).reduce((acc, [key, value]) => {
|
|
2308
2308
|
acc[globalThis.Number(key)] = Number(value);
|
|
2309
2309
|
return acc;
|
|
2310
2310
|
}, {})
|
|
@@ -2321,13 +2321,13 @@ exports.TripCompact = {
|
|
|
2321
2321
|
return acc;
|
|
2322
2322
|
}, {})
|
|
2323
2323
|
: {},
|
|
2324
|
-
iButton: isSet(object.
|
|
2324
|
+
iButton: isSet(object.i_button) ? globalThis.Number(object.i_button) : undefined,
|
|
2325
2325
|
ignition: isSet(object.ignition) ? globalThis.Number(object.ignition) : undefined,
|
|
2326
|
-
doorOpened: isSet(object.
|
|
2327
|
-
fuelUsed: isSet(object.
|
|
2328
|
-
fuelRate: isSet(object.
|
|
2329
|
-
engineRpm: isSet(object.
|
|
2330
|
-
engineLoad: isSet(object.
|
|
2326
|
+
doorOpened: isSet(object.door_opened) ? globalThis.Number(object.door_opened) : undefined,
|
|
2327
|
+
fuelUsed: isSet(object.fuel_used) ? globalThis.Number(object.fuel_used) : undefined,
|
|
2328
|
+
fuelRate: isSet(object.fuel_rate) ? globalThis.Number(object.fuel_rate) : undefined,
|
|
2329
|
+
engineRpm: isSet(object.engine_rpm) ? globalThis.Number(object.engine_rpm) : undefined,
|
|
2330
|
+
engineLoad: isSet(object.engine_load) ? globalThis.Number(object.engine_load) : undefined,
|
|
2331
2331
|
crashes: isObject(object.crashes)
|
|
2332
2332
|
? Object.entries(object.crashes).reduce((acc, [key, value]) => {
|
|
2333
2333
|
acc[globalThis.Number(key)] = Number(value);
|
|
@@ -2363,9 +2363,9 @@ exports.TripCompact = {
|
|
|
2363
2363
|
if (message.greenDriving) {
|
|
2364
2364
|
const entries = Object.entries(message.greenDriving);
|
|
2365
2365
|
if (entries.length > 0) {
|
|
2366
|
-
obj.
|
|
2366
|
+
obj.green_driving = {};
|
|
2367
2367
|
entries.forEach(([k, v]) => {
|
|
2368
|
-
obj.
|
|
2368
|
+
obj.green_driving[k] = Math.round(v);
|
|
2369
2369
|
});
|
|
2370
2370
|
}
|
|
2371
2371
|
}
|
|
@@ -2388,25 +2388,25 @@ exports.TripCompact = {
|
|
|
2388
2388
|
}
|
|
2389
2389
|
}
|
|
2390
2390
|
if (message.iButton !== undefined) {
|
|
2391
|
-
obj.
|
|
2391
|
+
obj.i_button = Math.round(message.iButton);
|
|
2392
2392
|
}
|
|
2393
2393
|
if (message.ignition !== undefined) {
|
|
2394
2394
|
obj.ignition = Math.round(message.ignition);
|
|
2395
2395
|
}
|
|
2396
2396
|
if (message.doorOpened !== undefined) {
|
|
2397
|
-
obj.
|
|
2397
|
+
obj.door_opened = Math.round(message.doorOpened);
|
|
2398
2398
|
}
|
|
2399
2399
|
if (message.fuelUsed !== undefined) {
|
|
2400
|
-
obj.
|
|
2400
|
+
obj.fuel_used = Math.round(message.fuelUsed);
|
|
2401
2401
|
}
|
|
2402
2402
|
if (message.fuelRate !== undefined) {
|
|
2403
|
-
obj.
|
|
2403
|
+
obj.fuel_rate = Math.round(message.fuelRate);
|
|
2404
2404
|
}
|
|
2405
2405
|
if (message.engineRpm !== undefined) {
|
|
2406
|
-
obj.
|
|
2406
|
+
obj.engine_rpm = Math.round(message.engineRpm);
|
|
2407
2407
|
}
|
|
2408
2408
|
if (message.engineLoad !== undefined) {
|
|
2409
|
-
obj.
|
|
2409
|
+
obj.engine_load = Math.round(message.engineLoad);
|
|
2410
2410
|
}
|
|
2411
2411
|
if (message.crashes) {
|
|
2412
2412
|
const entries = Object.entries(message.crashes);
|
|
@@ -3386,39 +3386,39 @@ exports.FusionTrip = {
|
|
|
3386
3386
|
fromJSON(object) {
|
|
3387
3387
|
return {
|
|
3388
3388
|
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
|
3389
|
-
deviceId: isSet(object.
|
|
3389
|
+
deviceId: isSet(object.device_id) ? globalThis.Number(object.device_id) : 0,
|
|
3390
3390
|
mileage: isSet(object.mileage) ? globalThis.Number(object.mileage) : 0,
|
|
3391
3391
|
idling: isSet(object.idling) ? globalThis.Number(object.idling) : 0,
|
|
3392
3392
|
parking: isSet(object.parking) ? globalThis.Number(object.parking) : 0,
|
|
3393
3393
|
moving: isSet(object.moving) ? globalThis.Number(object.moving) : 0,
|
|
3394
3394
|
towing: isSet(object.towing) ? globalThis.Number(object.towing) : 0,
|
|
3395
|
-
speedTotal: isSet(object.
|
|
3396
|
-
speedSum: isSet(object.
|
|
3397
|
-
speedMax: isSet(object.
|
|
3395
|
+
speedTotal: isSet(object.speed_total) ? globalThis.Number(object.speed_total) : 0,
|
|
3396
|
+
speedSum: isSet(object.speed_sum) ? globalThis.Number(object.speed_sum) : 0,
|
|
3397
|
+
speedMax: isSet(object.speed_max) ? globalThis.Number(object.speed_max) : 0,
|
|
3398
3398
|
records: isSet(object.records) ? globalThis.Number(object.records) : 0,
|
|
3399
|
-
harshAcceleration: isSet(object.
|
|
3400
|
-
harshBreak: isSet(object.
|
|
3401
|
-
harshCorner: isSet(object.
|
|
3402
|
-
minTemp01: isSet(object.
|
|
3403
|
-
maxTemp01: isSet(object.
|
|
3404
|
-
minTemp02: isSet(object.
|
|
3405
|
-
maxTemp02: isSet(object.
|
|
3406
|
-
minTemp03: isSet(object.
|
|
3407
|
-
maxTemp03: isSet(object.
|
|
3408
|
-
minTemp04: isSet(object.
|
|
3409
|
-
maxTemp04: isSet(object.
|
|
3410
|
-
minHumidity: isSet(object.
|
|
3411
|
-
maxHumidity: isSet(object.
|
|
3412
|
-
startLat: isSet(object.
|
|
3413
|
-
startLng: isSet(object.
|
|
3414
|
-
finishLat: isSet(object.
|
|
3415
|
-
finishLng: isSet(object.
|
|
3416
|
-
startedAt: isSet(object.
|
|
3417
|
-
finishedAt: isSet(object.
|
|
3418
|
-
createdAt: isSet(object.
|
|
3419
|
-
updatedAt: isSet(object.
|
|
3420
|
-
Logs: isSet(object.
|
|
3421
|
-
Fug: isSet(object.
|
|
3399
|
+
harshAcceleration: isSet(object.harsh_acceleration) ? globalThis.Number(object.harsh_acceleration) : 0,
|
|
3400
|
+
harshBreak: isSet(object.harsh_break) ? globalThis.Number(object.harsh_break) : 0,
|
|
3401
|
+
harshCorner: isSet(object.harsh_corner) ? globalThis.Number(object.harsh_corner) : 0,
|
|
3402
|
+
minTemp01: isSet(object.min_temp01) ? globalThis.Number(object.min_temp01) : undefined,
|
|
3403
|
+
maxTemp01: isSet(object.max_temp01) ? globalThis.Number(object.max_temp01) : undefined,
|
|
3404
|
+
minTemp02: isSet(object.min_temp02) ? globalThis.Number(object.min_temp02) : undefined,
|
|
3405
|
+
maxTemp02: isSet(object.max_temp02) ? globalThis.Number(object.max_temp02) : undefined,
|
|
3406
|
+
minTemp03: isSet(object.min_temp03) ? globalThis.Number(object.min_temp03) : undefined,
|
|
3407
|
+
maxTemp03: isSet(object.max_temp03) ? globalThis.Number(object.max_temp03) : undefined,
|
|
3408
|
+
minTemp04: isSet(object.min_temp04) ? globalThis.Number(object.min_temp04) : undefined,
|
|
3409
|
+
maxTemp04: isSet(object.max_temp04) ? globalThis.Number(object.max_temp04) : undefined,
|
|
3410
|
+
minHumidity: isSet(object.min_humidity) ? globalThis.Number(object.min_humidity) : undefined,
|
|
3411
|
+
maxHumidity: isSet(object.max_humidity) ? globalThis.Number(object.max_humidity) : undefined,
|
|
3412
|
+
startLat: isSet(object.start_lat) ? globalThis.Number(object.start_lat) : undefined,
|
|
3413
|
+
startLng: isSet(object.start_lng) ? globalThis.Number(object.start_lng) : undefined,
|
|
3414
|
+
finishLat: isSet(object.finish_lat) ? globalThis.Number(object.finish_lat) : undefined,
|
|
3415
|
+
finishLng: isSet(object.finish_lng) ? globalThis.Number(object.finish_lng) : undefined,
|
|
3416
|
+
startedAt: isSet(object.started_at) ? fromJsonTimestamp(object.started_at) : undefined,
|
|
3417
|
+
finishedAt: isSet(object.finished_at) ? fromJsonTimestamp(object.finished_at) : undefined,
|
|
3418
|
+
createdAt: isSet(object.created_at) ? fromJsonTimestamp(object.created_at) : undefined,
|
|
3419
|
+
updatedAt: isSet(object.updated_at) ? fromJsonTimestamp(object.updated_at) : undefined,
|
|
3420
|
+
Logs: isSet(object.logs) ? globalThis.String(object.logs) : "",
|
|
3421
|
+
Fug: isSet(object.fug) ? globalThis.Number(object.fug) : undefined,
|
|
3422
3422
|
};
|
|
3423
3423
|
},
|
|
3424
3424
|
toJSON(message) {
|
|
@@ -3427,7 +3427,7 @@ exports.FusionTrip = {
|
|
|
3427
3427
|
obj.id = Math.round(message.id);
|
|
3428
3428
|
}
|
|
3429
3429
|
if (message.deviceId !== 0) {
|
|
3430
|
-
obj.
|
|
3430
|
+
obj.device_id = Math.round(message.deviceId);
|
|
3431
3431
|
}
|
|
3432
3432
|
if (message.mileage !== 0) {
|
|
3433
3433
|
obj.mileage = Math.round(message.mileage);
|
|
@@ -3445,85 +3445,85 @@ exports.FusionTrip = {
|
|
|
3445
3445
|
obj.towing = Math.round(message.towing);
|
|
3446
3446
|
}
|
|
3447
3447
|
if (message.speedTotal !== 0) {
|
|
3448
|
-
obj.
|
|
3448
|
+
obj.speed_total = Math.round(message.speedTotal);
|
|
3449
3449
|
}
|
|
3450
3450
|
if (message.speedSum !== 0) {
|
|
3451
|
-
obj.
|
|
3451
|
+
obj.speed_sum = Math.round(message.speedSum);
|
|
3452
3452
|
}
|
|
3453
3453
|
if (message.speedMax !== 0) {
|
|
3454
|
-
obj.
|
|
3454
|
+
obj.speed_max = Math.round(message.speedMax);
|
|
3455
3455
|
}
|
|
3456
3456
|
if (message.records !== 0) {
|
|
3457
3457
|
obj.records = Math.round(message.records);
|
|
3458
3458
|
}
|
|
3459
3459
|
if (message.harshAcceleration !== 0) {
|
|
3460
|
-
obj.
|
|
3460
|
+
obj.harsh_acceleration = Math.round(message.harshAcceleration);
|
|
3461
3461
|
}
|
|
3462
3462
|
if (message.harshBreak !== 0) {
|
|
3463
|
-
obj.
|
|
3463
|
+
obj.harsh_break = Math.round(message.harshBreak);
|
|
3464
3464
|
}
|
|
3465
3465
|
if (message.harshCorner !== 0) {
|
|
3466
|
-
obj.
|
|
3466
|
+
obj.harsh_corner = Math.round(message.harshCorner);
|
|
3467
3467
|
}
|
|
3468
3468
|
if (message.minTemp01 !== undefined) {
|
|
3469
|
-
obj.
|
|
3469
|
+
obj.min_temp01 = Math.round(message.minTemp01);
|
|
3470
3470
|
}
|
|
3471
3471
|
if (message.maxTemp01 !== undefined) {
|
|
3472
|
-
obj.
|
|
3472
|
+
obj.max_temp01 = Math.round(message.maxTemp01);
|
|
3473
3473
|
}
|
|
3474
3474
|
if (message.minTemp02 !== undefined) {
|
|
3475
|
-
obj.
|
|
3475
|
+
obj.min_temp02 = Math.round(message.minTemp02);
|
|
3476
3476
|
}
|
|
3477
3477
|
if (message.maxTemp02 !== undefined) {
|
|
3478
|
-
obj.
|
|
3478
|
+
obj.max_temp02 = Math.round(message.maxTemp02);
|
|
3479
3479
|
}
|
|
3480
3480
|
if (message.minTemp03 !== undefined) {
|
|
3481
|
-
obj.
|
|
3481
|
+
obj.min_temp03 = Math.round(message.minTemp03);
|
|
3482
3482
|
}
|
|
3483
3483
|
if (message.maxTemp03 !== undefined) {
|
|
3484
|
-
obj.
|
|
3484
|
+
obj.max_temp03 = Math.round(message.maxTemp03);
|
|
3485
3485
|
}
|
|
3486
3486
|
if (message.minTemp04 !== undefined) {
|
|
3487
|
-
obj.
|
|
3487
|
+
obj.min_temp04 = Math.round(message.minTemp04);
|
|
3488
3488
|
}
|
|
3489
3489
|
if (message.maxTemp04 !== undefined) {
|
|
3490
|
-
obj.
|
|
3490
|
+
obj.max_temp04 = Math.round(message.maxTemp04);
|
|
3491
3491
|
}
|
|
3492
3492
|
if (message.minHumidity !== undefined) {
|
|
3493
|
-
obj.
|
|
3493
|
+
obj.min_humidity = Math.round(message.minHumidity);
|
|
3494
3494
|
}
|
|
3495
3495
|
if (message.maxHumidity !== undefined) {
|
|
3496
|
-
obj.
|
|
3496
|
+
obj.max_humidity = Math.round(message.maxHumidity);
|
|
3497
3497
|
}
|
|
3498
3498
|
if (message.startLat !== undefined) {
|
|
3499
|
-
obj.
|
|
3499
|
+
obj.start_lat = message.startLat;
|
|
3500
3500
|
}
|
|
3501
3501
|
if (message.startLng !== undefined) {
|
|
3502
|
-
obj.
|
|
3502
|
+
obj.start_lng = message.startLng;
|
|
3503
3503
|
}
|
|
3504
3504
|
if (message.finishLat !== undefined) {
|
|
3505
|
-
obj.
|
|
3505
|
+
obj.finish_lat = message.finishLat;
|
|
3506
3506
|
}
|
|
3507
3507
|
if (message.finishLng !== undefined) {
|
|
3508
|
-
obj.
|
|
3508
|
+
obj.finish_lng = message.finishLng;
|
|
3509
3509
|
}
|
|
3510
3510
|
if (message.startedAt !== undefined) {
|
|
3511
|
-
obj.
|
|
3511
|
+
obj.started_at = message.startedAt.toISOString();
|
|
3512
3512
|
}
|
|
3513
3513
|
if (message.finishedAt !== undefined) {
|
|
3514
|
-
obj.
|
|
3514
|
+
obj.finished_at = message.finishedAt.toISOString();
|
|
3515
3515
|
}
|
|
3516
3516
|
if (message.createdAt !== undefined) {
|
|
3517
|
-
obj.
|
|
3517
|
+
obj.created_at = message.createdAt.toISOString();
|
|
3518
3518
|
}
|
|
3519
3519
|
if (message.updatedAt !== undefined) {
|
|
3520
|
-
obj.
|
|
3520
|
+
obj.updated_at = message.updatedAt.toISOString();
|
|
3521
3521
|
}
|
|
3522
3522
|
if (message.Logs !== "") {
|
|
3523
|
-
obj.
|
|
3523
|
+
obj.logs = message.Logs;
|
|
3524
3524
|
}
|
|
3525
3525
|
if (message.Fug !== undefined) {
|
|
3526
|
-
obj.
|
|
3526
|
+
obj.fug = Math.round(message.Fug);
|
|
3527
3527
|
}
|
|
3528
3528
|
return obj;
|
|
3529
3529
|
},
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TripPerformanceRequest, TripPerformanceResponse, TripReportRequest, TripReportResponse } from "./fatehan/reports/report";
|
|
2
2
|
export declare class ReportService {
|
|
3
3
|
private readonly url;
|
|
4
|
+
private readonly namespace;
|
|
4
5
|
private readonly headers;
|
|
5
6
|
constructor(url: string, authorization?: string, organizationId?: string);
|
|
6
7
|
TripPerformanceReport(request: TripPerformanceRequest): Promise<TripPerformanceResponse>;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,sBAAsB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EACrB,MAAM,0BAA0B,CAAC;AAElC,qBAAa,aAAa;IACtB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkC;IAC5D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;gBAE1B,GAAG,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM;IAcjE,qBAAqB,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAgBxF,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAe7E"}
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.ReportService = void 0;
|
|
|
4
4
|
const report_1 = require("./fatehan/reports/report");
|
|
5
5
|
class ReportService {
|
|
6
6
|
constructor(url, authorization, organizationId) {
|
|
7
|
+
this.namespace = "fatehan.ReportService";
|
|
7
8
|
this.url = url;
|
|
8
9
|
this.headers = {
|
|
9
10
|
"Content-Type": "application/octet-stream",
|
|
@@ -18,7 +19,7 @@ class ReportService {
|
|
|
18
19
|
}
|
|
19
20
|
TripPerformanceReport(request) {
|
|
20
21
|
return new Promise(async (resolve, reject) => {
|
|
21
|
-
const response = await fetch(`${this.url}/
|
|
22
|
+
const response = await fetch(`${this.url}/${this.namespace}/TripPerformanceReport`, {
|
|
22
23
|
method: "POST",
|
|
23
24
|
headers: this.headers,
|
|
24
25
|
body: report_1.TripPerformanceRequest.encode(request).finish(),
|
|
@@ -33,7 +34,7 @@ class ReportService {
|
|
|
33
34
|
}
|
|
34
35
|
TripReport(request) {
|
|
35
36
|
return new Promise(async (resolve, reject) => {
|
|
36
|
-
const response = await fetch(`${this.url}/
|
|
37
|
+
const response = await fetch(`${this.url}/${this.namespace}/TripReport`, {
|
|
37
38
|
method: "POST",
|
|
38
39
|
headers: this.headers,
|
|
39
40
|
body: report_1.TripReportRequest.encode(request).finish(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fatehan/tsrp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "fatehan main models",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -11,22 +11,30 @@
|
|
|
11
11
|
"type": "git",
|
|
12
12
|
"url": "git+ssh://git@github.com:FatehanNew/tsrp.git"
|
|
13
13
|
},
|
|
14
|
-
"keywords": [
|
|
14
|
+
"keywords": [
|
|
15
|
+
"fatehan",
|
|
16
|
+
"protobuf",
|
|
17
|
+
"grpc",
|
|
18
|
+
"tsrp",
|
|
19
|
+
"report",
|
|
20
|
+
"models"
|
|
21
|
+
],
|
|
15
22
|
"author": "96rajabi@gmail.com",
|
|
16
23
|
"license": "MIT",
|
|
17
24
|
"scripts": {
|
|
18
25
|
"build": "tsc",
|
|
19
26
|
"test": "vitest"
|
|
20
27
|
},
|
|
21
|
-
"dependencies": {
|
|
22
|
-
"google-protobuf": "^3.21.4"
|
|
23
|
-
},
|
|
24
28
|
"devDependencies": {
|
|
25
29
|
"@types/google-protobuf": "^3.15.12",
|
|
26
|
-
"@types/node": "^22.
|
|
30
|
+
"@types/node": "^22.15.2",
|
|
27
31
|
"ts-node": "^10.9.2",
|
|
28
32
|
"ts-proto": "^2.7.0",
|
|
29
|
-
"typescript": "^5.
|
|
33
|
+
"typescript": "^5.8.3",
|
|
30
34
|
"vitest": "^3.1.2"
|
|
35
|
+
},
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"@bufbuild/protobuf": "^2.2.5",
|
|
38
|
+
"google-protobuf": "^3.21.4"
|
|
31
39
|
}
|
|
32
40
|
}
|
package/readme.md
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
# WSTS - Fatehan TypeScript Report Service
|
|
2
|
+
|
|
3
|
+
### Without GRPC
|
|
2
4
|
|
|
3
5
|
```cmd
|
|
4
6
|
protoc \
|
|
@@ -8,4 +10,26 @@ protoc \
|
|
|
8
10
|
--ts_proto_out=./src/fatehan \
|
|
9
11
|
--ts_proto_opt=outputServices=none,outputClientImpl=false,esModuleInterop=true,outputEncodeMethods=true,outputJsonMethods=true \
|
|
10
12
|
../protocols/**/*.proto
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### GRPC Including
|
|
16
|
+
|
|
17
|
+
```cmd
|
|
18
|
+
protoc \
|
|
19
|
+
--plugin=protoc-gen-ts_proto=/usr/bin/protoc-gen-ts_proto \
|
|
20
|
+
-I ./src/fatehan \
|
|
21
|
+
-I ../protocols \
|
|
22
|
+
--ts_proto_out=./src/fatehan \
|
|
23
|
+
--ts_proto_opt=outputServices=grpc-web,outputClientImpl=grpc-web,esModuleInterop=true,outputEncodeMethods=true,outputJsonMethods=true \
|
|
24
|
+
../protocols/**/*.proto
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Build
|
|
28
|
+
```cmd
|
|
29
|
+
npm run build
|
|
30
|
+
```
|
|
31
|
+
### Deploy
|
|
32
|
+
```cmd
|
|
33
|
+
npm version patch
|
|
34
|
+
npm publish
|
|
11
35
|
```
|