sgerp-frontend-lib 0.1.1 → 0.1.2
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.js +226 -0
- package/dist/sgerp/simulation-logic/index.js +27 -7
- 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.js +110 -0
- package/dist/sgerp/simulation-logic/routeCalculationUtils.js +43 -0
- 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.js +171 -0
- package/package.json +1 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FIRST_SOLUTION_STRATEGIES = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* First Solution Strategies for OR-Tools solver
|
|
6
|
+
* Used in both JIT mode and Logistics API settings
|
|
7
|
+
*/
|
|
8
|
+
exports.FIRST_SOLUTION_STRATEGIES = [
|
|
9
|
+
{ value: 0, key: "automatic", label: "Automatic" },
|
|
10
|
+
{ value: 1, key: "global_cheapest_arc", label: "Global Cheapest Arc" },
|
|
11
|
+
{ value: 2, key: "local_cheapest_arc", label: "Local Cheapest Arc" },
|
|
12
|
+
{ value: 3, key: "path_cheapest_arc", label: "Path Cheapest Arc" },
|
|
13
|
+
{ value: 4, key: "path_most_constrained_arc", label: "Path Most Constrained Arc" },
|
|
14
|
+
{ value: 5, key: "evaluator_strategy", label: "Evaluator Strategy" },
|
|
15
|
+
{ value: 6, key: "all_unperformed", label: "All Unperformed" },
|
|
16
|
+
{ value: 7, key: "best_insertion", label: "Best Insertion" },
|
|
17
|
+
{ value: 8, key: "parallel_cheapest_insertion", label: "Parallel Cheapest Insertion" },
|
|
18
|
+
{ value: 9, key: "local_cheapest_insertion", label: "Local Cheapest Insertion" },
|
|
19
|
+
{ value: 10, key: "savings", label: "Savings" },
|
|
20
|
+
{ value: 11, key: "sweep", label: "Sweep" },
|
|
21
|
+
{ value: 12, key: "first_unbound_min_value", label: "First Unbound Min Value" },
|
|
22
|
+
{ value: 13, key: "christofides", label: "Christofides" },
|
|
23
|
+
{ value: 14, key: "sequential_cheapest_insertion", label: "Sequential Cheapest Insertion" },
|
|
24
|
+
{ value: 16, key: "adjustable_parallel_cheapest_insertion", label: "Adjustable Parallel Cheapest Insertion" },
|
|
25
|
+
{ value: 17, key: "logistics_parallel_cheapest_insertion", label: "Logistics Parallel Cheapest Insertion" },
|
|
26
|
+
];
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.SGERPProvider = SGERPProvider;
|
|
38
|
+
exports.useSGERPContext = useSGERPContext;
|
|
39
|
+
const react_1 = __importStar(require("react"));
|
|
40
|
+
const client_1 = require("../client");
|
|
41
|
+
const connection_manager_1 = require("@/sgerplib/connection-manager");
|
|
42
|
+
/**
|
|
43
|
+
* Context to share SGERP API client across all pages and components
|
|
44
|
+
* This prevents collections from being refetched when navigating between pages
|
|
45
|
+
*/
|
|
46
|
+
const SGERPContext = (0, react_1.createContext)(null);
|
|
47
|
+
/**
|
|
48
|
+
* Provider component that creates a single SGERP API instance
|
|
49
|
+
* and shares it with all child components via React Context.
|
|
50
|
+
*
|
|
51
|
+
* This should wrap your entire application (e.g., in app/layout.tsx)
|
|
52
|
+
* to ensure the same API instance and collections persist across page navigations.
|
|
53
|
+
*
|
|
54
|
+
* The provider automatically re-initializes when the active connection changes
|
|
55
|
+
* (e.g., when user logs out and logs in with different credentials).
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```tsx
|
|
59
|
+
* // app/layout.tsx
|
|
60
|
+
* import { SGERPProvider } from '@/sgerplib/sgerp/context/sgerp-context';
|
|
61
|
+
*
|
|
62
|
+
* export default function RootLayout({ children }) {
|
|
63
|
+
* return (
|
|
64
|
+
* <html>
|
|
65
|
+
* <body>
|
|
66
|
+
* <SGERPProvider>
|
|
67
|
+
* {children}
|
|
68
|
+
* </SGERPProvider>
|
|
69
|
+
* </body>
|
|
70
|
+
* </html>
|
|
71
|
+
* );
|
|
72
|
+
* }
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
function SGERPProvider({ children }) {
|
|
76
|
+
const [api, setApi] = (0, react_1.useState)(() => {
|
|
77
|
+
const activeConnection = connection_manager_1.ConnectionManager.getActiveConnection();
|
|
78
|
+
if (!activeConnection) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
return (0, client_1.initializeSGERP)({
|
|
82
|
+
activeConnection: activeConnection.id,
|
|
83
|
+
timeout: 30000,
|
|
84
|
+
connections: {
|
|
85
|
+
[activeConnection.id]: activeConnection,
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
// Listen to connection changes and re-initialize API
|
|
90
|
+
(0, react_1.useEffect)(() => {
|
|
91
|
+
const unsubscribe = connection_manager_1.ConnectionManager.onChange(() => {
|
|
92
|
+
const activeConnection = connection_manager_1.ConnectionManager.getActiveConnection();
|
|
93
|
+
if (!activeConnection) {
|
|
94
|
+
setApi(null);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
// Re-initialize with new connection
|
|
98
|
+
const newApi = (0, client_1.initializeSGERP)({
|
|
99
|
+
activeConnection: activeConnection.id,
|
|
100
|
+
timeout: 30000,
|
|
101
|
+
connections: {
|
|
102
|
+
[activeConnection.id]: activeConnection,
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
setApi(newApi);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
return unsubscribe;
|
|
109
|
+
}, []);
|
|
110
|
+
// Memoize the context value to prevent unnecessary re-renders
|
|
111
|
+
const contextValue = (0, react_1.useMemo)(() => api, [api]);
|
|
112
|
+
return (react_1.default.createElement(SGERPContext.Provider, { value: contextValue }, children));
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Hook to access the shared SGERP API instance from context.
|
|
116
|
+
*
|
|
117
|
+
* Must be used within a SGERPProvider.
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```tsx
|
|
121
|
+
* function MyComponent() {
|
|
122
|
+
* const api = useSGERPContext();
|
|
123
|
+
*
|
|
124
|
+
* if (!api) {
|
|
125
|
+
* return <div>Not connected</div>;
|
|
126
|
+
* }
|
|
127
|
+
*
|
|
128
|
+
* return <ProjectTable collection={api.collections.project} api={api} />;
|
|
129
|
+
* }
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
function useSGERPContext() {
|
|
133
|
+
return (0, react_1.useContext)(SGERPContext);
|
|
134
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized domain registry for SGERP environments
|
|
3
|
+
*
|
|
4
|
+
* This file contains all domain URLs used across the application.
|
|
5
|
+
* Domains are loaded from environment variables with fallback defaults.
|
|
6
|
+
* To customize domains, set the following environment variables in .env.local:
|
|
7
|
+
* - NEXT_PUBLIC_SGERP_DOMAIN_STAGING
|
|
8
|
+
* - NEXT_PUBLIC_SGERP_DOMAIN_PRODUCTION
|
|
9
|
+
* - NEXT_PUBLIC_SGERP_DOMAIN_TCP
|
|
10
|
+
* - NEXT_PUBLIC_SGERP_DOMAIN_PPE
|
|
11
|
+
* - NEXT_PUBLIC_OSRM_DOMAIN_DEVELOPMENT
|
|
12
|
+
* - NEXT_PUBLIC_OSRM_DOMAIN_PRODUCTION
|
|
13
|
+
* - NEXT_PUBLIC_OSRM_DOMAIN_TC
|
|
14
|
+
* - NEXT_PUBLIC_OSRM_DOMAIN_TCP
|
|
15
|
+
* - NEXT_PUBLIC_OSRM_DOMAIN_PPE
|
|
16
|
+
*/
|
|
17
|
+
export declare const SGERP_DOMAINS: {
|
|
18
|
+
readonly staging: string;
|
|
19
|
+
readonly production: string;
|
|
20
|
+
readonly tcp: string;
|
|
21
|
+
readonly ppe: string;
|
|
22
|
+
readonly osrm: {
|
|
23
|
+
readonly development: string;
|
|
24
|
+
readonly production: string;
|
|
25
|
+
readonly tc: string;
|
|
26
|
+
readonly tcp: string;
|
|
27
|
+
readonly ppe: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Default server presets for login/connection UI
|
|
32
|
+
* labelKey is an i18n token - use getText(labelKey) to get translated label
|
|
33
|
+
* Only includes servers with non-empty URLs
|
|
34
|
+
*/
|
|
35
|
+
export declare const DEFAULT_SERVERS: {
|
|
36
|
+
labelKey: string;
|
|
37
|
+
url: string;
|
|
38
|
+
}[];
|
|
39
|
+
/**
|
|
40
|
+
* Environment type
|
|
41
|
+
*/
|
|
42
|
+
export type Environment = 'staging' | 'production' | 'tcp' | 'ppe';
|
|
43
|
+
/**
|
|
44
|
+
* OSRM backend type
|
|
45
|
+
*/
|
|
46
|
+
export type OSRMBackend = keyof typeof SGERP_DOMAINS.osrm;
|
|
47
|
+
//# sourceMappingURL=domains.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domains.d.ts","sourceRoot":"","sources":["../../sgerplib/sgerp/domains.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;CAehB,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,eAAe;;;GAK8B,CAAC;AAE3D;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,YAAY,GAAG,KAAK,GAAG,KAAK,CAAC;AAEnE;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,aAAa,CAAC,IAAI,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Centralized domain registry for SGERP environments
|
|
4
|
+
*
|
|
5
|
+
* This file contains all domain URLs used across the application.
|
|
6
|
+
* Domains are loaded from environment variables with fallback defaults.
|
|
7
|
+
* To customize domains, set the following environment variables in .env.local:
|
|
8
|
+
* - NEXT_PUBLIC_SGERP_DOMAIN_STAGING
|
|
9
|
+
* - NEXT_PUBLIC_SGERP_DOMAIN_PRODUCTION
|
|
10
|
+
* - NEXT_PUBLIC_SGERP_DOMAIN_TCP
|
|
11
|
+
* - NEXT_PUBLIC_SGERP_DOMAIN_PPE
|
|
12
|
+
* - NEXT_PUBLIC_OSRM_DOMAIN_DEVELOPMENT
|
|
13
|
+
* - NEXT_PUBLIC_OSRM_DOMAIN_PRODUCTION
|
|
14
|
+
* - NEXT_PUBLIC_OSRM_DOMAIN_TC
|
|
15
|
+
* - NEXT_PUBLIC_OSRM_DOMAIN_TCP
|
|
16
|
+
* - NEXT_PUBLIC_OSRM_DOMAIN_PPE
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.DEFAULT_SERVERS = exports.SGERP_DOMAINS = void 0;
|
|
20
|
+
exports.SGERP_DOMAINS = {
|
|
21
|
+
// SGERP API Domains
|
|
22
|
+
staging: process.env.NEXT_PUBLIC_SGERP_DOMAIN_STAGING || '',
|
|
23
|
+
production: process.env.NEXT_PUBLIC_SGERP_DOMAIN_PRODUCTION || '',
|
|
24
|
+
tcp: process.env.NEXT_PUBLIC_SGERP_DOMAIN_TCP || '',
|
|
25
|
+
ppe: process.env.NEXT_PUBLIC_SGERP_DOMAIN_PPE || '',
|
|
26
|
+
// OSRM Routing Proxy Domains
|
|
27
|
+
osrm: {
|
|
28
|
+
development: process.env.NEXT_PUBLIC_OSRM_DOMAIN_DEVELOPMENT || '',
|
|
29
|
+
production: process.env.NEXT_PUBLIC_OSRM_DOMAIN_PRODUCTION || '',
|
|
30
|
+
tc: process.env.NEXT_PUBLIC_OSRM_DOMAIN_TC || '',
|
|
31
|
+
tcp: process.env.NEXT_PUBLIC_OSRM_DOMAIN_TCP || '',
|
|
32
|
+
ppe: process.env.NEXT_PUBLIC_OSRM_DOMAIN_PPE || '',
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Default server presets for login/connection UI
|
|
37
|
+
* labelKey is an i18n token - use getText(labelKey) to get translated label
|
|
38
|
+
* Only includes servers with non-empty URLs
|
|
39
|
+
*/
|
|
40
|
+
exports.DEFAULT_SERVERS = [
|
|
41
|
+
{ labelKey: "env.staging", url: exports.SGERP_DOMAINS.staging },
|
|
42
|
+
{ labelKey: "env.production", url: exports.SGERP_DOMAINS.production },
|
|
43
|
+
{ labelKey: "env.tcp", url: exports.SGERP_DOMAINS.tcp },
|
|
44
|
+
{ labelKey: "env.ppe", url: exports.SGERP_DOMAINS.ppe },
|
|
45
|
+
].filter(server => server.url && server.url.trim() !== '');
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useCollection = useCollection;
|
|
5
|
+
exports.useSGERP = useSGERP;
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const client_1 = require("../client");
|
|
8
|
+
const connection_manager_1 = require("@/sgerplib/connection-manager");
|
|
9
|
+
const sgerp_context_1 = require("../context/sgerp-context");
|
|
10
|
+
// Cached empty array to avoid creating new instances
|
|
11
|
+
const EMPTY_ARRAY = [];
|
|
12
|
+
/**
|
|
13
|
+
* React hook to subscribe to collection changes
|
|
14
|
+
*/
|
|
15
|
+
function useCollection(collection) {
|
|
16
|
+
const getSnapshot = () => { var _a; return (_a = collection === null || collection === void 0 ? void 0 : collection.models) !== null && _a !== void 0 ? _a : EMPTY_ARRAY; };
|
|
17
|
+
(0, react_1.useSyncExternalStore)((callback) => {
|
|
18
|
+
if (!collection)
|
|
19
|
+
return () => { };
|
|
20
|
+
return collection.onChange(callback);
|
|
21
|
+
}, getSnapshot, getSnapshot);
|
|
22
|
+
return collection;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* React hook to initialize SGERP API with active connection
|
|
26
|
+
* Returns an API with reactive collections that automatically re-render
|
|
27
|
+
*
|
|
28
|
+
* IMPORTANT: This hook will prefer to use the API instance from SGERPContext
|
|
29
|
+
* if available (when wrapped in SGERPProvider). This ensures the same API
|
|
30
|
+
* instance and collections persist across page navigations, preventing
|
|
31
|
+
* unnecessary data refetching.
|
|
32
|
+
*
|
|
33
|
+
* If no context is available, falls back to creating a local instance
|
|
34
|
+
* (backward compatible behavior).
|
|
35
|
+
*/
|
|
36
|
+
function useSGERP() {
|
|
37
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
|
|
38
|
+
// Try to get API from context first (preferred for page navigation persistence)
|
|
39
|
+
const contextApi = (0, sgerp_context_1.useSGERPContext)();
|
|
40
|
+
// Fallback: create local instance if no context available (backward compatible)
|
|
41
|
+
const apiRef = (0, react_1.useRef)(undefined);
|
|
42
|
+
if (apiRef.current === undefined && !contextApi) {
|
|
43
|
+
const activeConnection = connection_manager_1.ConnectionManager.getActiveConnection();
|
|
44
|
+
if (!activeConnection) {
|
|
45
|
+
apiRef.current = null;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
apiRef.current = (0, client_1.initializeSGERP)({
|
|
49
|
+
activeConnection: activeConnection.id,
|
|
50
|
+
timeout: 30000,
|
|
51
|
+
connections: {
|
|
52
|
+
[activeConnection.id]: activeConnection,
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// Use context API if available, otherwise use local ref
|
|
58
|
+
const api = contextApi || apiRef.current;
|
|
59
|
+
// Make collections reactive - these calls subscribe to changes but we don't use the return values
|
|
60
|
+
useCollection((_a = api === null || api === void 0 ? void 0 : api.collections.project) !== null && _a !== void 0 ? _a : null);
|
|
61
|
+
useCollection((_b = api === null || api === void 0 ? void 0 : api.collections.simulation) !== null && _b !== void 0 ? _b : null);
|
|
62
|
+
useCollection((_c = api === null || api === void 0 ? void 0 : api.collections.user) !== null && _c !== void 0 ? _c : null);
|
|
63
|
+
useCollection((_d = api === null || api === void 0 ? void 0 : api.collections.projectmember) !== null && _d !== void 0 ? _d : null);
|
|
64
|
+
useCollection((_e = api === null || api === void 0 ? void 0 : api.collections.organization) !== null && _e !== void 0 ? _e : null);
|
|
65
|
+
useCollection((_f = api === null || api === void 0 ? void 0 : api.collections.organizationproject) !== null && _f !== void 0 ? _f : null);
|
|
66
|
+
useCollection((_g = api === null || api === void 0 ? void 0 : api.collections.pricing) !== null && _g !== void 0 ? _g : null);
|
|
67
|
+
useCollection((_h = api === null || api === void 0 ? void 0 : api.collections.passenger) !== null && _h !== void 0 ? _h : null);
|
|
68
|
+
useCollection((_j = api === null || api === void 0 ? void 0 : api.collections.ticket) !== null && _j !== void 0 ? _j : null);
|
|
69
|
+
useCollection((_k = api === null || api === void 0 ? void 0 : api.collections.transaction) !== null && _k !== void 0 ? _k : null);
|
|
70
|
+
useCollection((_l = api === null || api === void 0 ? void 0 : api.collections.driver) !== null && _l !== void 0 ? _l : null);
|
|
71
|
+
useCollection((_m = api === null || api === void 0 ? void 0 : api.collections.vehicle) !== null && _m !== void 0 ? _m : null);
|
|
72
|
+
useCollection((_o = api === null || api === void 0 ? void 0 : api.collections.vehicletype) !== null && _o !== void 0 ? _o : null);
|
|
73
|
+
useCollection((_p = api === null || api === void 0 ? void 0 : api.collections.booking) !== null && _p !== void 0 ? _p : null);
|
|
74
|
+
useCollection((_q = api === null || api === void 0 ? void 0 : api.collections.node) !== null && _q !== void 0 ? _q : null);
|
|
75
|
+
useCollection((_r = api === null || api === void 0 ? void 0 : api.collections.dataset) !== null && _r !== void 0 ? _r : null);
|
|
76
|
+
useCollection((_s = api === null || api === void 0 ? void 0 : api.collections.simulationprocessor) !== null && _s !== void 0 ? _s : null);
|
|
77
|
+
useCollection((_t = api === null || api === void 0 ? void 0 : api.collections.operationslocation) !== null && _t !== void 0 ? _t : null);
|
|
78
|
+
useCollection((_u = api === null || api === void 0 ? void 0 : api.collections.operationslocationgroup) !== null && _u !== void 0 ? _u : null);
|
|
79
|
+
useCollection((_v = api === null || api === void 0 ? void 0 : api.collections.transitstop) !== null && _v !== void 0 ? _v : null);
|
|
80
|
+
useCollection((_w = api === null || api === void 0 ? void 0 : api.collections.routingprofile) !== null && _w !== void 0 ? _w : null);
|
|
81
|
+
useCollection((_x = api === null || api === void 0 ? void 0 : api.collections.geofence) !== null && _x !== void 0 ? _x : null);
|
|
82
|
+
useCollection((_y = api === null || api === void 0 ? void 0 : api.collections.mapboxtoken) !== null && _y !== void 0 ? _y : null);
|
|
83
|
+
useCollection((_z = api === null || api === void 0 ? void 0 : api.collections.smsscheduled) !== null && _z !== void 0 ? _z : null);
|
|
84
|
+
useCollection((_0 = api === null || api === void 0 ? void 0 : api.collections.building) !== null && _0 !== void 0 ? _0 : null);
|
|
85
|
+
useCollection((_1 = api === null || api === void 0 ? void 0 : api.collections.transitstopset) !== null && _1 !== void 0 ? _1 : null);
|
|
86
|
+
const reactiveApi = (0, react_1.useMemo)(() => {
|
|
87
|
+
if (!api)
|
|
88
|
+
return null;
|
|
89
|
+
return {
|
|
90
|
+
collections: {
|
|
91
|
+
project: api.collections.project,
|
|
92
|
+
simulation: api.collections.simulation,
|
|
93
|
+
user: api.collections.user,
|
|
94
|
+
projectmember: api.collections.projectmember,
|
|
95
|
+
organization: api.collections.organization,
|
|
96
|
+
organizationproject: api.collections.organizationproject,
|
|
97
|
+
pricing: api.collections.pricing,
|
|
98
|
+
passenger: api.collections.passenger,
|
|
99
|
+
ticket: api.collections.ticket,
|
|
100
|
+
transaction: api.collections.transaction,
|
|
101
|
+
driver: api.collections.driver,
|
|
102
|
+
vehicle: api.collections.vehicle,
|
|
103
|
+
vehicletype: api.collections.vehicletype,
|
|
104
|
+
booking: api.collections.booking,
|
|
105
|
+
node: api.collections.node,
|
|
106
|
+
dataset: api.collections.dataset,
|
|
107
|
+
simulationprocessor: api.collections.simulationprocessor,
|
|
108
|
+
operationslocation: api.collections.operationslocation,
|
|
109
|
+
operationslocationgroup: api.collections.operationslocationgroup,
|
|
110
|
+
transitstop: api.collections.transitstop,
|
|
111
|
+
routingprofile: api.collections.routingprofile,
|
|
112
|
+
geofence: api.collections.geofence,
|
|
113
|
+
mapboxtoken: api.collections.mapboxtoken,
|
|
114
|
+
smsscheduled: api.collections.smsscheduled,
|
|
115
|
+
building: api.collections.building,
|
|
116
|
+
transitstopset: api.collections.transitstopset,
|
|
117
|
+
},
|
|
118
|
+
getCollection: api.getCollection.bind(api),
|
|
119
|
+
};
|
|
120
|
+
}, [api, api === null || api === void 0 ? void 0 : api.collections.mapboxtoken]);
|
|
121
|
+
return reactiveApi;
|
|
122
|
+
}
|
|
@@ -1,32 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useLiveUpdates = useLiveUpdates;
|
|
4
|
+
const react_1 = require("react");
|
|
2
5
|
/**
|
|
3
6
|
* Hook to enable periodic live updates for a collection
|
|
4
7
|
* Fetches incremental updates based on modified_at timestamp
|
|
5
8
|
*
|
|
6
9
|
* @returns trigger function to manually trigger an immediate update
|
|
7
10
|
*/
|
|
8
|
-
|
|
11
|
+
function useLiveUpdates(collection, options = {}) {
|
|
9
12
|
const { interval = 5000, enabled = true, params = {}, useGte = false, onUpdate, } = options;
|
|
10
|
-
const intervalRef = useRef(null);
|
|
11
|
-
const paramsRef = useRef(params);
|
|
12
|
-
const useGteRef = useRef(useGte);
|
|
13
|
-
const collectionRef = useRef(collection);
|
|
14
|
-
const onUpdateRef = useRef(onUpdate);
|
|
13
|
+
const intervalRef = (0, react_1.useRef)(null);
|
|
14
|
+
const paramsRef = (0, react_1.useRef)(params);
|
|
15
|
+
const useGteRef = (0, react_1.useRef)(useGte);
|
|
16
|
+
const collectionRef = (0, react_1.useRef)(collection);
|
|
17
|
+
const onUpdateRef = (0, react_1.useRef)(onUpdate);
|
|
15
18
|
// Update refs when they change
|
|
16
|
-
useEffect(() => {
|
|
19
|
+
(0, react_1.useEffect)(() => {
|
|
17
20
|
paramsRef.current = params;
|
|
18
21
|
}, [params]);
|
|
19
|
-
useEffect(() => {
|
|
22
|
+
(0, react_1.useEffect)(() => {
|
|
20
23
|
useGteRef.current = useGte;
|
|
21
24
|
}, [useGte]);
|
|
22
|
-
useEffect(() => {
|
|
25
|
+
(0, react_1.useEffect)(() => {
|
|
23
26
|
collectionRef.current = collection;
|
|
24
27
|
}, [collection]);
|
|
25
|
-
useEffect(() => {
|
|
28
|
+
(0, react_1.useEffect)(() => {
|
|
26
29
|
onUpdateRef.current = onUpdate;
|
|
27
30
|
}, [onUpdate]);
|
|
28
31
|
// Manual trigger function
|
|
29
|
-
const trigger = useCallback(async () => {
|
|
32
|
+
const trigger = (0, react_1.useCallback)(async () => {
|
|
30
33
|
var _a;
|
|
31
34
|
const col = collectionRef.current;
|
|
32
35
|
if (!col)
|
|
@@ -49,7 +52,7 @@ export function useLiveUpdates(collection, options = {}) {
|
|
|
49
52
|
console.error('Manual live update trigger failed:', error);
|
|
50
53
|
}
|
|
51
54
|
}, []);
|
|
52
|
-
useEffect(() => {
|
|
55
|
+
(0, react_1.useEffect)(() => {
|
|
53
56
|
if (!collection || !enabled) {
|
|
54
57
|
// Clear any existing interval
|
|
55
58
|
if (intervalRef.current) {
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.routingProfileToEngineSettings = exports.getRoutingEngineLabel = exports.RoutingEngineName = exports.NodeType = exports.BookingState = exports.TransactionCurrency = exports.TransactionProvider = exports.TransactionType = exports.TransactionStatus = exports.PassengerGender = exports.isValidEnumValue = exports.getEnumValues = exports.getEnumLabel = exports.getEnumOptions = exports.useSGERPContext = exports.SGERPProvider = exports.useLiveUpdates = exports.useSGERP = exports.useCollection = exports.TransitStopSetCollection = exports.BuildingCollection = exports.TransitStopCollection = exports.SMSScheduledCollection = exports.MapboxTokenCollection = exports.GeofenceCollection = exports.RoutingProfileCollection = exports.OperationsLocationGroupCollection = exports.OperationsLocationCollection = exports.SimulationProcessorCollection = exports.DatasetCollection = exports.NodeCollection = exports.BookingCollection = exports.VehicleTypeCollection = exports.VehicleCollection = exports.DriverCollection = exports.SimulationCollection = exports.UserCollection = exports.TransactionCollection = exports.TicketCollection = exports.PassengerCollection = exports.PricingCollection = exports.OrganizationProjectCollection = exports.OrganizationCollection = exports.ProjectMemberCollection = exports.ProjectCollection = exports.Collection = exports.APIError = exports.APIClient = exports.SGERPClient = exports.initializeSGERP = void 0;
|
|
18
|
+
exports.ConnectionManager = exports.useLocalization = exports.setLocale = exports.getLocale = exports.localize = exports.createVehicleRoutesFromNodes = exports.generateWaypointRouteFromNodes = exports.getContrastTextColor = exports.normalizeVehicleColor = exports.getColorFromAgentId = exports.getHSLToRGB = exports.airLeg = exports.Route = exports.Leg = exports.Step = exports.RoutingEngine = exports.OperationsLocationByProjectMapState = exports.OperationsLocationMapState = exports.createVehicleUploadTask = exports.VehicleExportAttemptStatus = exports.VehicleUseOption = exports.VehicleStatus = void 0;
|
|
19
|
+
// Main Client
|
|
20
|
+
var client_1 = require("./client");
|
|
21
|
+
Object.defineProperty(exports, "initializeSGERP", { enumerable: true, get: function () { return client_1.initializeSGERP; } });
|
|
22
|
+
Object.defineProperty(exports, "SGERPClient", { enumerable: true, get: function () { return client_1.SGERPClient; } });
|
|
23
|
+
// API Client (for advanced usage)
|
|
24
|
+
var client_2 = require("./api/client");
|
|
25
|
+
Object.defineProperty(exports, "APIClient", { enumerable: true, get: function () { return client_2.APIClient; } });
|
|
26
|
+
Object.defineProperty(exports, "APIError", { enumerable: true, get: function () { return client_2.APIError; } });
|
|
27
|
+
// Collections
|
|
28
|
+
var collection_1 = require("./collection");
|
|
29
|
+
Object.defineProperty(exports, "Collection", { enumerable: true, get: function () { return collection_1.Collection; } });
|
|
30
|
+
var project_1 = require("./collections/sharing/project");
|
|
31
|
+
Object.defineProperty(exports, "ProjectCollection", { enumerable: true, get: function () { return project_1.ProjectCollection; } });
|
|
32
|
+
var project_member_1 = require("./collections/sharing/project-member");
|
|
33
|
+
Object.defineProperty(exports, "ProjectMemberCollection", { enumerable: true, get: function () { return project_member_1.ProjectMemberCollection; } });
|
|
34
|
+
var organization_1 = require("./collections/sharing/organization");
|
|
35
|
+
Object.defineProperty(exports, "OrganizationCollection", { enumerable: true, get: function () { return organization_1.OrganizationCollection; } });
|
|
36
|
+
var organization_project_1 = require("./collections/sharing/organization-project");
|
|
37
|
+
Object.defineProperty(exports, "OrganizationProjectCollection", { enumerable: true, get: function () { return organization_project_1.OrganizationProjectCollection; } });
|
|
38
|
+
var pricing_1 = require("./collections/sharing/pricing");
|
|
39
|
+
Object.defineProperty(exports, "PricingCollection", { enumerable: true, get: function () { return pricing_1.PricingCollection; } });
|
|
40
|
+
var passenger_1 = require("./collections/transportation/passenger");
|
|
41
|
+
Object.defineProperty(exports, "PassengerCollection", { enumerable: true, get: function () { return passenger_1.PassengerCollection; } });
|
|
42
|
+
var ticket_1 = require("./collections/transportation/ticket");
|
|
43
|
+
Object.defineProperty(exports, "TicketCollection", { enumerable: true, get: function () { return ticket_1.TicketCollection; } });
|
|
44
|
+
var transaction_1 = require("./collections/transportation/transaction");
|
|
45
|
+
Object.defineProperty(exports, "TransactionCollection", { enumerable: true, get: function () { return transaction_1.TransactionCollection; } });
|
|
46
|
+
var user_1 = require("./collections/account/user");
|
|
47
|
+
Object.defineProperty(exports, "UserCollection", { enumerable: true, get: function () { return user_1.UserCollection; } });
|
|
48
|
+
var simulation_1 = require("./collections/simulation/simulation");
|
|
49
|
+
Object.defineProperty(exports, "SimulationCollection", { enumerable: true, get: function () { return simulation_1.SimulationCollection; } });
|
|
50
|
+
var driver_1 = require("./collections/simulation/driver");
|
|
51
|
+
Object.defineProperty(exports, "DriverCollection", { enumerable: true, get: function () { return driver_1.DriverCollection; } });
|
|
52
|
+
var vehicle_1 = require("./collections/simulation/vehicle");
|
|
53
|
+
Object.defineProperty(exports, "VehicleCollection", { enumerable: true, get: function () { return vehicle_1.VehicleCollection; } });
|
|
54
|
+
var vehicletype_1 = require("./collections/simulation/vehicletype");
|
|
55
|
+
Object.defineProperty(exports, "VehicleTypeCollection", { enumerable: true, get: function () { return vehicletype_1.VehicleTypeCollection; } });
|
|
56
|
+
var booking_1 = require("./collections/simulation/booking");
|
|
57
|
+
Object.defineProperty(exports, "BookingCollection", { enumerable: true, get: function () { return booking_1.BookingCollection; } });
|
|
58
|
+
var node_1 = require("./collections/simulation/node");
|
|
59
|
+
Object.defineProperty(exports, "NodeCollection", { enumerable: true, get: function () { return node_1.NodeCollection; } });
|
|
60
|
+
var dataset_1 = require("./collections/simulation/dataset");
|
|
61
|
+
Object.defineProperty(exports, "DatasetCollection", { enumerable: true, get: function () { return dataset_1.DatasetCollection; } });
|
|
62
|
+
var simulationprocessor_1 = require("./collections/simulation/simulationprocessor");
|
|
63
|
+
Object.defineProperty(exports, "SimulationProcessorCollection", { enumerable: true, get: function () { return simulationprocessor_1.SimulationProcessorCollection; } });
|
|
64
|
+
var operationslocation_1 = require("./collections/simulation/operationslocation");
|
|
65
|
+
Object.defineProperty(exports, "OperationsLocationCollection", { enumerable: true, get: function () { return operationslocation_1.OperationsLocationCollection; } });
|
|
66
|
+
var operationslocationgroup_1 = require("./collections/simulation/operationslocationgroup");
|
|
67
|
+
Object.defineProperty(exports, "OperationsLocationGroupCollection", { enumerable: true, get: function () { return operationslocationgroup_1.OperationsLocationGroupCollection; } });
|
|
68
|
+
var routingprofile_1 = require("./collections/simulation/routingprofile");
|
|
69
|
+
Object.defineProperty(exports, "RoutingProfileCollection", { enumerable: true, get: function () { return routingprofile_1.RoutingProfileCollection; } });
|
|
70
|
+
var geofence_1 = require("./collections/simulation/geofence");
|
|
71
|
+
Object.defineProperty(exports, "GeofenceCollection", { enumerable: true, get: function () { return geofence_1.GeofenceCollection; } });
|
|
72
|
+
var mapboxtoken_1 = require("./collections/simulation/mapboxtoken");
|
|
73
|
+
Object.defineProperty(exports, "MapboxTokenCollection", { enumerable: true, get: function () { return mapboxtoken_1.MapboxTokenCollection; } });
|
|
74
|
+
var smsscheduled_1 = require("./collections/sms_notify/smsscheduled");
|
|
75
|
+
Object.defineProperty(exports, "SMSScheduledCollection", { enumerable: true, get: function () { return smsscheduled_1.SMSScheduledCollection; } });
|
|
76
|
+
var transitstop_1 = require("./collections/masstransit/transitstop");
|
|
77
|
+
Object.defineProperty(exports, "TransitStopCollection", { enumerable: true, get: function () { return transitstop_1.TransitStopCollection; } });
|
|
78
|
+
var building_1 = require("./collections/masstransit/building");
|
|
79
|
+
Object.defineProperty(exports, "BuildingCollection", { enumerable: true, get: function () { return building_1.BuildingCollection; } });
|
|
80
|
+
var transitstopset_1 = require("./collections/masstransit/transitstopset");
|
|
81
|
+
Object.defineProperty(exports, "TransitStopSetCollection", { enumerable: true, get: function () { return transitstopset_1.TransitStopSetCollection; } });
|
|
82
|
+
// React Hooks
|
|
83
|
+
var use_collection_1 = require("./hooks/use-collection");
|
|
84
|
+
Object.defineProperty(exports, "useCollection", { enumerable: true, get: function () { return use_collection_1.useCollection; } });
|
|
85
|
+
Object.defineProperty(exports, "useSGERP", { enumerable: true, get: function () { return use_collection_1.useSGERP; } });
|
|
86
|
+
var use_live_updates_1 = require("./hooks/use-live-updates");
|
|
87
|
+
Object.defineProperty(exports, "useLiveUpdates", { enumerable: true, get: function () { return use_live_updates_1.useLiveUpdates; } });
|
|
88
|
+
// React Context
|
|
89
|
+
var sgerp_context_1 = require("./context/sgerp-context");
|
|
90
|
+
Object.defineProperty(exports, "SGERPProvider", { enumerable: true, get: function () { return sgerp_context_1.SGERPProvider; } });
|
|
91
|
+
Object.defineProperty(exports, "useSGERPContext", { enumerable: true, get: function () { return sgerp_context_1.useSGERPContext; } });
|
|
92
|
+
// Enums
|
|
93
|
+
__exportStar(require("./constants/scheduling-enums"), exports);
|
|
94
|
+
__exportStar(require("./constants/messages-enums"), exports);
|
|
95
|
+
__exportStar(require("./constants/simulation-enums"), exports);
|
|
96
|
+
__exportStar(require("./constants/bulkoperations-enums"), exports);
|
|
97
|
+
// Enum Utilities
|
|
98
|
+
var enum_helpers_1 = require("./utils/enum-helpers");
|
|
99
|
+
Object.defineProperty(exports, "getEnumOptions", { enumerable: true, get: function () { return enum_helpers_1.getEnumOptions; } });
|
|
100
|
+
Object.defineProperty(exports, "getEnumLabel", { enumerable: true, get: function () { return enum_helpers_1.getEnumLabel; } });
|
|
101
|
+
Object.defineProperty(exports, "getEnumValues", { enumerable: true, get: function () { return enum_helpers_1.getEnumValues; } });
|
|
102
|
+
Object.defineProperty(exports, "isValidEnumValue", { enumerable: true, get: function () { return enum_helpers_1.isValidEnumValue; } });
|
|
103
|
+
var passenger_2 = require("./types/transportation/passenger");
|
|
104
|
+
Object.defineProperty(exports, "PassengerGender", { enumerable: true, get: function () { return passenger_2.PassengerGender; } });
|
|
105
|
+
var transaction_2 = require("./types/transportation/transaction");
|
|
106
|
+
Object.defineProperty(exports, "TransactionStatus", { enumerable: true, get: function () { return transaction_2.TransactionStatus; } });
|
|
107
|
+
Object.defineProperty(exports, "TransactionType", { enumerable: true, get: function () { return transaction_2.TransactionType; } });
|
|
108
|
+
Object.defineProperty(exports, "TransactionProvider", { enumerable: true, get: function () { return transaction_2.TransactionProvider; } });
|
|
109
|
+
Object.defineProperty(exports, "TransactionCurrency", { enumerable: true, get: function () { return transaction_2.TransactionCurrency; } });
|
|
110
|
+
var booking_2 = require("./types/simulation/booking");
|
|
111
|
+
Object.defineProperty(exports, "BookingState", { enumerable: true, get: function () { return booking_2.BookingState; } });
|
|
112
|
+
var node_2 = require("./types/simulation/node");
|
|
113
|
+
Object.defineProperty(exports, "NodeType", { enumerable: true, get: function () { return node_2.NodeType; } });
|
|
114
|
+
var routingprofile_2 = require("./types/simulation/routingprofile");
|
|
115
|
+
Object.defineProperty(exports, "RoutingEngineName", { enumerable: true, get: function () { return routingprofile_2.RoutingEngineName; } });
|
|
116
|
+
Object.defineProperty(exports, "getRoutingEngineLabel", { enumerable: true, get: function () { return routingprofile_2.getRoutingEngineLabel; } });
|
|
117
|
+
var routing_engine_settings_1 = require("./types/simulation/routing-engine-settings");
|
|
118
|
+
Object.defineProperty(exports, "routingProfileToEngineSettings", { enumerable: true, get: function () { return routing_engine_settings_1.routingProfileToEngineSettings; } });
|
|
119
|
+
var bulkoperations_1 = require("./types/bulkoperations");
|
|
120
|
+
Object.defineProperty(exports, "VehicleStatus", { enumerable: true, get: function () { return bulkoperations_1.VehicleStatus; } });
|
|
121
|
+
Object.defineProperty(exports, "VehicleUseOption", { enumerable: true, get: function () { return bulkoperations_1.VehicleUseOption; } });
|
|
122
|
+
Object.defineProperty(exports, "VehicleExportAttemptStatus", { enumerable: true, get: function () { return bulkoperations_1.VehicleExportAttemptStatus; } });
|
|
123
|
+
Object.defineProperty(exports, "createVehicleUploadTask", { enumerable: true, get: function () { return bulkoperations_1.createVehicleUploadTask; } });
|
|
124
|
+
// Map States
|
|
125
|
+
var operations_location_state_1 = require("./map-states/operations-location-state");
|
|
126
|
+
Object.defineProperty(exports, "OperationsLocationMapState", { enumerable: true, get: function () { return operations_location_state_1.OperationsLocationMapState; } });
|
|
127
|
+
Object.defineProperty(exports, "OperationsLocationByProjectMapState", { enumerable: true, get: function () { return operations_location_state_1.OperationsLocationByProjectMapState; } });
|
|
128
|
+
// Routing Engine
|
|
129
|
+
var routing_1 = require("./routing");
|
|
130
|
+
Object.defineProperty(exports, "RoutingEngine", { enumerable: true, get: function () { return routing_1.RoutingEngine; } });
|
|
131
|
+
Object.defineProperty(exports, "Step", { enumerable: true, get: function () { return routing_1.Step; } });
|
|
132
|
+
Object.defineProperty(exports, "Leg", { enumerable: true, get: function () { return routing_1.Leg; } });
|
|
133
|
+
Object.defineProperty(exports, "Route", { enumerable: true, get: function () { return routing_1.Route; } });
|
|
134
|
+
Object.defineProperty(exports, "airLeg", { enumerable: true, get: function () { return routing_1.airLeg; } });
|
|
135
|
+
// Utilities
|
|
136
|
+
var color_1 = require("./utils/color");
|
|
137
|
+
Object.defineProperty(exports, "getHSLToRGB", { enumerable: true, get: function () { return color_1.getHSLToRGB; } });
|
|
138
|
+
Object.defineProperty(exports, "getColorFromAgentId", { enumerable: true, get: function () { return color_1.getColorFromAgentId; } });
|
|
139
|
+
Object.defineProperty(exports, "normalizeVehicleColor", { enumerable: true, get: function () { return color_1.normalizeVehicleColor; } });
|
|
140
|
+
Object.defineProperty(exports, "getContrastTextColor", { enumerable: true, get: function () { return color_1.getContrastTextColor; } });
|
|
141
|
+
var routeUtils_1 = require("./utils/routeUtils");
|
|
142
|
+
Object.defineProperty(exports, "generateWaypointRouteFromNodes", { enumerable: true, get: function () { return routeUtils_1.generateWaypointRouteFromNodes; } });
|
|
143
|
+
Object.defineProperty(exports, "createVehicleRoutesFromNodes", { enumerable: true, get: function () { return routeUtils_1.createVehicleRoutesFromNodes; } });
|
|
144
|
+
// Localization
|
|
145
|
+
var locale_1 = require("../locales/locale");
|
|
146
|
+
Object.defineProperty(exports, "localize", { enumerable: true, get: function () { return locale_1.localize; } });
|
|
147
|
+
Object.defineProperty(exports, "getLocale", { enumerable: true, get: function () { return locale_1.getLocale; } });
|
|
148
|
+
Object.defineProperty(exports, "setLocale", { enumerable: true, get: function () { return locale_1.setLocale; } });
|
|
149
|
+
var useLocalization_1 = require("../locales/useLocalization");
|
|
150
|
+
Object.defineProperty(exports, "useLocalization", { enumerable: true, get: function () { return useLocalization_1.useLocalization; } });
|
|
151
|
+
// Connection Manager
|
|
152
|
+
var connection_manager_1 = require("../connection-manager");
|
|
153
|
+
Object.defineProperty(exports, "ConnectionManager", { enumerable: true, get: function () { return connection_manager_1.ConnectionManager; } });
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { MapStateConfig } from '../types/map';
|
|
2
|
+
/**
|
|
3
|
+
* Default map state for OperationsLocation visualization
|
|
4
|
+
* Displays locations as blue circles with hover interactions
|
|
5
|
+
*/
|
|
6
|
+
export declare const OperationsLocationMapState: MapStateConfig;
|
|
7
|
+
/**
|
|
8
|
+
* Map state with color coding by project
|
|
9
|
+
* Uses project_id to color code locations
|
|
10
|
+
*/
|
|
11
|
+
export declare const OperationsLocationByProjectMapState: MapStateConfig;
|
|
12
|
+
//# sourceMappingURL=operations-location-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations-location-state.d.ts","sourceRoot":"","sources":["../../../sgerplib/sgerp/map-states/operations-location-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,cAiCxC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mCAAmC,EAAE,cAwCjD,CAAC"}
|