sgerp-frontend-lib 0.1.2 → 0.1.4
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/constants/timezones.d.ts +23 -0
- package/dist/constants/timezones.d.ts.map +1 -0
- package/dist/constants/timezones.js +107 -0
- package/dist/markdown.d.ts +33 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/markdown.js +117 -0
- package/dist/sgerp/context/sgerp-context.js +1 -1
- package/dist/sgerp/hooks/use-collection.js +1 -1
- package/dist/sgerp/index.d.ts +17 -2
- package/dist/sgerp/index.d.ts.map +1 -1
- package/dist/sgerp/index.js +39 -1
- 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 +1 -1
- 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 +1 -1
- 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/routeCalculationUtils.d.ts +3 -3
- package/dist/sgerp/simulation-logic/routeCalculationUtils.d.ts.map +1 -1
- package/dist/sgerp/simulation-logic/routeCalculationUtils.js +1 -1
- package/dist/sgerp/simulation-logic/timeShiftUtils.d.ts +1 -1
- package/dist/sgerp/simulation-logic/timeShiftUtils.d.ts.map +1 -1
- package/dist/sgerp/utils/routeUtils.d.ts +1 -1
- package/dist/sgerp/utils/routeUtils.d.ts.map +1 -1
- package/dist/utils/countries.d.ts +15 -0
- package/dist/utils/countries.d.ts.map +1 -0
- package/dist/utils/countries.js +112 -0
- package/dist/utils.d.ts +3 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get all available timezone names from moment-timezone
|
|
3
|
+
*/
|
|
4
|
+
export declare function getAllTimezones(): string[];
|
|
5
|
+
/**
|
|
6
|
+
* Get timezone options formatted for select dropdowns
|
|
7
|
+
*/
|
|
8
|
+
export declare function getTimezoneOptions(locale?: string): {
|
|
9
|
+
label: string;
|
|
10
|
+
value: string;
|
|
11
|
+
}[];
|
|
12
|
+
/**
|
|
13
|
+
* Common timezones for quick access
|
|
14
|
+
*/
|
|
15
|
+
export declare const COMMON_TIMEZONES: readonly ["UTC", "America/New_York", "America/Los_Angeles", "America/Chicago", "Europe/London", "Europe/Paris", "Asia/Tokyo", "Asia/Shanghai", "Australia/Sydney"];
|
|
16
|
+
/**
|
|
17
|
+
* Get common timezone options formatted for select dropdowns
|
|
18
|
+
*/
|
|
19
|
+
export declare function getCommonTimezoneOptions(locale?: string): {
|
|
20
|
+
label: string;
|
|
21
|
+
value: string;
|
|
22
|
+
}[];
|
|
23
|
+
//# sourceMappingURL=timezones.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timezones.d.ts","sourceRoot":"","sources":["../../sgerplib/constants/timezones.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,eAAe,IAAI,MAAM,EAAE,CAE1C;AA2DD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,GAAE,MAAa,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,CAY5F;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,oKAUnB,CAAC;AAEX;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,GAAE,MAAa,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,CAUlG"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.COMMON_TIMEZONES = void 0;
|
|
7
|
+
exports.getAllTimezones = getAllTimezones;
|
|
8
|
+
exports.getTimezoneOptions = getTimezoneOptions;
|
|
9
|
+
exports.getCommonTimezoneOptions = getCommonTimezoneOptions;
|
|
10
|
+
const moment_timezone_1 = __importDefault(require("moment-timezone"));
|
|
11
|
+
/**
|
|
12
|
+
* Get all available timezone names from moment-timezone
|
|
13
|
+
*/
|
|
14
|
+
function getAllTimezones() {
|
|
15
|
+
return moment_timezone_1.default.tz.names();
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Localized timezone names (Japanese)
|
|
19
|
+
*/
|
|
20
|
+
const TIMEZONE_NAMES_JA = {
|
|
21
|
+
// Asia
|
|
22
|
+
'Asia/Tokyo': 'アジア/東京',
|
|
23
|
+
'Asia/Seoul': 'アジア/ソウル',
|
|
24
|
+
'Asia/Shanghai': 'アジア/上海',
|
|
25
|
+
'Asia/Hong_Kong': 'アジア/香港',
|
|
26
|
+
'Asia/Singapore': 'アジア/シンガポール',
|
|
27
|
+
'Asia/Bangkok': 'アジア/バンコク',
|
|
28
|
+
'Asia/Dubai': 'アジア/ドバイ',
|
|
29
|
+
'Asia/Kolkata': 'アジア/コルカタ',
|
|
30
|
+
// Europe
|
|
31
|
+
'Europe/London': 'ヨーロッパ/ロンドン',
|
|
32
|
+
'Europe/Paris': 'ヨーロッパ/パリ',
|
|
33
|
+
'Europe/Berlin': 'ヨーロッパ/ベルリン',
|
|
34
|
+
'Europe/Rome': 'ヨーロッパ/ローマ',
|
|
35
|
+
'Europe/Madrid': 'ヨーロッパ/マドリード',
|
|
36
|
+
'Europe/Moscow': 'ヨーロッパ/モスクワ',
|
|
37
|
+
// America
|
|
38
|
+
'America/New_York': 'アメリカ/ニューヨーク',
|
|
39
|
+
'America/Los_Angeles': 'アメリカ/ロサンゼルス',
|
|
40
|
+
'America/Chicago': 'アメリカ/シカゴ',
|
|
41
|
+
'America/Denver': 'アメリカ/デンバー',
|
|
42
|
+
'America/Phoenix': 'アメリカ/フェニックス',
|
|
43
|
+
'America/Toronto': 'アメリカ/トロント',
|
|
44
|
+
'America/Mexico_City': 'アメリカ/メキシコシティ',
|
|
45
|
+
'America/Sao_Paulo': 'アメリカ/サンパウロ',
|
|
46
|
+
// Pacific
|
|
47
|
+
'Pacific/Auckland': '太平洋/オークランド',
|
|
48
|
+
'Pacific/Fiji': '太平洋/フィジー',
|
|
49
|
+
'Pacific/Honolulu': '太平洋/ホノルル',
|
|
50
|
+
// Australia
|
|
51
|
+
'Australia/Sydney': 'オーストラリア/シドニー',
|
|
52
|
+
'Australia/Melbourne': 'オーストラリア/メルボルン',
|
|
53
|
+
'Australia/Perth': 'オーストラリア/パース',
|
|
54
|
+
// UTC
|
|
55
|
+
'UTC': 'UTC (協定世界時)',
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Get localized timezone label
|
|
59
|
+
*/
|
|
60
|
+
function getLocalizedTimezoneName(tz, locale) {
|
|
61
|
+
if (locale === 'ja' && TIMEZONE_NAMES_JA[tz]) {
|
|
62
|
+
return TIMEZONE_NAMES_JA[tz];
|
|
63
|
+
}
|
|
64
|
+
// Default: replace underscores with spaces
|
|
65
|
+
return tz.replace(/_/g, ' ');
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Get timezone options formatted for select dropdowns
|
|
69
|
+
*/
|
|
70
|
+
function getTimezoneOptions(locale = 'en') {
|
|
71
|
+
const timezones = moment_timezone_1.default.tz.names();
|
|
72
|
+
return timezones.map(tz => {
|
|
73
|
+
const localizedName = getLocalizedTimezoneName(tz, locale);
|
|
74
|
+
const offset = moment_timezone_1.default.tz(tz).format('Z');
|
|
75
|
+
return {
|
|
76
|
+
label: `${localizedName} (UTC${offset})`,
|
|
77
|
+
value: tz,
|
|
78
|
+
};
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Common timezones for quick access
|
|
83
|
+
*/
|
|
84
|
+
exports.COMMON_TIMEZONES = [
|
|
85
|
+
'UTC',
|
|
86
|
+
'America/New_York',
|
|
87
|
+
'America/Los_Angeles',
|
|
88
|
+
'America/Chicago',
|
|
89
|
+
'Europe/London',
|
|
90
|
+
'Europe/Paris',
|
|
91
|
+
'Asia/Tokyo',
|
|
92
|
+
'Asia/Shanghai',
|
|
93
|
+
'Australia/Sydney',
|
|
94
|
+
];
|
|
95
|
+
/**
|
|
96
|
+
* Get common timezone options formatted for select dropdowns
|
|
97
|
+
*/
|
|
98
|
+
function getCommonTimezoneOptions(locale = 'en') {
|
|
99
|
+
return exports.COMMON_TIMEZONES.map(tz => {
|
|
100
|
+
const localizedName = getLocalizedTimezoneName(tz, locale);
|
|
101
|
+
const offset = moment_timezone_1.default.tz(tz).format('Z');
|
|
102
|
+
return {
|
|
103
|
+
label: `${localizedName} (UTC${offset})`,
|
|
104
|
+
value: tz,
|
|
105
|
+
};
|
|
106
|
+
});
|
|
107
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export type Language = 'en' | 'ja' | 'ms';
|
|
2
|
+
export interface DocMetadata {
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
}
|
|
7
|
+
export interface Heading {
|
|
8
|
+
id: string;
|
|
9
|
+
text: string;
|
|
10
|
+
level: number;
|
|
11
|
+
}
|
|
12
|
+
export interface DocContent {
|
|
13
|
+
metadata: DocMetadata;
|
|
14
|
+
content: string;
|
|
15
|
+
slug: string;
|
|
16
|
+
headings?: Heading[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Extract headings from markdown content
|
|
20
|
+
*/
|
|
21
|
+
export declare function extractHeadings(content: string): Heading[];
|
|
22
|
+
/**
|
|
23
|
+
* Get a documentation file by slug with locale support
|
|
24
|
+
* @param slug - The slug path (e.g., ['getting-started'])
|
|
25
|
+
* @param locale - The language locale (defaults to 'en')
|
|
26
|
+
* @returns The documentation content or null if not found
|
|
27
|
+
*/
|
|
28
|
+
export declare function getDocBySlug(slug: string[], locale?: Language): DocContent | null;
|
|
29
|
+
/**
|
|
30
|
+
* Get all documentation slugs
|
|
31
|
+
*/
|
|
32
|
+
export declare function getAllDocSlugs(): string[][];
|
|
33
|
+
//# sourceMappingURL=markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../sgerplib/markdown.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAc1C,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,WAAW,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,EAAE,CA6B1D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,GAAE,QAAe,GAAG,UAAU,GAAG,IAAI,CAqCvF;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,EAAE,EAAE,CAwB3C"}
|
package/dist/markdown.js
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.extractHeadings = extractHeadings;
|
|
7
|
+
exports.getDocBySlug = getDocBySlug;
|
|
8
|
+
exports.getAllDocSlugs = getAllDocSlugs;
|
|
9
|
+
const fs_1 = __importDefault(require("fs"));
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
const gray_matter_1 = __importDefault(require("gray-matter"));
|
|
12
|
+
/**
|
|
13
|
+
* Get the content directory for a specific locale
|
|
14
|
+
* @param locale - The language locale (en, ja, ms)
|
|
15
|
+
* @returns The path to the content directory
|
|
16
|
+
*/
|
|
17
|
+
function getContentDirectory(locale = 'en') {
|
|
18
|
+
const suffix = locale === 'en' ? '' : `-${locale}`;
|
|
19
|
+
return path_1.default.join(process.cwd(), `content/docs${suffix}`);
|
|
20
|
+
}
|
|
21
|
+
const contentDirectory = path_1.default.join(process.cwd(), 'content/docs');
|
|
22
|
+
/**
|
|
23
|
+
* Extract headings from markdown content
|
|
24
|
+
*/
|
|
25
|
+
function extractHeadings(content) {
|
|
26
|
+
const headings = [];
|
|
27
|
+
const lines = content.split('\n');
|
|
28
|
+
const idCounts = new Map();
|
|
29
|
+
for (const line of lines) {
|
|
30
|
+
// Match markdown headings (## Heading)
|
|
31
|
+
const match = line.match(/^(#{2,3})\s+(.+)$/);
|
|
32
|
+
if (match) {
|
|
33
|
+
const level = match[1].length;
|
|
34
|
+
const text = match[2].trim();
|
|
35
|
+
// Create a slug from the heading text
|
|
36
|
+
let id = text
|
|
37
|
+
.toLowerCase()
|
|
38
|
+
.replace(/[^a-z0-9\s-]/g, '')
|
|
39
|
+
.replace(/\s+/g, '-');
|
|
40
|
+
// Handle duplicate IDs
|
|
41
|
+
const count = idCounts.get(id) || 0;
|
|
42
|
+
if (count > 0) {
|
|
43
|
+
id = `${id}-${count}`;
|
|
44
|
+
}
|
|
45
|
+
idCounts.set(id.replace(/-\d+$/, ''), count + 1);
|
|
46
|
+
headings.push({ id, text, level });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return headings;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Get a documentation file by slug with locale support
|
|
53
|
+
* @param slug - The slug path (e.g., ['getting-started'])
|
|
54
|
+
* @param locale - The language locale (defaults to 'en')
|
|
55
|
+
* @returns The documentation content or null if not found
|
|
56
|
+
*/
|
|
57
|
+
function getDocBySlug(slug, locale = 'en') {
|
|
58
|
+
try {
|
|
59
|
+
const slugPath = slug.join('/');
|
|
60
|
+
const localeContentDir = getContentDirectory(locale);
|
|
61
|
+
let fullPath = path_1.default.join(localeContentDir, `${slugPath}.md`);
|
|
62
|
+
// If the direct path doesn't exist, try index.md inside the directory
|
|
63
|
+
if (!fs_1.default.existsSync(fullPath)) {
|
|
64
|
+
const indexPath = path_1.default.join(localeContentDir, slugPath, 'index.md');
|
|
65
|
+
if (fs_1.default.existsSync(indexPath)) {
|
|
66
|
+
fullPath = indexPath;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
// Fallback to English if locale file doesn't exist
|
|
70
|
+
if (locale !== 'en') {
|
|
71
|
+
return getDocBySlug(slug, 'en');
|
|
72
|
+
}
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const fileContents = fs_1.default.readFileSync(fullPath, 'utf8');
|
|
77
|
+
const { data, content } = (0, gray_matter_1.default)(fileContents);
|
|
78
|
+
return {
|
|
79
|
+
metadata: data,
|
|
80
|
+
content,
|
|
81
|
+
slug: slugPath,
|
|
82
|
+
headings: extractHeadings(content),
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
console.error('Error reading doc:', error);
|
|
87
|
+
// Fallback to English on error if not already English
|
|
88
|
+
if (locale !== 'en') {
|
|
89
|
+
return getDocBySlug(slug, 'en');
|
|
90
|
+
}
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Get all documentation slugs
|
|
96
|
+
*/
|
|
97
|
+
function getAllDocSlugs() {
|
|
98
|
+
const slugs = [];
|
|
99
|
+
function traverseDirectory(dir, currentPath = []) {
|
|
100
|
+
const files = fs_1.default.readdirSync(dir);
|
|
101
|
+
files.forEach((file) => {
|
|
102
|
+
const filePath = path_1.default.join(dir, file);
|
|
103
|
+
const stat = fs_1.default.statSync(filePath);
|
|
104
|
+
if (stat.isDirectory()) {
|
|
105
|
+
traverseDirectory(filePath, [...currentPath, file]);
|
|
106
|
+
}
|
|
107
|
+
else if (file.endsWith('.md')) {
|
|
108
|
+
const slug = [...currentPath, file.replace(/\.md$/, '')];
|
|
109
|
+
slugs.push(slug);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
if (fs_1.default.existsSync(contentDirectory)) {
|
|
114
|
+
traverseDirectory(contentDirectory);
|
|
115
|
+
}
|
|
116
|
+
return slugs;
|
|
117
|
+
}
|
|
@@ -38,7 +38,7 @@ exports.SGERPProvider = SGERPProvider;
|
|
|
38
38
|
exports.useSGERPContext = useSGERPContext;
|
|
39
39
|
const react_1 = __importStar(require("react"));
|
|
40
40
|
const client_1 = require("../client");
|
|
41
|
-
const connection_manager_1 = require("
|
|
41
|
+
const connection_manager_1 = require("../../connection-manager");
|
|
42
42
|
/**
|
|
43
43
|
* Context to share SGERP API client across all pages and components
|
|
44
44
|
* This prevents collections from being refetched when navigating between pages
|
|
@@ -5,7 +5,7 @@ exports.useCollection = useCollection;
|
|
|
5
5
|
exports.useSGERP = useSGERP;
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const client_1 = require("../client");
|
|
8
|
-
const connection_manager_1 = require("
|
|
8
|
+
const connection_manager_1 = require("../../connection-manager");
|
|
9
9
|
const sgerp_context_1 = require("../context/sgerp-context");
|
|
10
10
|
// Cached empty array to avoid creating new instances
|
|
11
11
|
const EMPTY_ARRAY = [];
|
package/dist/sgerp/index.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ export type { ProjectMember, } from './types/sharing/project-member';
|
|
|
45
45
|
export type { Organization, } from './types/sharing/organization';
|
|
46
46
|
export type { OrganizationProject, } from './types/sharing/organization-project';
|
|
47
47
|
export type { Pricing, PricingExtension, PricingDemandAdditionalPrice, PricingRule, PricingRules, PricingRoundingStrategy, PricingTerms, PricingTicketItem, PricingTicketSection, PricingDiscount, PricingPaymentMethod, PricingOptions, } from './types/sharing/pricing';
|
|
48
|
+
export type { PricingCostRequest, PricingCostResponse, PricingCostTicket, } from './types/simulation/pricing';
|
|
48
49
|
export type { Passenger, } from './types/transportation/passenger';
|
|
49
50
|
export { PassengerGender } from './types/transportation/passenger';
|
|
50
51
|
export type { Ticket, } from './types/transportation/ticket';
|
|
@@ -70,6 +71,9 @@ export type { MapboxToken, } from './types/simulation/mapboxtoken';
|
|
|
70
71
|
export type { RoutingEngineSettings, } from './types/simulation/routing-engine-settings';
|
|
71
72
|
export { routingProfileToEngineSettings, } from './types/simulation/routing-engine-settings';
|
|
72
73
|
export type { CalculationParams, } from './types/simulation/calculation-params';
|
|
74
|
+
export type { LogisticsApiSettings, } from './types/simulation/logistics-api-settings';
|
|
75
|
+
export { getDefaultLogisticsApiSettings, } from './types/simulation/logistics-api-settings';
|
|
76
|
+
export type { RouteCostModification, RouteCostModificationSetting, RouteCostModificationPolylinearSetting, RouteCostModificationPenalty, RouteCostModificationRelation, } from './types/simulation/route-cost-modification';
|
|
73
77
|
export type { VehicleUploadModel, VehicleUploadPayload, VehicleUploadResult, VehicleUploadResultVehicle, VehicleUploadCreatedNode, VehicleUploadOverlap, VehiclesInvalidUploadInfo, BulkTaskMessage, BulkTaskPayloadType, BulkTaskResultType, } from './types/bulkoperations';
|
|
74
78
|
export { VehicleStatus, VehicleUseOption, VehicleExportAttemptStatus, createVehicleUploadTask, } from './types/bulkoperations';
|
|
75
79
|
export type { VehicleStatusValue, VehicleUseOptionValue, VehicleExportAttemptStatusValue, } from './types/bulkoperations';
|
|
@@ -81,10 +85,21 @@ export type { MapLayerConfig, MapStateConfig, } from './types/map';
|
|
|
81
85
|
export { OperationsLocationMapState, OperationsLocationByProjectMapState, } from './map-states/operations-location-state';
|
|
82
86
|
export { RoutingEngine, Step, Leg, Route, airLeg, } from './routing';
|
|
83
87
|
export { getHSLToRGB, getColorFromAgentId, normalizeVehicleColor, getContrastTextColor, } from './utils/color';
|
|
84
|
-
export { generateWaypointRouteFromNodes, createVehicleRoutesFromNodes } from './utils/routeUtils';
|
|
85
|
-
export type { RouteNode, Waypoint as RouteWaypoint, VehicleRouteData as RouteVehicleRouteData } from './utils/routeUtils';
|
|
88
|
+
export { generateWaypointRouteFromNodes, createVehicleRoutesFromNodes, validatePickupDropoffConstraint } from './utils/routeUtils';
|
|
89
|
+
export type { RouteNode, Waypoint, Waypoint as RouteWaypoint, VehicleRouteData, VehicleRouteData as RouteVehicleRouteData } from './utils/routeUtils';
|
|
90
|
+
export { buildBookingPayload } from './utils/bookingPayload';
|
|
91
|
+
export type { BookingPayloadInput } from './utils/bookingPayload';
|
|
92
|
+
export { fetchVehicles, fetchBookings, fetchNodes, fetchDrivers, fetchDriversByProject, fetchOperationsLocationsByProject, fetchSimulationData, createIndexMaps, attachReferences, calculateBoundingBoxCenter, vehicleComplexRearrange, buildVehicleRouteMap, shiftNodeTimestamps, shiftWaypointTimestamps, calculateVehicleRoute, hasRouteChanged, processUnassignResponse, } from './simulation-logic';
|
|
93
|
+
export type { VehicleComplexRearrangeRequest, ManualEditResponse, ManualEditError, VehicleRouteMap, UnassignResponse, ProcessUnassignResult, } from './simulation-logic';
|
|
86
94
|
export { localize, getLocale, setLocale } from '../locales/locale';
|
|
87
95
|
export type { Language } from '../locales/locale';
|
|
88
96
|
export { useLocalization } from '../locales/useLocalization';
|
|
89
97
|
export { ConnectionManager } from '../connection-manager';
|
|
98
|
+
export type { StoredConnection } from '../connection-manager';
|
|
99
|
+
export { getTimezoneOptions } from '../constants/timezones';
|
|
100
|
+
export { COUNTRIES, POPULAR_COUNTRIES, getLocalizedCountryName } from '../utils/countries';
|
|
101
|
+
export { cn } from '../utils';
|
|
102
|
+
export { SGERP_DOMAINS, DEFAULT_SERVERS } from './domains';
|
|
103
|
+
export { FIRST_SOLUTION_STRATEGIES } from './constants/solver-strategies';
|
|
104
|
+
export type { FirstSolutionStrategy } from './constants/solver-strategies';
|
|
90
105
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../sgerplib/sgerp/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACxD,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAG7C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACnD,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,4CAA4C,CAAC;AAC3F,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE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CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,YAAY,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC"}
|
package/dist/sgerp/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
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;
|
|
18
|
+
exports.FIRST_SOLUTION_STRATEGIES = exports.DEFAULT_SERVERS = exports.SGERP_DOMAINS = exports.cn = exports.getLocalizedCountryName = exports.POPULAR_COUNTRIES = exports.COUNTRIES = exports.getTimezoneOptions = exports.ConnectionManager = exports.useLocalization = exports.setLocale = exports.getLocale = exports.localize = exports.processUnassignResponse = exports.hasRouteChanged = exports.calculateVehicleRoute = exports.shiftWaypointTimestamps = exports.shiftNodeTimestamps = exports.buildVehicleRouteMap = exports.vehicleComplexRearrange = exports.calculateBoundingBoxCenter = exports.attachReferences = exports.createIndexMaps = exports.fetchSimulationData = exports.fetchOperationsLocationsByProject = exports.fetchDriversByProject = exports.fetchDrivers = exports.fetchNodes = exports.fetchBookings = exports.fetchVehicles = exports.buildBookingPayload = exports.validatePickupDropoffConstraint = 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 = exports.getDefaultLogisticsApiSettings = void 0;
|
|
19
19
|
// Main Client
|
|
20
20
|
var client_1 = require("./client");
|
|
21
21
|
Object.defineProperty(exports, "initializeSGERP", { enumerable: true, get: function () { return client_1.initializeSGERP; } });
|
|
@@ -116,6 +116,8 @@ Object.defineProperty(exports, "RoutingEngineName", { enumerable: true, get: fun
|
|
|
116
116
|
Object.defineProperty(exports, "getRoutingEngineLabel", { enumerable: true, get: function () { return routingprofile_2.getRoutingEngineLabel; } });
|
|
117
117
|
var routing_engine_settings_1 = require("./types/simulation/routing-engine-settings");
|
|
118
118
|
Object.defineProperty(exports, "routingProfileToEngineSettings", { enumerable: true, get: function () { return routing_engine_settings_1.routingProfileToEngineSettings; } });
|
|
119
|
+
var logistics_api_settings_1 = require("./types/simulation/logistics-api-settings");
|
|
120
|
+
Object.defineProperty(exports, "getDefaultLogisticsApiSettings", { enumerable: true, get: function () { return logistics_api_settings_1.getDefaultLogisticsApiSettings; } });
|
|
119
121
|
var bulkoperations_1 = require("./types/bulkoperations");
|
|
120
122
|
Object.defineProperty(exports, "VehicleStatus", { enumerable: true, get: function () { return bulkoperations_1.VehicleStatus; } });
|
|
121
123
|
Object.defineProperty(exports, "VehicleUseOption", { enumerable: true, get: function () { return bulkoperations_1.VehicleUseOption; } });
|
|
@@ -141,6 +143,28 @@ Object.defineProperty(exports, "getContrastTextColor", { enumerable: true, get:
|
|
|
141
143
|
var routeUtils_1 = require("./utils/routeUtils");
|
|
142
144
|
Object.defineProperty(exports, "generateWaypointRouteFromNodes", { enumerable: true, get: function () { return routeUtils_1.generateWaypointRouteFromNodes; } });
|
|
143
145
|
Object.defineProperty(exports, "createVehicleRoutesFromNodes", { enumerable: true, get: function () { return routeUtils_1.createVehicleRoutesFromNodes; } });
|
|
146
|
+
Object.defineProperty(exports, "validatePickupDropoffConstraint", { enumerable: true, get: function () { return routeUtils_1.validatePickupDropoffConstraint; } });
|
|
147
|
+
var bookingPayload_1 = require("./utils/bookingPayload");
|
|
148
|
+
Object.defineProperty(exports, "buildBookingPayload", { enumerable: true, get: function () { return bookingPayload_1.buildBookingPayload; } });
|
|
149
|
+
// Simulation Logic Utilities
|
|
150
|
+
var simulation_logic_1 = require("./simulation-logic");
|
|
151
|
+
Object.defineProperty(exports, "fetchVehicles", { enumerable: true, get: function () { return simulation_logic_1.fetchVehicles; } });
|
|
152
|
+
Object.defineProperty(exports, "fetchBookings", { enumerable: true, get: function () { return simulation_logic_1.fetchBookings; } });
|
|
153
|
+
Object.defineProperty(exports, "fetchNodes", { enumerable: true, get: function () { return simulation_logic_1.fetchNodes; } });
|
|
154
|
+
Object.defineProperty(exports, "fetchDrivers", { enumerable: true, get: function () { return simulation_logic_1.fetchDrivers; } });
|
|
155
|
+
Object.defineProperty(exports, "fetchDriversByProject", { enumerable: true, get: function () { return simulation_logic_1.fetchDriversByProject; } });
|
|
156
|
+
Object.defineProperty(exports, "fetchOperationsLocationsByProject", { enumerable: true, get: function () { return simulation_logic_1.fetchOperationsLocationsByProject; } });
|
|
157
|
+
Object.defineProperty(exports, "fetchSimulationData", { enumerable: true, get: function () { return simulation_logic_1.fetchSimulationData; } });
|
|
158
|
+
Object.defineProperty(exports, "createIndexMaps", { enumerable: true, get: function () { return simulation_logic_1.createIndexMaps; } });
|
|
159
|
+
Object.defineProperty(exports, "attachReferences", { enumerable: true, get: function () { return simulation_logic_1.attachReferences; } });
|
|
160
|
+
Object.defineProperty(exports, "calculateBoundingBoxCenter", { enumerable: true, get: function () { return simulation_logic_1.calculateBoundingBoxCenter; } });
|
|
161
|
+
Object.defineProperty(exports, "vehicleComplexRearrange", { enumerable: true, get: function () { return simulation_logic_1.vehicleComplexRearrange; } });
|
|
162
|
+
Object.defineProperty(exports, "buildVehicleRouteMap", { enumerable: true, get: function () { return simulation_logic_1.buildVehicleRouteMap; } });
|
|
163
|
+
Object.defineProperty(exports, "shiftNodeTimestamps", { enumerable: true, get: function () { return simulation_logic_1.shiftNodeTimestamps; } });
|
|
164
|
+
Object.defineProperty(exports, "shiftWaypointTimestamps", { enumerable: true, get: function () { return simulation_logic_1.shiftWaypointTimestamps; } });
|
|
165
|
+
Object.defineProperty(exports, "calculateVehicleRoute", { enumerable: true, get: function () { return simulation_logic_1.calculateVehicleRoute; } });
|
|
166
|
+
Object.defineProperty(exports, "hasRouteChanged", { enumerable: true, get: function () { return simulation_logic_1.hasRouteChanged; } });
|
|
167
|
+
Object.defineProperty(exports, "processUnassignResponse", { enumerable: true, get: function () { return simulation_logic_1.processUnassignResponse; } });
|
|
144
168
|
// Localization
|
|
145
169
|
var locale_1 = require("../locales/locale");
|
|
146
170
|
Object.defineProperty(exports, "localize", { enumerable: true, get: function () { return locale_1.localize; } });
|
|
@@ -151,3 +175,17 @@ Object.defineProperty(exports, "useLocalization", { enumerable: true, get: funct
|
|
|
151
175
|
// Connection Manager
|
|
152
176
|
var connection_manager_1 = require("../connection-manager");
|
|
153
177
|
Object.defineProperty(exports, "ConnectionManager", { enumerable: true, get: function () { return connection_manager_1.ConnectionManager; } });
|
|
178
|
+
// Constants & Utils
|
|
179
|
+
var timezones_1 = require("../constants/timezones");
|
|
180
|
+
Object.defineProperty(exports, "getTimezoneOptions", { enumerable: true, get: function () { return timezones_1.getTimezoneOptions; } });
|
|
181
|
+
var countries_1 = require("../utils/countries");
|
|
182
|
+
Object.defineProperty(exports, "COUNTRIES", { enumerable: true, get: function () { return countries_1.COUNTRIES; } });
|
|
183
|
+
Object.defineProperty(exports, "POPULAR_COUNTRIES", { enumerable: true, get: function () { return countries_1.POPULAR_COUNTRIES; } });
|
|
184
|
+
Object.defineProperty(exports, "getLocalizedCountryName", { enumerable: true, get: function () { return countries_1.getLocalizedCountryName; } });
|
|
185
|
+
var utils_1 = require("../utils");
|
|
186
|
+
Object.defineProperty(exports, "cn", { enumerable: true, get: function () { return utils_1.cn; } });
|
|
187
|
+
var domains_1 = require("./domains");
|
|
188
|
+
Object.defineProperty(exports, "SGERP_DOMAINS", { enumerable: true, get: function () { return domains_1.SGERP_DOMAINS; } });
|
|
189
|
+
Object.defineProperty(exports, "DEFAULT_SERVERS", { enumerable: true, get: function () { return domains_1.DEFAULT_SERVERS; } });
|
|
190
|
+
var solver_strategies_1 = require("./constants/solver-strategies");
|
|
191
|
+
Object.defineProperty(exports, "FIRST_SOLUTION_STRATEGIES", { enumerable: true, get: function () { return solver_strategies_1.FIRST_SOLUTION_STRATEGIES; } });
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { SGERPClient } from '
|
|
2
|
-
import type { Simulation } from '
|
|
3
|
-
import type { Booking } from '
|
|
4
|
-
import type { Vehicle } from '
|
|
5
|
-
import type { Driver } from '
|
|
6
|
-
import type { Node } from '
|
|
7
|
-
import type { Geofence } from '
|
|
8
|
-
import type { OperationsLocation } from '
|
|
1
|
+
import type { SGERPClient } from '../client';
|
|
2
|
+
import type { Simulation } from '../types/simulation/simulation';
|
|
3
|
+
import type { Booking } from '../types/simulation/booking';
|
|
4
|
+
import type { Vehicle } from '../types/simulation/vehicle';
|
|
5
|
+
import type { Driver } from '../types/simulation/driver';
|
|
6
|
+
import type { Node } from '../types/simulation/node';
|
|
7
|
+
import type { Geofence } from '../types/simulation/geofence';
|
|
8
|
+
import type { OperationsLocation } from '../types/simulation/operationslocation';
|
|
9
9
|
/**
|
|
10
10
|
* Fetch vehicles for a simulation
|
|
11
11
|
* Uses fetchAll() to get all vehicles regardless of count
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchUtils.d.ts","sourceRoot":"","sources":["../../../sgerplib/sgerp/simulation-logic/fetchUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"fetchUtils.d.ts","sourceRoot":"","sources":["../../../sgerplib/sgerp/simulation-logic/fetchUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAIjF;;;GAGG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,WAAW,EAChB,Y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;;;;GAwBrC"}
|
|
@@ -9,7 +9,7 @@ exports.fetchOperationsLocationsByProject = fetchOperationsLocationsByProject;
|
|
|
9
9
|
exports.fetchGeofences = fetchGeofences;
|
|
10
10
|
exports.fetchSimulationGeofence = fetchSimulationGeofence;
|
|
11
11
|
exports.fetchSimulationData = fetchSimulationData;
|
|
12
|
-
const client_1 = require("
|
|
12
|
+
const client_1 = require("../api/client");
|
|
13
13
|
/**
|
|
14
14
|
* Fetch vehicles for a simulation
|
|
15
15
|
* Uses fetchAll() to get all vehicles regardless of count
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manualEditUtils.d.ts","sourceRoot":"","sources":["../../../sgerplib/sgerp/simulation-logic/manualEditUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"manualEditUtils.d.ts","sourceRoot":"","sources":["../../../sgerplib/sgerp/simulation-logic/manualEditUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,MAAM,EAAE;QACN,WAAW,EAAE,2BAA2B,CAAC;QACzC,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,KAAK,EAAE,MAAM,EAAE,CAAA;SAAE,CAAC,CAAC;QACvD,mBAAmB,CAAC,EAAE,OAAO,CAAC;KAC/B,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,CAAC,cAAc,EAAE,MAAM,GAAG;QACxB,KAAK,EAAE,MAAM,EAAE,CAAC;KACjB,CAAC;CACH;AAED;;;;;;;GAOG;AACH,wBAAsB,uBAAuB,CAC3C,YAAY,EAAE,MAAM,GAAG,MAAM,EAC7B,eAAe,EAAE,eAAe,EAChC,OAAO,GAAE;IACP,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;CACjB,GACL,OAAO,CAAC,kBAAkB,CAAC,CAiD7B;AAGD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,GAClC,eAAe,CAajB"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.vehicleComplexRearrange = vehicleComplexRearrange;
|
|
4
4
|
exports.buildVehicleRouteMap = buildVehicleRouteMap;
|
|
5
|
-
const client_1 = require("
|
|
5
|
+
const client_1 = require("../api/client");
|
|
6
6
|
/**
|
|
7
7
|
* Call the Manual Edit API to rearrange vehicle routes
|
|
8
8
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Booking } from '
|
|
2
|
-
import type { Vehicle } from '
|
|
3
|
-
import type { RouteNode } from '
|
|
1
|
+
import type { Booking } from '../types/simulation/booking';
|
|
2
|
+
import type { Vehicle } from '../types/simulation/vehicle';
|
|
3
|
+
import type { RouteNode } from '../utils/routeUtils';
|
|
4
4
|
/**
|
|
5
5
|
* Create index maps for fast lookups
|
|
6
6
|
* Similar to dashviewer's stateIndex
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"referenceUtils.d.ts","sourceRoot":"","sources":["../../../sgerplib/sgerp/simulation-logic/referenceUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"referenceUtils.d.ts","sourceRoot":"","sources":["../../../sgerplib/sgerp/simulation-logic/referenceUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,OAAO,EAAE,EACnB,QAAQ,EAAE,OAAO,EAAE,EACnB,KAAK,EAAE,SAAS,EAAE;;;;EAuBnB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,OAAO,EAAE,EACnB,QAAQ,EAAE,OAAO,EAAE,EACnB,KAAK,EAAE,SAAS,EAAE;;;;;wBAYA,SAAS,EAAE;yBACV,SAAS,EAAE;+BACL,GAAG,CAAC,MAAM,CAAC;gCACV,GAAG,CAAC,MAAM,CAAC;;EA0EtC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Vehicle } from '
|
|
2
|
-
import type { RouteNode } from '
|
|
3
|
-
import { Route } from '
|
|
1
|
+
import type { Vehicle } from '../types/simulation/vehicle';
|
|
2
|
+
import type { RouteNode } from '../utils/routeUtils';
|
|
3
|
+
import { Route } from '../routing';
|
|
4
4
|
/**
|
|
5
5
|
* Calculate OSRM route for a vehicle based on its assigned nodes
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routeCalculationUtils.d.ts","sourceRoot":"","sources":["../../../sgerplib/sgerp/simulation-logic/routeCalculationUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"routeCalculationUtils.d.ts","sourceRoot":"","sources":["../../../sgerplib/sgerp/simulation-logic/routeCalculationUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAiB,KAAK,EAAE,MAAM,YAAY,CAAC;AAElD;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,SAAS,EAAE,EACxB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,CAuCvB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,aAAa,EAAE,SAAS,EAAE,GAAG,SAAS,EACtC,QAAQ,EAAE,SAAS,EAAE,GACpB,OAAO,CAIT"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.calculateVehicleRoute = calculateVehicleRoute;
|
|
4
4
|
exports.hasRouteChanged = hasRouteChanged;
|
|
5
|
-
const routing_1 = require("
|
|
5
|
+
const routing_1 = require("../routing");
|
|
6
6
|
/**
|
|
7
7
|
* Calculate OSRM route for a vehicle based on its assigned nodes
|
|
8
8
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeShiftUtils.d.ts","sourceRoot":"","sources":["../../../sgerplib/sgerp/simulation-logic/timeShiftUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"timeShiftUtils.d.ts","sourceRoot":"","sources":["../../../sgerplib/sgerp/simulation-logic/timeShiftUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAmBrD;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,IAAI,EAAE,EACb,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,GACnB,IAAI,EAAE,CAaR;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS;IAAE,KAAK,EAAE,IAAI,EAAE,CAAA;CAAE,EACjE,SAAS,EAAE,CAAC,EAAE,EACd,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,GACnB,CAAC,EAAE,CAgBL"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Route utility functions adapted from dashviewer
|
|
3
3
|
* Generates waypoint routes from nodes without web workers
|
|
4
4
|
*/
|
|
5
|
-
import type { Node } from '
|
|
5
|
+
import type { Node } from '../types/simulation/node';
|
|
6
6
|
export type RouteNode = Node;
|
|
7
7
|
export interface Waypoint {
|
|
8
8
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routeUtils.d.ts","sourceRoot":"","sources":["../../../sgerplib/sgerp/utils/routeUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"routeUtils.d.ts","sourceRoot":"","sources":["../../../sgerplib/sgerp/utils/routeUtils.ts"],"names":[],"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
|
|
6
|
+
name: string;
|
|
7
|
+
flag: string;
|
|
8
|
+
dialCode: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const COUNTRIES: Country[];
|
|
11
|
+
export declare const POPULAR_COUNTRIES: string[];
|
|
12
|
+
export declare const getCountryByDialCode: (dialCode: string) => Country | undefined;
|
|
13
|
+
export declare const getCountryByCode: (code: string) => Country | undefined;
|
|
14
|
+
export declare const getLocalizedCountryName: (country: Country, getText: (key: string) => string) => string;
|
|
15
|
+
//# sourceMappingURL=countries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"countries.d.ts","sourceRoot":"","sources":["../../sgerplib/utils/countries.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,SAAS,EAAE,OAAO,EAoF9B,CAAC;AAMF,eAAO,MAAM,iBAAiB,UAE7B,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,UAAU,MAAM,KAAG,OAAO,GAAG,SAEjE,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,KAAG,OAAO,GAAG,SAEzD,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,SAAS,OAAO,EAChB,SAAS,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,KAC/B,MAKF,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Comprehensive list of countries with their phone codes and flag emojis
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getLocalizedCountryName = exports.getCountryByCode = exports.getCountryByDialCode = exports.POPULAR_COUNTRIES = exports.COUNTRIES = void 0;
|
|
7
|
+
exports.COUNTRIES = [
|
|
8
|
+
{ code: 'US', name: 'United States', flag: '🇺🇸', dialCode: '+1' },
|
|
9
|
+
{ code: 'CA', name: 'Canada', flag: '🇨🇦', dialCode: '+1' },
|
|
10
|
+
{ code: 'GB', name: 'United Kingdom', flag: '🇬🇧', dialCode: '+44' },
|
|
11
|
+
{ code: 'AU', name: 'Australia', flag: '🇦🇺', dialCode: '+61' },
|
|
12
|
+
{ code: 'NZ', name: 'New Zealand', flag: '🇳🇿', dialCode: '+64' },
|
|
13
|
+
{ code: 'SG', name: 'Singapore', flag: '🇸🇬', dialCode: '+65' },
|
|
14
|
+
{ code: 'MY', name: 'Malaysia', flag: '🇲🇾', dialCode: '+60' },
|
|
15
|
+
{ code: 'TH', name: 'Thailand', flag: '🇹🇭', dialCode: '+66' },
|
|
16
|
+
{ code: 'ID', name: 'Indonesia', flag: '🇮🇩', dialCode: '+62' },
|
|
17
|
+
{ code: 'PH', name: 'Philippines', flag: '🇵🇭', dialCode: '+63' },
|
|
18
|
+
{ code: 'VN', name: 'Vietnam', flag: '🇻🇳', dialCode: '+84' },
|
|
19
|
+
{ code: 'JP', name: 'Japan', flag: '🇯🇵', dialCode: '+81' },
|
|
20
|
+
{ code: 'KR', name: 'South Korea', flag: '🇰🇷', dialCode: '+82' },
|
|
21
|
+
{ code: 'CN', name: 'China', flag: '🇨🇳', dialCode: '+86' },
|
|
22
|
+
{ code: 'HK', name: 'Hong Kong', flag: '🇭🇰', dialCode: '+852' },
|
|
23
|
+
{ code: 'TW', name: 'Taiwan', flag: '🇹🇼', dialCode: '+886' },
|
|
24
|
+
{ code: 'IN', name: 'India', flag: '🇮🇳', dialCode: '+91' },
|
|
25
|
+
{ code: 'PK', name: 'Pakistan', flag: '🇵🇰', dialCode: '+92' },
|
|
26
|
+
{ code: 'BD', name: 'Bangladesh', flag: '🇧🇩', dialCode: '+880' },
|
|
27
|
+
{ code: 'LK', name: 'Sri Lanka', flag: '🇱🇰', dialCode: '+94' },
|
|
28
|
+
{ code: 'AE', name: 'United Arab Emirates', flag: '🇦🇪', dialCode: '+971' },
|
|
29
|
+
{ code: 'SA', name: 'Saudi Arabia', flag: '🇸🇦', dialCode: '+966' },
|
|
30
|
+
{ code: 'IL', name: 'Israel', flag: '🇮🇱', dialCode: '+972' },
|
|
31
|
+
{ code: 'TR', name: 'Turkey', flag: '🇹🇷', dialCode: '+90' },
|
|
32
|
+
{ code: 'RU', name: 'Russia', flag: '🇷🇺', dialCode: '+7' },
|
|
33
|
+
{ code: 'DE', name: 'Germany', flag: '🇩🇪', dialCode: '+49' },
|
|
34
|
+
{ code: 'FR', name: 'France', flag: '🇫🇷', dialCode: '+33' },
|
|
35
|
+
{ code: 'IT', name: 'Italy', flag: '🇮🇹', dialCode: '+39' },
|
|
36
|
+
{ code: 'ES', name: 'Spain', flag: '🇪🇸', dialCode: '+34' },
|
|
37
|
+
{ code: 'PT', name: 'Portugal', flag: '🇵🇹', dialCode: '+351' },
|
|
38
|
+
{ code: 'NL', name: 'Netherlands', flag: '🇳🇱', dialCode: '+31' },
|
|
39
|
+
{ code: 'BE', name: 'Belgium', flag: '🇧🇪', dialCode: '+32' },
|
|
40
|
+
{ code: 'CH', name: 'Switzerland', flag: '🇨🇭', dialCode: '+41' },
|
|
41
|
+
{ code: 'AT', name: 'Austria', flag: '🇦🇹', dialCode: '+43' },
|
|
42
|
+
{ code: 'SE', name: 'Sweden', flag: '🇸🇪', dialCode: '+46' },
|
|
43
|
+
{ code: 'NO', name: 'Norway', flag: '🇳🇴', dialCode: '+47' },
|
|
44
|
+
{ code: 'DK', name: 'Denmark', flag: '🇩🇰', dialCode: '+45' },
|
|
45
|
+
{ code: 'FI', name: 'Finland', flag: '🇫🇮', dialCode: '+358' },
|
|
46
|
+
{ code: 'PL', name: 'Poland', flag: '🇵🇱', dialCode: '+48' },
|
|
47
|
+
{ code: 'CZ', name: 'Czech Republic', flag: '🇨🇿', dialCode: '+420' },
|
|
48
|
+
{ code: 'GR', name: 'Greece', flag: '🇬🇷', dialCode: '+30' },
|
|
49
|
+
{ code: 'IE', name: 'Ireland', flag: '🇮🇪', dialCode: '+353' },
|
|
50
|
+
{ code: 'ZA', name: 'South Africa', flag: '🇿🇦', dialCode: '+27' },
|
|
51
|
+
{ code: 'EG', name: 'Egypt', flag: '🇪🇬', dialCode: '+20' },
|
|
52
|
+
{ code: 'NG', name: 'Nigeria', flag: '🇳🇬', dialCode: '+234' },
|
|
53
|
+
{ code: 'KE', name: 'Kenya', flag: '🇰🇪', dialCode: '+254' },
|
|
54
|
+
{ code: 'BR', name: 'Brazil', flag: '🇧🇷', dialCode: '+55' },
|
|
55
|
+
{ code: 'MX', name: 'Mexico', flag: '🇲🇽', dialCode: '+52' },
|
|
56
|
+
{ code: 'AR', name: 'Argentina', flag: '🇦🇷', dialCode: '+54' },
|
|
57
|
+
{ code: 'CL', name: 'Chile', flag: '🇨🇱', dialCode: '+56' },
|
|
58
|
+
{ code: 'CO', name: 'Colombia', flag: '🇨🇴', dialCode: '+57' },
|
|
59
|
+
{ code: 'PE', name: 'Peru', flag: '🇵🇪', dialCode: '+51' },
|
|
60
|
+
{ code: 'VE', name: 'Venezuela', flag: '🇻🇪', dialCode: '+58' },
|
|
61
|
+
{ code: 'KH', name: 'Cambodia', flag: '🇰🇭', dialCode: '+855' },
|
|
62
|
+
{ code: 'LA', name: 'Laos', flag: '🇱🇦', dialCode: '+856' },
|
|
63
|
+
{ code: 'MM', name: 'Myanmar', flag: '🇲🇲', dialCode: '+95' },
|
|
64
|
+
{ code: 'BN', name: 'Brunei', flag: '🇧🇳', dialCode: '+673' },
|
|
65
|
+
{ code: 'NP', name: 'Nepal', flag: '🇳🇵', dialCode: '+977' },
|
|
66
|
+
{ code: 'MV', name: 'Maldives', flag: '🇲🇻', dialCode: '+960' },
|
|
67
|
+
{ code: 'AF', name: 'Afghanistan', flag: '🇦🇫', dialCode: '+93' },
|
|
68
|
+
{ code: 'IQ', name: 'Iraq', flag: '🇮🇶', dialCode: '+964' },
|
|
69
|
+
{ code: 'IR', name: 'Iran', flag: '🇮🇷', dialCode: '+98' },
|
|
70
|
+
{ code: 'JO', name: 'Jordan', flag: '🇯🇴', dialCode: '+962' },
|
|
71
|
+
{ code: 'KW', name: 'Kuwait', flag: '🇰🇼', dialCode: '+965' },
|
|
72
|
+
{ code: 'LB', name: 'Lebanon', flag: '🇱🇧', dialCode: '+961' },
|
|
73
|
+
{ code: 'OM', name: 'Oman', flag: '🇴🇲', dialCode: '+968' },
|
|
74
|
+
{ code: 'QA', name: 'Qatar', flag: '🇶🇦', dialCode: '+974' },
|
|
75
|
+
{ code: 'BH', name: 'Bahrain', flag: '🇧🇭', dialCode: '+973' },
|
|
76
|
+
{ code: 'UA', name: 'Ukraine', flag: '🇺🇦', dialCode: '+380' },
|
|
77
|
+
{ code: 'RO', name: 'Romania', flag: '🇷🇴', dialCode: '+40' },
|
|
78
|
+
{ code: 'HU', name: 'Hungary', flag: '🇭🇺', dialCode: '+36' },
|
|
79
|
+
{ code: 'BG', name: 'Bulgaria', flag: '🇧🇬', dialCode: '+359' },
|
|
80
|
+
{ code: 'HR', name: 'Croatia', flag: '🇭🇷', dialCode: '+385' },
|
|
81
|
+
{ code: 'RS', name: 'Serbia', flag: '🇷🇸', dialCode: '+381' },
|
|
82
|
+
{ code: 'SI', name: 'Slovenia', flag: '🇸🇮', dialCode: '+386' },
|
|
83
|
+
{ code: 'SK', name: 'Slovakia', flag: '🇸🇰', dialCode: '+421' },
|
|
84
|
+
{ code: 'EE', name: 'Estonia', flag: '🇪🇪', dialCode: '+372' },
|
|
85
|
+
{ code: 'LV', name: 'Latvia', flag: '🇱🇻', dialCode: '+371' },
|
|
86
|
+
{ code: 'LT', name: 'Lithuania', flag: '🇱🇹', dialCode: '+370' },
|
|
87
|
+
{ code: 'IS', name: 'Iceland', flag: '🇮🇸', dialCode: '+354' },
|
|
88
|
+
{ code: 'LU', name: 'Luxembourg', flag: '🇱🇺', dialCode: '+352' },
|
|
89
|
+
{ code: 'MT', name: 'Malta', flag: '🇲🇹', dialCode: '+356' },
|
|
90
|
+
{ code: 'CY', name: 'Cyprus', flag: '🇨🇾', dialCode: '+357' },
|
|
91
|
+
];
|
|
92
|
+
// Sort by name by default
|
|
93
|
+
exports.COUNTRIES.sort((a, b) => a.name.localeCompare(b.name));
|
|
94
|
+
// Popular countries (shown at top)
|
|
95
|
+
exports.POPULAR_COUNTRIES = [
|
|
96
|
+
'US', 'GB', 'SG', 'AU', 'JP', 'CN', 'IN', 'TH', 'MY', 'ID'
|
|
97
|
+
];
|
|
98
|
+
const getCountryByDialCode = (dialCode) => {
|
|
99
|
+
return exports.COUNTRIES.find(c => c.dialCode === dialCode);
|
|
100
|
+
};
|
|
101
|
+
exports.getCountryByDialCode = getCountryByDialCode;
|
|
102
|
+
const getCountryByCode = (code) => {
|
|
103
|
+
return exports.COUNTRIES.find(c => c.code === code);
|
|
104
|
+
};
|
|
105
|
+
exports.getCountryByCode = getCountryByCode;
|
|
106
|
+
const getLocalizedCountryName = (country, getText) => {
|
|
107
|
+
const key = `country.${country.code.toLowerCase()}`;
|
|
108
|
+
const translated = getText(key);
|
|
109
|
+
// If translation key is returned as-is, it means no translation exists, fallback to English name
|
|
110
|
+
return translated === key ? country.name : translated;
|
|
111
|
+
};
|
|
112
|
+
exports.getLocalizedCountryName = getLocalizedCountryName;
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../sgerplib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAA;AAG5C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cn = cn;
|
|
4
|
+
const clsx_1 = require("clsx");
|
|
5
|
+
const tailwind_merge_1 = require("tailwind-merge");
|
|
6
|
+
function cn(...inputs) {
|
|
7
|
+
return (0, tailwind_merge_1.twMerge)((0, clsx_1.clsx)(inputs));
|
|
8
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sgerp-frontend-lib",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "TypeScript/React library for interacting with the SGERP API, providing client SDK, Backbone.js-style Collections, and pre-built React components",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|