sgerp-frontend-lib 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/README.md +1 -1
- package/dist/connection-manager.d.ts +48 -0
- package/dist/connection-manager.d.ts.map +1 -0
- package/dist/connection-manager.js +156 -0
- package/dist/index.js +20 -2
- package/dist/locales/locale-server.d.ts +10 -0
- package/dist/locales/locale-server.d.ts.map +1 -0
- package/dist/locales/locale-server.js +49 -0
- package/dist/locales/locale.d.ts +23 -0
- package/dist/locales/locale.d.ts.map +1 -0
- package/dist/locales/locale.js +145 -0
- package/dist/locales/locale_en.d.ts.map +1 -1
- package/dist/locales/locale_en.js +84 -9
- package/dist/locales/locale_ja.d.ts.map +1 -1
- package/dist/locales/locale_ja.js +84 -9
- package/dist/locales/locale_ms.d.ts.map +1 -1
- package/dist/locales/locale_ms.js +84 -9
- package/dist/locales/useLocalization.d.ts +11 -0
- package/dist/locales/useLocalization.d.ts.map +1 -0
- package/dist/locales/useLocalization.js +64 -0
- package/dist/locales.d.ts +228 -0
- package/dist/locales.d.ts.map +1 -0
- package/dist/locales.js +229 -0
- package/dist/sgerp/api/client.d.ts +45 -0
- package/dist/sgerp/api/client.d.ts.map +1 -0
- package/dist/sgerp/api/client.js +141 -0
- package/dist/sgerp/client.js +341 -0
- package/dist/sgerp/collection.d.ts +391 -0
- package/dist/sgerp/collection.d.ts.map +1 -0
- package/dist/sgerp/collection.js +756 -0
- package/dist/sgerp/collections/account/user.d.ts +8 -0
- package/dist/sgerp/collections/account/user.d.ts.map +1 -0
- package/dist/sgerp/collections/account/user.js +10 -0
- package/dist/sgerp/collections/masstransit/building.d.ts +26 -0
- package/dist/sgerp/collections/masstransit/building.d.ts.map +1 -0
- package/dist/sgerp/collections/masstransit/building.js +53 -0
- package/dist/sgerp/collections/masstransit/transitstop.d.ts +15 -0
- package/dist/sgerp/collections/masstransit/transitstop.d.ts.map +1 -0
- package/dist/sgerp/collections/masstransit/transitstop.js +54 -0
- package/dist/sgerp/collections/masstransit/transitstopset.d.ts +10 -0
- package/dist/sgerp/collections/masstransit/transitstopset.d.ts.map +1 -0
- package/dist/sgerp/collections/masstransit/transitstopset.js +10 -0
- package/dist/sgerp/collections/sharing/organization-project.d.ts +11 -0
- package/dist/sgerp/collections/sharing/organization-project.d.ts.map +1 -0
- package/dist/sgerp/collections/sharing/organization-project.js +13 -0
- package/dist/sgerp/collections/sharing/organization.d.ts +11 -0
- package/dist/sgerp/collections/sharing/organization.d.ts.map +1 -0
- package/dist/sgerp/collections/sharing/organization.js +13 -0
- package/dist/sgerp/collections/sharing/pricing.d.ts +18 -0
- package/dist/sgerp/collections/sharing/pricing.d.ts.map +1 -0
- package/dist/sgerp/collections/sharing/pricing.js +23 -0
- package/dist/sgerp/collections/sharing/project-member.d.ts +8 -0
- package/dist/sgerp/collections/sharing/project-member.d.ts.map +1 -0
- package/dist/sgerp/collections/sharing/project-member.js +10 -0
- package/dist/sgerp/collections/sharing/project.d.ts +8 -0
- package/dist/sgerp/collections/sharing/project.d.ts.map +1 -0
- package/dist/sgerp/collections/sharing/project.js +10 -0
- package/dist/sgerp/collections/simulation/booking.d.ts +11 -0
- package/dist/sgerp/collections/simulation/booking.d.ts.map +1 -0
- package/dist/sgerp/collections/simulation/booking.js +13 -0
- package/dist/sgerp/collections/simulation/dataset.d.ts +14 -0
- package/dist/sgerp/collections/simulation/dataset.d.ts.map +1 -0
- package/dist/sgerp/collections/simulation/dataset.js +17 -0
- package/dist/sgerp/collections/simulation/driver.d.ts +12 -0
- package/dist/sgerp/collections/simulation/driver.d.ts.map +1 -0
- package/dist/sgerp/collections/simulation/driver.js +40 -0
- package/dist/sgerp/collections/simulation/geofence.d.ts +24 -0
- package/dist/sgerp/collections/simulation/geofence.d.ts.map +1 -0
- package/dist/sgerp/collections/simulation/geofence.js +66 -0
- package/dist/sgerp/collections/simulation/mapboxtoken.d.ts +18 -0
- package/dist/sgerp/collections/simulation/mapboxtoken.d.ts.map +1 -0
- package/dist/sgerp/collections/simulation/mapboxtoken.js +24 -0
- package/dist/sgerp/collections/simulation/node.js +13 -0
- package/dist/sgerp/collections/simulation/operationslocation.d.ts +28 -0
- package/dist/sgerp/collections/simulation/operationslocation.d.ts.map +1 -0
- package/dist/sgerp/collections/simulation/operationslocation.js +64 -0
- package/dist/sgerp/collections/simulation/operationslocationgroup.d.ts +12 -0
- package/dist/sgerp/collections/simulation/operationslocationgroup.d.ts.map +1 -0
- package/dist/sgerp/collections/simulation/operationslocationgroup.js +24 -0
- package/dist/sgerp/collections/simulation/routingprofile.d.ts +10 -0
- package/dist/sgerp/collections/simulation/routingprofile.d.ts.map +1 -0
- package/dist/sgerp/collections/simulation/routingprofile.js +10 -0
- package/dist/sgerp/collections/simulation/simulation.d.ts +12 -0
- package/dist/sgerp/collections/simulation/simulation.d.ts.map +1 -0
- package/dist/sgerp/collections/simulation/simulation.js +35 -0
- package/dist/sgerp/collections/simulation/simulationprocessor.d.ts +19 -0
- package/dist/sgerp/collections/simulation/simulationprocessor.d.ts.map +1 -0
- package/dist/sgerp/collections/simulation/simulationprocessor.js +27 -0
- package/dist/sgerp/collections/simulation/vehicle.js +13 -0
- package/dist/sgerp/collections/simulation/vehicletype.d.ts +11 -0
- package/dist/sgerp/collections/simulation/vehicletype.d.ts.map +1 -0
- package/dist/sgerp/collections/simulation/vehicletype.js +13 -0
- package/dist/sgerp/collections/sms_notify/smsscheduled.d.ts +11 -0
- package/dist/sgerp/collections/sms_notify/smsscheduled.d.ts.map +1 -0
- package/dist/sgerp/collections/sms_notify/smsscheduled.js +13 -0
- package/dist/sgerp/collections/transportation/passenger.d.ts +8 -0
- package/dist/sgerp/collections/transportation/passenger.d.ts.map +1 -0
- package/dist/sgerp/collections/transportation/passenger.js +10 -0
- package/dist/sgerp/collections/transportation/ticket.d.ts +11 -0
- package/dist/sgerp/collections/transportation/ticket.d.ts.map +1 -0
- package/dist/sgerp/collections/transportation/ticket.js +13 -0
- package/dist/sgerp/collections/transportation/transaction.d.ts +11 -0
- package/dist/sgerp/collections/transportation/transaction.d.ts.map +1 -0
- package/dist/sgerp/collections/transportation/transaction.js +13 -0
- package/dist/sgerp/constants/bulkoperations-enums.d.ts +71 -0
- package/dist/sgerp/constants/bulkoperations-enums.d.ts.map +1 -0
- package/dist/sgerp/constants/bulkoperations-enums.js +99 -0
- package/dist/sgerp/constants/messages-enums.d.ts +47 -0
- package/dist/sgerp/constants/messages-enums.d.ts.map +1 -0
- package/dist/sgerp/constants/messages-enums.js +67 -0
- package/dist/sgerp/constants/scheduling-enums.d.ts +42 -0
- package/dist/sgerp/constants/scheduling-enums.d.ts.map +1 -0
- package/dist/sgerp/constants/scheduling-enums.js +61 -0
- package/dist/sgerp/constants/simulation-enums.d.ts +93 -0
- package/dist/sgerp/constants/simulation-enums.d.ts.map +1 -0
- package/dist/sgerp/constants/simulation-enums.js +147 -0
- package/dist/sgerp/constants/solver-strategies.d.ts +75 -0
- package/dist/sgerp/constants/solver-strategies.d.ts.map +1 -0
- package/dist/sgerp/constants/solver-strategies.js +26 -0
- package/dist/sgerp/context/sgerp-context.js +134 -0
- package/dist/sgerp/domains.d.ts +47 -0
- package/dist/sgerp/domains.d.ts.map +1 -0
- package/dist/sgerp/domains.js +45 -0
- package/dist/sgerp/hooks/use-collection.js +122 -0
- package/dist/sgerp/hooks/use-live-updates.js +16 -13
- package/dist/sgerp/index.js +153 -0
- package/dist/sgerp/map-states/operations-location-state.d.ts +12 -0
- package/dist/sgerp/map-states/operations-location-state.d.ts.map +1 -0
- package/dist/sgerp/map-states/operations-location-state.js +86 -0
- package/dist/sgerp/routing/index.d.ts +51 -0
- package/dist/sgerp/routing/index.d.ts.map +1 -0
- package/dist/sgerp/routing/index.js +373 -0
- package/dist/sgerp/simulation-logic/fetchUtils.d.ts +8 -8
- package/dist/sgerp/simulation-logic/fetchUtils.d.ts.map +1 -1
- package/dist/sgerp/simulation-logic/fetchUtils.js +226 -0
- package/dist/sgerp/simulation-logic/index.js +27 -7
- package/dist/sgerp/simulation-logic/manualEditUtils.d.ts +1 -1
- package/dist/sgerp/simulation-logic/manualEditUtils.d.ts.map +1 -1
- package/dist/sgerp/simulation-logic/manualEditUtils.js +69 -0
- package/dist/sgerp/simulation-logic/mapUtils.js +58 -0
- package/dist/sgerp/simulation-logic/optimisticUpdateUtils.js +8 -5
- package/dist/sgerp/simulation-logic/referenceUtils.d.ts +3 -3
- package/dist/sgerp/simulation-logic/referenceUtils.d.ts.map +1 -1
- package/dist/sgerp/simulation-logic/referenceUtils.js +110 -0
- package/dist/sgerp/simulation-logic/routeCalculationUtils.d.ts +3 -3
- package/dist/sgerp/simulation-logic/routeCalculationUtils.d.ts.map +1 -1
- package/dist/sgerp/simulation-logic/routeCalculationUtils.js +43 -0
- package/dist/sgerp/simulation-logic/timeShiftUtils.d.ts +1 -1
- package/dist/sgerp/simulation-logic/timeShiftUtils.d.ts.map +1 -1
- package/dist/sgerp/simulation-logic/timeShiftUtils.js +63 -0
- package/dist/sgerp/types/account/user.d.ts +38 -0
- package/dist/sgerp/types/account/user.d.ts.map +1 -0
- package/dist/sgerp/types/account/user.js +2 -0
- package/dist/sgerp/types/bulkoperations/index.d.ts +37 -0
- package/dist/sgerp/types/bulkoperations/index.d.ts.map +1 -0
- package/dist/sgerp/types/bulkoperations/index.js +35 -0
- package/dist/sgerp/types/bulkoperations/vehicle-upload.d.ts +335 -0
- package/dist/sgerp/types/bulkoperations/vehicle-upload.d.ts.map +1 -0
- package/dist/sgerp/types/bulkoperations/vehicle-upload.js +49 -0
- package/dist/sgerp/types/config.d.ts +25 -0
- package/dist/sgerp/types/config.d.ts.map +1 -0
- package/dist/sgerp/types/config.js +2 -0
- package/dist/sgerp/types/geojson.d.ts +45 -0
- package/dist/sgerp/types/geojson.d.ts.map +1 -0
- package/dist/sgerp/types/geojson.js +6 -0
- package/dist/sgerp/types/map.d.ts +24 -0
- package/dist/sgerp/types/map.d.ts.map +1 -0
- package/dist/sgerp/types/map.js +2 -0
- package/dist/sgerp/types/masstransit/building.d.ts +24 -0
- package/dist/sgerp/types/masstransit/building.d.ts.map +1 -0
- package/dist/sgerp/types/masstransit/building.js +2 -0
- package/dist/sgerp/types/masstransit/transitstop.d.ts +35 -0
- package/dist/sgerp/types/masstransit/transitstop.d.ts.map +1 -0
- package/dist/sgerp/types/masstransit/transitstop.js +2 -0
- package/dist/sgerp/types/masstransit/transitstopset.d.ts +14 -0
- package/dist/sgerp/types/masstransit/transitstopset.d.ts.map +1 -0
- package/dist/sgerp/types/masstransit/transitstopset.js +2 -0
- package/dist/sgerp/types/sharing/organization-project.d.ts +14 -0
- package/dist/sgerp/types/sharing/organization-project.d.ts.map +1 -0
- package/dist/sgerp/types/sharing/organization-project.js +2 -0
- package/dist/sgerp/types/sharing/organization.d.ts +14 -0
- package/dist/sgerp/types/sharing/organization.d.ts.map +1 -0
- package/dist/sgerp/types/sharing/organization.js +2 -0
- package/dist/sgerp/types/sharing/pricing.d.ts +98 -0
- package/dist/sgerp/types/sharing/pricing.d.ts.map +1 -0
- package/dist/sgerp/types/sharing/pricing.js +2 -0
- package/dist/sgerp/types/sharing/project-member.d.ts +15 -0
- package/dist/sgerp/types/sharing/project-member.d.ts.map +1 -0
- package/dist/sgerp/types/sharing/project-member.js +2 -0
- package/dist/sgerp/types/sharing/project.d.ts +16 -0
- package/dist/sgerp/types/sharing/project.d.ts.map +1 -0
- package/dist/sgerp/types/sharing/project.js +2 -0
- package/dist/sgerp/types/simulation/booking.d.ts +128 -0
- package/dist/sgerp/types/simulation/booking.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/booking.js +24 -0
- package/dist/sgerp/types/simulation/calculation-params.d.ts +20 -0
- package/dist/sgerp/types/simulation/calculation-params.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/calculation-params.js +2 -0
- package/dist/sgerp/types/simulation/dataset.d.ts +16 -0
- package/dist/sgerp/types/simulation/dataset.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/dataset.js +2 -0
- package/dist/sgerp/types/simulation/driver.d.ts +19 -0
- package/dist/sgerp/types/simulation/driver.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/driver.js +2 -0
- package/dist/sgerp/types/simulation/geofence.d.ts +19 -0
- package/dist/sgerp/types/simulation/geofence.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/geofence.js +2 -0
- package/dist/sgerp/types/simulation/logistics-api-settings.d.ts +98 -0
- package/dist/sgerp/types/simulation/logistics-api-settings.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/logistics-api-settings.js +104 -0
- package/dist/sgerp/types/simulation/mapboxtoken.d.ts +13 -0
- package/dist/sgerp/types/simulation/mapboxtoken.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/mapboxtoken.js +2 -0
- package/dist/sgerp/types/simulation/node.js +5 -2
- package/dist/sgerp/types/simulation/operationslocation.d.ts +40 -0
- package/dist/sgerp/types/simulation/operationslocation.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/operationslocation.js +2 -0
- package/dist/sgerp/types/simulation/operationslocationgroup.d.ts +11 -0
- package/dist/sgerp/types/simulation/operationslocationgroup.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/operationslocationgroup.js +2 -0
- package/dist/sgerp/types/simulation/pricing.d.ts +171 -0
- package/dist/sgerp/types/simulation/pricing.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/pricing.js +2 -0
- package/dist/sgerp/types/simulation/route-cost-modification.d.ts +35 -0
- package/dist/sgerp/types/simulation/route-cost-modification.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/route-cost-modification.js +5 -0
- package/dist/sgerp/types/simulation/routing-engine-settings.d.ts +42 -0
- package/dist/sgerp/types/simulation/routing-engine-settings.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/routing-engine-settings.js +35 -0
- package/dist/sgerp/types/simulation/routingprofile.d.ts +32 -0
- package/dist/sgerp/types/simulation/routingprofile.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/routingprofile.js +37 -0
- package/dist/sgerp/types/simulation/simulation.d.ts +120 -0
- package/dist/sgerp/types/simulation/simulation.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/simulation.js +2 -0
- package/dist/sgerp/types/simulation/simulationprocessor.d.ts +31 -0
- package/dist/sgerp/types/simulation/simulationprocessor.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/simulationprocessor.js +2 -0
- package/dist/sgerp/types/simulation/vehicle.js +2 -1
- package/dist/sgerp/types/simulation/vehicletype.d.ts +33 -0
- package/dist/sgerp/types/simulation/vehicletype.d.ts.map +1 -0
- package/dist/sgerp/types/simulation/vehicletype.js +2 -0
- package/dist/sgerp/types/sms_notify/smsscheduled.d.ts +36 -0
- package/dist/sgerp/types/sms_notify/smsscheduled.d.ts.map +1 -0
- package/dist/sgerp/types/sms_notify/smsscheduled.js +6 -0
- package/dist/sgerp/types/transportation/passenger.d.ts +49 -0
- package/dist/sgerp/types/transportation/passenger.d.ts.map +1 -0
- package/dist/sgerp/types/transportation/passenger.js +13 -0
- package/dist/sgerp/types/transportation/ticket.d.ts +31 -0
- package/dist/sgerp/types/transportation/ticket.d.ts.map +1 -0
- package/dist/sgerp/types/transportation/ticket.js +2 -0
- package/dist/sgerp/types/transportation/transaction.d.ts +71 -0
- package/dist/sgerp/types/transportation/transaction.d.ts.map +1 -0
- package/dist/sgerp/types/transportation/transaction.js +54 -0
- package/dist/sgerp/utils/bookingPayload.d.ts +80 -0
- package/dist/sgerp/utils/bookingPayload.d.ts.map +1 -0
- package/dist/sgerp/utils/bookingPayload.js +44 -0
- package/dist/sgerp/utils/color.d.ts +30 -0
- package/dist/sgerp/utils/color.d.ts.map +1 -0
- package/dist/sgerp/utils/color.js +117 -0
- package/dist/sgerp/utils/enum-helpers.d.ts +41 -0
- package/dist/sgerp/utils/enum-helpers.d.ts.map +1 -0
- package/dist/sgerp/utils/enum-helpers.js +54 -0
- package/dist/sgerp/utils/routeUtils.d.ts +1 -1
- package/dist/sgerp/utils/routeUtils.d.ts.map +1 -1
- package/dist/sgerp/utils/routeUtils.js +171 -0
- package/package.json +1 -1
package/dist/locales.js
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.locales = void 0;
|
|
4
|
+
exports.locales = {
|
|
5
|
+
sgerp_login: {
|
|
6
|
+
en: {
|
|
7
|
+
username: "Username",
|
|
8
|
+
password: "Password",
|
|
9
|
+
backend: "Backend",
|
|
10
|
+
username_placeholder: "Enter username",
|
|
11
|
+
password_placeholder: "Enter password",
|
|
12
|
+
backend_placeholder: "Select backend",
|
|
13
|
+
connect_button: "Connect",
|
|
14
|
+
connecting_button: "Connecting...",
|
|
15
|
+
error_fill_fields: "Please fill in all fields",
|
|
16
|
+
error_auth_failed: "Authentication failed",
|
|
17
|
+
error_failed_connect: "Failed to connect",
|
|
18
|
+
success_connected: "Connected successfully!",
|
|
19
|
+
backend_localhost: "Localhost",
|
|
20
|
+
backend_staging: "Staging",
|
|
21
|
+
backend_production: "Production",
|
|
22
|
+
},
|
|
23
|
+
ja: {
|
|
24
|
+
username: "ユーザー名",
|
|
25
|
+
password: "パスワード",
|
|
26
|
+
backend: "バックエンド",
|
|
27
|
+
username_placeholder: "ユーザー名を入力",
|
|
28
|
+
password_placeholder: "パスワードを入力",
|
|
29
|
+
backend_placeholder: "バックエンドを選択",
|
|
30
|
+
connect_button: "接続",
|
|
31
|
+
connecting_button: "接続中...",
|
|
32
|
+
error_fill_fields: "すべてのフィールドを入力してください",
|
|
33
|
+
error_auth_failed: "認証に失敗しました",
|
|
34
|
+
error_failed_connect: "接続に失敗しました",
|
|
35
|
+
success_connected: "接続に成功しました!",
|
|
36
|
+
backend_localhost: "ローカルホスト",
|
|
37
|
+
backend_staging: "ステージング",
|
|
38
|
+
backend_production: "本番環境",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
sgerp_autocomplete: {
|
|
42
|
+
en: {
|
|
43
|
+
no_results: "No results found",
|
|
44
|
+
loading: "Loading...",
|
|
45
|
+
select_first: "Select a project first",
|
|
46
|
+
placeholder: "Search...",
|
|
47
|
+
placeholder_project: "Search projects...",
|
|
48
|
+
placeholder_user: "Search users...",
|
|
49
|
+
placeholder_simulation: "Search simulations...",
|
|
50
|
+
placeholder_vehicle: "Search vehicles...",
|
|
51
|
+
placeholder_vehicletype: "Search vehicle types...",
|
|
52
|
+
placeholder_booking: "Search bookings...",
|
|
53
|
+
placeholder_node: "Search nodes...",
|
|
54
|
+
placeholder_projectmember: "Search project members...",
|
|
55
|
+
},
|
|
56
|
+
ja: {
|
|
57
|
+
no_results: "結果が見つかりません",
|
|
58
|
+
loading: "読み込み中...",
|
|
59
|
+
select_first: "まずプロジェクトを選択してください",
|
|
60
|
+
placeholder: "検索...",
|
|
61
|
+
placeholder_project: "プロジェクトを検索...",
|
|
62
|
+
placeholder_user: "ユーザーを検索...",
|
|
63
|
+
placeholder_simulation: "シミュレーションを検索...",
|
|
64
|
+
placeholder_vehicle: "車両を検索...",
|
|
65
|
+
placeholder_vehicletype: "車両タイプを検索...",
|
|
66
|
+
placeholder_booking: "予約を検索...",
|
|
67
|
+
placeholder_node: "ノードを検索...",
|
|
68
|
+
placeholder_projectmember: "プロジェクトメンバーを検索...",
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
column: {
|
|
72
|
+
en: {
|
|
73
|
+
id: "ID",
|
|
74
|
+
name: "Name",
|
|
75
|
+
email: "Email",
|
|
76
|
+
phone: "Phone",
|
|
77
|
+
active: "Active",
|
|
78
|
+
organization: "Organization",
|
|
79
|
+
created: "Created",
|
|
80
|
+
created_at: "Created At",
|
|
81
|
+
modified_at: "Modified At",
|
|
82
|
+
external_id: "External ID",
|
|
83
|
+
code: "Code",
|
|
84
|
+
address: "Address",
|
|
85
|
+
postal_code: "Postal Code",
|
|
86
|
+
coordinates: "Coordinates",
|
|
87
|
+
project: "Project",
|
|
88
|
+
simulation: "Simulation",
|
|
89
|
+
vehicle: "Vehicle",
|
|
90
|
+
vehicle_type: "Vehicle Type",
|
|
91
|
+
registration_number: "Registration #",
|
|
92
|
+
color: "Color",
|
|
93
|
+
capacity: "Capacity",
|
|
94
|
+
start_time: "Start Time",
|
|
95
|
+
end_time: "End Time",
|
|
96
|
+
passenger: "Passenger",
|
|
97
|
+
driver: "Driver",
|
|
98
|
+
status: "Status",
|
|
99
|
+
state: "State",
|
|
100
|
+
pickup_time: "Pickup Time",
|
|
101
|
+
dropoff_time: "Dropoff Time",
|
|
102
|
+
type: "Type",
|
|
103
|
+
amount: "Amount",
|
|
104
|
+
template: "Template",
|
|
105
|
+
service: "Service",
|
|
106
|
+
description: "Description",
|
|
107
|
+
username: "Username",
|
|
108
|
+
first_name: "First Name",
|
|
109
|
+
last_name: "Last Name",
|
|
110
|
+
role: "Role",
|
|
111
|
+
message: "Message",
|
|
112
|
+
recipient: "Recipient",
|
|
113
|
+
sent_at: "Sent At",
|
|
114
|
+
delivery_status: "Delivery Status",
|
|
115
|
+
},
|
|
116
|
+
ja: {
|
|
117
|
+
id: "ID",
|
|
118
|
+
name: "名前",
|
|
119
|
+
email: "メールアドレス",
|
|
120
|
+
phone: "電話番号",
|
|
121
|
+
active: "有効",
|
|
122
|
+
organization: "組織",
|
|
123
|
+
created: "作成日",
|
|
124
|
+
created_at: "作成日時",
|
|
125
|
+
modified_at: "更新日時",
|
|
126
|
+
external_id: "外部ID",
|
|
127
|
+
code: "コード",
|
|
128
|
+
address: "住所",
|
|
129
|
+
postal_code: "郵便番号",
|
|
130
|
+
coordinates: "座標",
|
|
131
|
+
project: "プロジェクト",
|
|
132
|
+
simulation: "シミュレーション",
|
|
133
|
+
vehicle: "車両",
|
|
134
|
+
vehicle_type: "車両タイプ",
|
|
135
|
+
registration_number: "登録番号",
|
|
136
|
+
color: "色",
|
|
137
|
+
capacity: "容量",
|
|
138
|
+
start_time: "開始時刻",
|
|
139
|
+
end_time: "終了時刻",
|
|
140
|
+
passenger: "乗客",
|
|
141
|
+
driver: "ドライバー",
|
|
142
|
+
status: "ステータス",
|
|
143
|
+
state: "状態",
|
|
144
|
+
pickup_time: "ピックアップ時刻",
|
|
145
|
+
dropoff_time: "降車時刻",
|
|
146
|
+
type: "タイプ",
|
|
147
|
+
amount: "金額",
|
|
148
|
+
template: "テンプレート",
|
|
149
|
+
service: "サービス",
|
|
150
|
+
description: "説明",
|
|
151
|
+
username: "ユーザー名",
|
|
152
|
+
first_name: "名",
|
|
153
|
+
last_name: "姓",
|
|
154
|
+
role: "役割",
|
|
155
|
+
message: "メッセージ",
|
|
156
|
+
recipient: "受信者",
|
|
157
|
+
sent_at: "送信日時",
|
|
158
|
+
delivery_status: "配信ステータス",
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
filter: {
|
|
162
|
+
en: {
|
|
163
|
+
project: "Project",
|
|
164
|
+
simulation: "Simulation",
|
|
165
|
+
vehicle_type: "Vehicle Type",
|
|
166
|
+
passenger: "Passenger",
|
|
167
|
+
driver: "Driver",
|
|
168
|
+
organization: "Organization",
|
|
169
|
+
template: "Template",
|
|
170
|
+
status: "Status",
|
|
171
|
+
state: "State",
|
|
172
|
+
placeholder_project: "Filter by project...",
|
|
173
|
+
placeholder_simulation: "Filter by simulation...",
|
|
174
|
+
placeholder_vehicle_type: "Filter by vehicle type...",
|
|
175
|
+
placeholder_passenger: "Filter by passenger...",
|
|
176
|
+
placeholder_driver: "Filter by driver...",
|
|
177
|
+
placeholder_organization: "Filter by organization...",
|
|
178
|
+
placeholder_template: "Filter by template...",
|
|
179
|
+
},
|
|
180
|
+
ja: {
|
|
181
|
+
project: "プロジェクト",
|
|
182
|
+
simulation: "シミュレーション",
|
|
183
|
+
vehicle_type: "車両タイプ",
|
|
184
|
+
passenger: "乗客",
|
|
185
|
+
driver: "ドライバー",
|
|
186
|
+
organization: "組織",
|
|
187
|
+
template: "テンプレート",
|
|
188
|
+
status: "ステータス",
|
|
189
|
+
state: "状態",
|
|
190
|
+
placeholder_project: "プロジェクトでフィルタ...",
|
|
191
|
+
placeholder_simulation: "シミュレーションでフィルタ...",
|
|
192
|
+
placeholder_vehicle_type: "車両タイプでフィルタ...",
|
|
193
|
+
placeholder_passenger: "乗客でフィルタ...",
|
|
194
|
+
placeholder_driver: "ドライバーでフィルタ...",
|
|
195
|
+
placeholder_organization: "組織でフィルタ...",
|
|
196
|
+
placeholder_template: "テンプレートでフィルタ...",
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
sgerp_map: {
|
|
200
|
+
en: {
|
|
201
|
+
map_style: "Map Style",
|
|
202
|
+
style_light: "Light",
|
|
203
|
+
style_dark: "Dark",
|
|
204
|
+
style_satellite: "Satellite",
|
|
205
|
+
style_street: "Street",
|
|
206
|
+
style_outdoors: "Outdoors",
|
|
207
|
+
},
|
|
208
|
+
ja: {
|
|
209
|
+
map_style: "地図スタイル",
|
|
210
|
+
style_light: "ライト",
|
|
211
|
+
style_dark: "ダーク",
|
|
212
|
+
style_satellite: "衛星写真",
|
|
213
|
+
style_street: "道路地図",
|
|
214
|
+
style_outdoors: "アウトドア",
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
table: {
|
|
218
|
+
en: {
|
|
219
|
+
map_hide: "Hide map",
|
|
220
|
+
map_split: "Split view (50/50)",
|
|
221
|
+
map_full: "Full map",
|
|
222
|
+
},
|
|
223
|
+
ja: {
|
|
224
|
+
map_hide: "地図を非表示",
|
|
225
|
+
map_split: "分割表示 (50/50)",
|
|
226
|
+
map_full: "全画面地図",
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { RequestConfig, Connection } from '../types/config';
|
|
2
|
+
export declare class APIError extends Error {
|
|
3
|
+
status?: number | undefined;
|
|
4
|
+
response?: unknown | undefined;
|
|
5
|
+
constructor(message: string, status?: number | undefined, response?: unknown | undefined);
|
|
6
|
+
}
|
|
7
|
+
export interface APIResponse<T> {
|
|
8
|
+
data: T;
|
|
9
|
+
status: number;
|
|
10
|
+
headers: Headers;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Base API client for making HTTP requests
|
|
14
|
+
*/
|
|
15
|
+
export declare class APIClient {
|
|
16
|
+
static _getActiveConnection: (() => Connection) | null;
|
|
17
|
+
static _getTimeout: (() => number) | null;
|
|
18
|
+
private static getActiveConnection;
|
|
19
|
+
private static getTimeout;
|
|
20
|
+
/**
|
|
21
|
+
* Make a GET request
|
|
22
|
+
*/
|
|
23
|
+
static get<T>(path: string, config?: RequestConfig): Promise<APIResponse<T>>;
|
|
24
|
+
/**
|
|
25
|
+
* Make a POST request
|
|
26
|
+
*/
|
|
27
|
+
static post<T>(path: string, body?: unknown, config?: RequestConfig): Promise<APIResponse<T>>;
|
|
28
|
+
/**
|
|
29
|
+
* Make a PUT request
|
|
30
|
+
*/
|
|
31
|
+
static put<T>(path: string, body?: unknown, config?: RequestConfig): Promise<APIResponse<T>>;
|
|
32
|
+
/**
|
|
33
|
+
* Make a PATCH request
|
|
34
|
+
*/
|
|
35
|
+
static patch<T>(path: string, body?: unknown, config?: RequestConfig): Promise<APIResponse<T>>;
|
|
36
|
+
/**
|
|
37
|
+
* Make a DELETE request
|
|
38
|
+
*/
|
|
39
|
+
static delete<T>(path: string, config?: RequestConfig): Promise<APIResponse<T>>;
|
|
40
|
+
/**
|
|
41
|
+
* Core request method
|
|
42
|
+
*/
|
|
43
|
+
private static request;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../sgerplib/sgerp/api/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAWjE,qBAAa,QAAS,SAAQ,KAAK;IAGxB,MAAM,CAAC,EAAE,MAAM;IACf,QAAQ,CAAC,EAAE,OAAO;gBAFzB,OAAO,EAAE,MAAM,EACR,MAAM,CAAC,EAAE,MAAM,YAAA,EACf,QAAQ,CAAC,EAAE,OAAO,YAAA;CAK5B;AAED,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,IAAI,EAAE,CAAC,CAAC;IACR,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,qBAAa,SAAS;IAEpB,MAAM,CAAC,oBAAoB,EAAE,CAAC,MAAM,UAAU,CAAC,GAAG,IAAI,CAAQ;IAC9D,MAAM,CAAC,WAAW,EAAE,CAAC,MAAM,MAAM,CAAC,GAAG,IAAI,CAAQ;IAEjD,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAOlC,OAAO,CAAC,MAAM,CAAC,UAAU;IAMzB;;OAEG;WACU,GAAG,CAAC,CAAC,EAChB,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,aAAa,GACrB,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAI1B;;OAEG;WACU,IAAI,CAAC,CAAC,EACjB,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,OAAO,EACd,MAAM,CAAC,EAAE,aAAa,GACrB,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAI1B;;OAEG;WACU,GAAG,CAAC,CAAC,EAChB,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,OAAO,EACd,MAAM,CAAC,EAAE,aAAa,GACrB,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAI1B;;OAEG;WACU,KAAK,CAAC,CAAC,EAClB,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,OAAO,EACd,MAAM,CAAC,EAAE,aAAa,GACrB,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAI1B;;OAEG;WACU,MAAM,CAAC,CAAC,EACnB,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,aAAa,GACrB,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAI1B;;OAEG;mBACkB,OAAO;CA4F7B"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.APIClient = exports.APIError = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Generate Basic Auth header value
|
|
6
|
+
*/
|
|
7
|
+
function generateBasicAuthHeader(username, password) {
|
|
8
|
+
const credentials = `${username}:${password}`;
|
|
9
|
+
const encoded = Buffer.from(credentials).toString('base64');
|
|
10
|
+
return `Basic ${encoded}`;
|
|
11
|
+
}
|
|
12
|
+
class APIError extends Error {
|
|
13
|
+
constructor(message, status, response) {
|
|
14
|
+
super(message);
|
|
15
|
+
this.status = status;
|
|
16
|
+
this.response = response;
|
|
17
|
+
this.name = 'APIError';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.APIError = APIError;
|
|
21
|
+
/**
|
|
22
|
+
* Base API client for making HTTP requests
|
|
23
|
+
*/
|
|
24
|
+
class APIClient {
|
|
25
|
+
static getActiveConnection() {
|
|
26
|
+
if (!this._getActiveConnection) {
|
|
27
|
+
throw new Error('SGERP library not initialized. Call initializeSGERP() first.');
|
|
28
|
+
}
|
|
29
|
+
return this._getActiveConnection();
|
|
30
|
+
}
|
|
31
|
+
static getTimeout() {
|
|
32
|
+
if (!this._getTimeout) {
|
|
33
|
+
return 30000; // Default timeout
|
|
34
|
+
}
|
|
35
|
+
return this._getTimeout();
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Make a GET request
|
|
39
|
+
*/
|
|
40
|
+
static async get(path, config) {
|
|
41
|
+
return this.request('GET', path, undefined, config);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Make a POST request
|
|
45
|
+
*/
|
|
46
|
+
static async post(path, body, config) {
|
|
47
|
+
return this.request('POST', path, body, config);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Make a PUT request
|
|
51
|
+
*/
|
|
52
|
+
static async put(path, body, config) {
|
|
53
|
+
return this.request('PUT', path, body, config);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Make a PATCH request
|
|
57
|
+
*/
|
|
58
|
+
static async patch(path, body, config) {
|
|
59
|
+
return this.request('PATCH', path, body, config);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Make a DELETE request
|
|
63
|
+
*/
|
|
64
|
+
static async delete(path, config) {
|
|
65
|
+
return this.request('DELETE', path, undefined, config);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Core request method
|
|
69
|
+
*/
|
|
70
|
+
static async request(method, path, body, config) {
|
|
71
|
+
var _a;
|
|
72
|
+
const connection = this.getActiveConnection();
|
|
73
|
+
const baseUrl = connection.baseUrl;
|
|
74
|
+
const globalTimeout = this.getTimeout();
|
|
75
|
+
// Construct full URL with query parameters
|
|
76
|
+
let url = `${baseUrl}${path.startsWith('/') ? path : `/${path}`}`;
|
|
77
|
+
// Add query parameters if provided
|
|
78
|
+
if (config === null || config === void 0 ? void 0 : config.params) {
|
|
79
|
+
const searchParams = new URLSearchParams();
|
|
80
|
+
Object.entries(config.params).forEach(([key, value]) => {
|
|
81
|
+
if (value !== null && value !== undefined) {
|
|
82
|
+
searchParams.append(key, String(value));
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
const queryString = searchParams.toString();
|
|
86
|
+
if (queryString) {
|
|
87
|
+
url += `?${queryString}`;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// Merge headers and add Basic Auth
|
|
91
|
+
const headers = Object.assign(Object.assign({ 'Content-Type': 'application/json', 'Authorization': generateBasicAuthHeader(connection.user, connection.password) }, connection.headers), config === null || config === void 0 ? void 0 : config.headers);
|
|
92
|
+
// Setup abort controller for timeout
|
|
93
|
+
const controller = new AbortController();
|
|
94
|
+
const timeout = (_a = config === null || config === void 0 ? void 0 : config.timeout) !== null && _a !== void 0 ? _a : globalTimeout;
|
|
95
|
+
const timeoutId = setTimeout(() => controller.abort(), timeout);
|
|
96
|
+
try {
|
|
97
|
+
const response = await fetch(url, {
|
|
98
|
+
method,
|
|
99
|
+
headers,
|
|
100
|
+
body: body ? JSON.stringify(body) : undefined,
|
|
101
|
+
signal: (config === null || config === void 0 ? void 0 : config.signal) || controller.signal,
|
|
102
|
+
});
|
|
103
|
+
clearTimeout(timeoutId);
|
|
104
|
+
// Parse response
|
|
105
|
+
let data;
|
|
106
|
+
const contentType = response.headers.get('content-type');
|
|
107
|
+
if (contentType === null || contentType === void 0 ? void 0 : contentType.includes('application/json')) {
|
|
108
|
+
data = await response.json();
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
data = (await response.text());
|
|
112
|
+
}
|
|
113
|
+
// Handle error responses
|
|
114
|
+
if (!response.ok) {
|
|
115
|
+
throw new APIError(`Request failed: ${response.statusText}`, response.status, data);
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
data,
|
|
119
|
+
status: response.status,
|
|
120
|
+
headers: response.headers,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
clearTimeout(timeoutId);
|
|
125
|
+
if (error instanceof APIError) {
|
|
126
|
+
throw error;
|
|
127
|
+
}
|
|
128
|
+
if (error instanceof Error) {
|
|
129
|
+
if (error.name === 'AbortError') {
|
|
130
|
+
throw new APIError('Request timeout');
|
|
131
|
+
}
|
|
132
|
+
throw new APIError(error.message);
|
|
133
|
+
}
|
|
134
|
+
throw new APIError('Unknown error occurred');
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
exports.APIClient = APIClient;
|
|
139
|
+
// These are set by SGERPClient
|
|
140
|
+
APIClient._getActiveConnection = null;
|
|
141
|
+
APIClient._getTimeout = null;
|