@tmlmobilidade/consts 20260411.1243.43 → 20260418.947.46
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/app-configs.d.ts +7 -7
- package/dist/app-configs.js +93 -95
- package/dist/app-routes.d.ts +1 -0
- package/dist/app-routes.js +196 -195
- package/dist/earliest-date.js +1 -1
- package/package.json +5 -2
package/dist/app-configs.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { type Environment } from '@tmlmobilidade/types';
|
|
2
|
-
interface
|
|
2
|
+
interface ModuleConfigGroup {
|
|
3
3
|
api_port: number;
|
|
4
4
|
api_url: string;
|
|
5
5
|
cors_origin: RegExp | string | true;
|
|
6
6
|
frontend_port: null | number;
|
|
7
7
|
frontend_url: null | string;
|
|
8
8
|
}
|
|
9
|
-
declare const
|
|
9
|
+
declare const MODULE_CONFIGS: Record<string, Record<Environment, ModuleConfigGroup>>;
|
|
10
10
|
/**
|
|
11
|
-
* Retrieves the value of a specific property from the
|
|
12
|
-
* @param
|
|
13
|
-
* @param property The property of the
|
|
11
|
+
* Retrieves the value of a specific property from the module configuration for a given module and environment.
|
|
12
|
+
* @param module The module ID.
|
|
13
|
+
* @param property The property of the module configuration to retrieve (e.g., 'api_url', 'frontend_url').
|
|
14
14
|
* @param environment The environment to get the property for. If not provided, it will use the ENVIRONMENT environment variable.
|
|
15
|
-
* @returns The value of the specified property for the given
|
|
15
|
+
* @returns The value of the specified property for the given module and environment.
|
|
16
16
|
*/
|
|
17
|
-
export declare function
|
|
17
|
+
export declare function getModuleConfig<Prop extends keyof ModuleConfigGroup>(module: keyof typeof MODULE_CONFIGS, property: Prop, environment?: Environment): ModuleConfigGroup[Prop];
|
|
18
18
|
export {};
|
package/dist/app-configs.js
CHANGED
|
@@ -1,251 +1,249 @@
|
|
|
1
1
|
/* * */
|
|
2
2
|
import { getCurrentEnvironment } from '@tmlmobilidade/types';
|
|
3
3
|
/* * */
|
|
4
|
-
const
|
|
4
|
+
const DEFAULT_PRD_CONFIG = {
|
|
5
5
|
api_port: 5050,
|
|
6
6
|
cors_origin: new RegExp(`https://go.tmlmobilidade.pt$`),
|
|
7
7
|
frontend_port: 3000,
|
|
8
8
|
};
|
|
9
|
-
const
|
|
9
|
+
const DEFAULT_STG_CONFIG = {
|
|
10
10
|
api_port: 5050,
|
|
11
|
-
cors_origin: new RegExp(`https
|
|
11
|
+
cors_origin: new RegExp(`https://*.go-stg.tmlmobilidade.pt$`),
|
|
12
12
|
frontend_port: 3000,
|
|
13
13
|
};
|
|
14
|
-
const
|
|
14
|
+
const MODULE_CONFIGS = {
|
|
15
15
|
alerts: {
|
|
16
|
-
|
|
16
|
+
dev: {
|
|
17
17
|
api_port: 52001,
|
|
18
18
|
api_url: 'http://localhost:52001',
|
|
19
19
|
cors_origin: true,
|
|
20
20
|
frontend_port: 51001,
|
|
21
21
|
frontend_url: 'http://localhost:51001/alerts',
|
|
22
22
|
},
|
|
23
|
-
|
|
23
|
+
prd: {
|
|
24
24
|
api_url: 'https://go.tmlmobilidade.pt/alerts/api',
|
|
25
25
|
frontend_url: 'https://go.tmlmobilidade.pt/alerts',
|
|
26
|
-
...
|
|
26
|
+
...DEFAULT_PRD_CONFIG,
|
|
27
27
|
},
|
|
28
|
-
|
|
29
|
-
api_url:
|
|
30
|
-
frontend_url:
|
|
31
|
-
...
|
|
28
|
+
stg: {
|
|
29
|
+
api_url: `https://${process.env.ENVIRONMENT || process.env.NEXT_PUBLIC_ENVIRONMENT}.go-stg.tmlmobilidade.pt/alerts/api`,
|
|
30
|
+
frontend_url: `https://${process.env.ENVIRONMENT || process.env.NEXT_PUBLIC_ENVIRONMENT}.go-stg.tmlmobilidade.pt/alerts`,
|
|
31
|
+
...DEFAULT_STG_CONFIG,
|
|
32
32
|
},
|
|
33
33
|
},
|
|
34
34
|
auth: {
|
|
35
|
-
|
|
35
|
+
dev: {
|
|
36
36
|
api_port: 52000,
|
|
37
37
|
api_url: 'http://localhost:52000',
|
|
38
38
|
cors_origin: true,
|
|
39
39
|
frontend_port: 51000,
|
|
40
40
|
frontend_url: 'http://localhost:51000/auth',
|
|
41
41
|
},
|
|
42
|
-
|
|
42
|
+
prd: {
|
|
43
43
|
api_url: 'https://go.tmlmobilidade.pt/auth/api',
|
|
44
44
|
frontend_url: 'https://go.tmlmobilidade.pt/auth',
|
|
45
|
-
...
|
|
45
|
+
...DEFAULT_PRD_CONFIG,
|
|
46
46
|
},
|
|
47
|
-
|
|
48
|
-
api_url:
|
|
49
|
-
frontend_url:
|
|
50
|
-
...
|
|
47
|
+
stg: {
|
|
48
|
+
api_url: `https://${process.env.ENVIRONMENT || process.env.NEXT_PUBLIC_ENVIRONMENT}.go-stg.tmlmobilidade.pt/auth/api`,
|
|
49
|
+
frontend_url: `https://${process.env.ENVIRONMENT || process.env.NEXT_PUBLIC_ENVIRONMENT}.go-stg.tmlmobilidade.pt/auth`,
|
|
50
|
+
...DEFAULT_STG_CONFIG,
|
|
51
51
|
},
|
|
52
52
|
},
|
|
53
53
|
controller: {
|
|
54
|
-
|
|
54
|
+
dev: {
|
|
55
55
|
api_port: 52002,
|
|
56
56
|
api_url: 'http://localhost:52002',
|
|
57
57
|
cors_origin: true,
|
|
58
58
|
frontend_port: 51002,
|
|
59
59
|
frontend_url: 'http://localhost:51002/controller',
|
|
60
60
|
},
|
|
61
|
-
|
|
61
|
+
prd: {
|
|
62
62
|
api_url: 'https://go.tmlmobilidade.pt/controller/api',
|
|
63
63
|
frontend_url: 'https://go.tmlmobilidade.pt/controller',
|
|
64
|
-
...
|
|
64
|
+
...DEFAULT_PRD_CONFIG,
|
|
65
65
|
},
|
|
66
|
-
|
|
67
|
-
api_url:
|
|
68
|
-
frontend_url:
|
|
69
|
-
...
|
|
66
|
+
stg: {
|
|
67
|
+
api_url: `https://${process.env.ENVIRONMENT || process.env.NEXT_PUBLIC_ENVIRONMENT}.go-stg.tmlmobilidade.pt/controller/api`,
|
|
68
|
+
frontend_url: `https://${process.env.ENVIRONMENT || process.env.NEXT_PUBLIC_ENVIRONMENT}.go-stg.tmlmobilidade.pt/controller`,
|
|
69
|
+
...DEFAULT_STG_CONFIG,
|
|
70
70
|
},
|
|
71
71
|
},
|
|
72
72
|
dates: {
|
|
73
|
-
|
|
73
|
+
dev: {
|
|
74
74
|
api_port: 52008,
|
|
75
75
|
api_url: 'http://localhost:52008',
|
|
76
76
|
cors_origin: true,
|
|
77
77
|
frontend_port: 51008,
|
|
78
78
|
frontend_url: 'http://localhost:51008/dates',
|
|
79
79
|
},
|
|
80
|
-
|
|
80
|
+
prd: {
|
|
81
81
|
api_url: 'https://go.tmlmobilidade.pt/dates/api',
|
|
82
82
|
frontend_url: 'https://go.tmlmobilidade.pt/dates',
|
|
83
|
-
...
|
|
83
|
+
...DEFAULT_PRD_CONFIG,
|
|
84
84
|
},
|
|
85
|
-
|
|
86
|
-
api_url:
|
|
87
|
-
frontend_url:
|
|
88
|
-
...
|
|
85
|
+
stg: {
|
|
86
|
+
api_url: `https://${process.env.ENVIRONMENT || process.env.NEXT_PUBLIC_ENVIRONMENT}.go-stg.tmlmobilidade.pt/dates/api`,
|
|
87
|
+
frontend_url: `https://${process.env.ENVIRONMENT || process.env.NEXT_PUBLIC_ENVIRONMENT}.go-stg.tmlmobilidade.pt/dates`,
|
|
88
|
+
...DEFAULT_STG_CONFIG,
|
|
89
89
|
},
|
|
90
90
|
},
|
|
91
91
|
exporter: {
|
|
92
|
-
|
|
92
|
+
dev: {
|
|
93
93
|
api_port: 52007,
|
|
94
94
|
api_url: 'http://localhost:52007',
|
|
95
95
|
cors_origin: true,
|
|
96
96
|
frontend_port: 51007,
|
|
97
97
|
frontend_url: 'http://localhost:51007/exporter',
|
|
98
98
|
},
|
|
99
|
-
|
|
99
|
+
prd: {
|
|
100
100
|
api_url: 'https://go.tmlmobilidade.pt/exporter/api',
|
|
101
101
|
frontend_url: 'https://go.tmlmobilidade.pt/exporter',
|
|
102
|
-
...
|
|
102
|
+
...DEFAULT_PRD_CONFIG,
|
|
103
103
|
},
|
|
104
|
-
|
|
105
|
-
api_url:
|
|
106
|
-
frontend_url:
|
|
107
|
-
...
|
|
104
|
+
stg: {
|
|
105
|
+
api_url: `https://${process.env.ENVIRONMENT || process.env.NEXT_PUBLIC_ENVIRONMENT}.go-stg.tmlmobilidade.pt/exporter/api`,
|
|
106
|
+
frontend_url: `https://${process.env.ENVIRONMENT || process.env.NEXT_PUBLIC_ENVIRONMENT}.go-stg.tmlmobilidade.pt/exporter`,
|
|
107
|
+
...DEFAULT_STG_CONFIG,
|
|
108
108
|
},
|
|
109
109
|
},
|
|
110
110
|
fleet: {
|
|
111
|
-
|
|
111
|
+
dev: {
|
|
112
112
|
api_port: 52009,
|
|
113
113
|
api_url: 'http://localhost:52009',
|
|
114
114
|
cors_origin: true,
|
|
115
115
|
frontend_port: 51009,
|
|
116
116
|
frontend_url: 'http://localhost:51009/fleet',
|
|
117
117
|
},
|
|
118
|
-
|
|
118
|
+
prd: {
|
|
119
119
|
api_url: 'https://go.tmlmobilidade.pt/fleet/api',
|
|
120
120
|
frontend_url: 'https://go.tmlmobilidade.pt/fleet',
|
|
121
|
-
...
|
|
121
|
+
...DEFAULT_PRD_CONFIG,
|
|
122
122
|
},
|
|
123
|
-
|
|
124
|
-
api_url:
|
|
125
|
-
frontend_url:
|
|
126
|
-
...
|
|
123
|
+
stg: {
|
|
124
|
+
api_url: `https://${process.env.ENVIRONMENT || process.env.NEXT_PUBLIC_ENVIRONMENT}.go-stg.tmlmobilidade.pt/fleet/api`,
|
|
125
|
+
frontend_url: `https://${process.env.ENVIRONMENT || process.env.NEXT_PUBLIC_ENVIRONMENT}.go-stg.tmlmobilidade.pt/fleet`,
|
|
126
|
+
...DEFAULT_STG_CONFIG,
|
|
127
127
|
},
|
|
128
128
|
},
|
|
129
129
|
locations: {
|
|
130
|
-
|
|
130
|
+
dev: {
|
|
131
131
|
api_port: 52005,
|
|
132
132
|
api_url: 'http://localhost:52005',
|
|
133
133
|
cors_origin: true,
|
|
134
134
|
frontend_port: 51005,
|
|
135
135
|
frontend_url: 'http://localhost:51005/locations',
|
|
136
136
|
},
|
|
137
|
-
|
|
137
|
+
prd: {
|
|
138
138
|
api_url: 'https://go.tmlmobilidade.pt/locations/api',
|
|
139
139
|
frontend_url: 'https://go.tmlmobilidade.pt/locations',
|
|
140
|
-
...
|
|
140
|
+
...DEFAULT_PRD_CONFIG,
|
|
141
141
|
},
|
|
142
|
-
|
|
143
|
-
api_url:
|
|
144
|
-
frontend_url:
|
|
145
|
-
...
|
|
142
|
+
stg: {
|
|
143
|
+
api_url: `https://${process.env.ENVIRONMENT || process.env.NEXT_PUBLIC_ENVIRONMENT}.go-stg.tmlmobilidade.pt/locations/api`,
|
|
144
|
+
frontend_url: `https://${process.env.ENVIRONMENT || process.env.NEXT_PUBLIC_ENVIRONMENT}.go-stg.tmlmobilidade.pt/locations`,
|
|
145
|
+
...DEFAULT_STG_CONFIG,
|
|
146
146
|
},
|
|
147
147
|
},
|
|
148
148
|
offer: {
|
|
149
|
-
|
|
149
|
+
dev: {
|
|
150
150
|
api_port: 52010,
|
|
151
151
|
api_url: 'http://localhost:52010',
|
|
152
152
|
cors_origin: true,
|
|
153
153
|
frontend_port: 51010,
|
|
154
154
|
frontend_url: 'http://localhost:51010/offer',
|
|
155
155
|
},
|
|
156
|
-
|
|
156
|
+
prd: {
|
|
157
157
|
api_url: 'https://go.tmlmobilidade.pt/offer/api',
|
|
158
158
|
frontend_url: 'https://go.tmlmobilidade.pt/offer',
|
|
159
|
-
...
|
|
159
|
+
...DEFAULT_PRD_CONFIG,
|
|
160
160
|
},
|
|
161
|
-
|
|
162
|
-
api_url:
|
|
163
|
-
frontend_url:
|
|
164
|
-
...
|
|
161
|
+
stg: {
|
|
162
|
+
api_url: `https://${process.env.ENVIRONMENT || process.env.NEXT_PUBLIC_ENVIRONMENT}.go-stg.tmlmobilidade.pt/offer/api`,
|
|
163
|
+
frontend_url: `https://${process.env.ENVIRONMENT || process.env.NEXT_PUBLIC_ENVIRONMENT}.go-stg.tmlmobilidade.pt/offer`,
|
|
164
|
+
...DEFAULT_STG_CONFIG,
|
|
165
165
|
},
|
|
166
166
|
},
|
|
167
167
|
performance: {
|
|
168
|
-
|
|
168
|
+
dev: {
|
|
169
169
|
api_port: 52006,
|
|
170
170
|
api_url: 'http://localhost:52006',
|
|
171
171
|
cors_origin: true,
|
|
172
172
|
frontend_port: 51006,
|
|
173
173
|
frontend_url: 'http://localhost:51006/performance',
|
|
174
174
|
},
|
|
175
|
-
|
|
175
|
+
prd: {
|
|
176
176
|
api_url: 'https://go.tmlmobilidade.pt/performance/api',
|
|
177
177
|
frontend_url: 'https://go.tmlmobilidade.pt/performance',
|
|
178
|
-
...
|
|
178
|
+
...DEFAULT_PRD_CONFIG,
|
|
179
179
|
},
|
|
180
|
-
|
|
181
|
-
api_url:
|
|
182
|
-
frontend_url:
|
|
183
|
-
...
|
|
180
|
+
stg: {
|
|
181
|
+
api_url: `https://${process.env.ENVIRONMENT || process.env.NEXT_PUBLIC_ENVIRONMENT}.go-stg.tmlmobilidade.pt/performance/api`,
|
|
182
|
+
frontend_url: `https://${process.env.ENVIRONMENT || process.env.NEXT_PUBLIC_ENVIRONMENT}.go-stg.tmlmobilidade.pt/performance`,
|
|
183
|
+
...DEFAULT_STG_CONFIG,
|
|
184
184
|
},
|
|
185
185
|
},
|
|
186
186
|
plans: {
|
|
187
|
-
|
|
187
|
+
dev: {
|
|
188
188
|
api_port: 52004,
|
|
189
189
|
api_url: 'http://localhost:52004',
|
|
190
190
|
cors_origin: true,
|
|
191
191
|
frontend_port: 51004,
|
|
192
192
|
frontend_url: 'http://localhost:51004/plans',
|
|
193
193
|
},
|
|
194
|
-
|
|
194
|
+
prd: {
|
|
195
195
|
api_url: 'https://go.tmlmobilidade.pt/plans/api',
|
|
196
196
|
frontend_url: 'https://go.tmlmobilidade.pt/plans',
|
|
197
|
-
...
|
|
197
|
+
...DEFAULT_PRD_CONFIG,
|
|
198
198
|
},
|
|
199
|
-
|
|
200
|
-
api_url:
|
|
201
|
-
frontend_url:
|
|
202
|
-
...
|
|
199
|
+
stg: {
|
|
200
|
+
api_url: `https://${process.env.ENVIRONMENT || process.env.NEXT_PUBLIC_ENVIRONMENT}.go-stg.tmlmobilidade.pt/plans/api`,
|
|
201
|
+
frontend_url: `https://${process.env.ENVIRONMENT || process.env.NEXT_PUBLIC_ENVIRONMENT}.go-stg.tmlmobilidade.pt/plans`,
|
|
202
|
+
...DEFAULT_STG_CONFIG,
|
|
203
203
|
},
|
|
204
204
|
},
|
|
205
205
|
stops: {
|
|
206
|
-
|
|
206
|
+
dev: {
|
|
207
207
|
api_port: 52003,
|
|
208
208
|
api_url: 'http://localhost:52003',
|
|
209
209
|
cors_origin: true,
|
|
210
210
|
frontend_port: 51003,
|
|
211
211
|
frontend_url: 'http://localhost:51003/stops',
|
|
212
212
|
},
|
|
213
|
-
|
|
213
|
+
prd: {
|
|
214
214
|
api_url: 'https://go.tmlmobilidade.pt/stops/api',
|
|
215
215
|
frontend_url: 'https://go.tmlmobilidade.pt/stops',
|
|
216
|
-
...
|
|
216
|
+
...DEFAULT_PRD_CONFIG,
|
|
217
217
|
},
|
|
218
|
-
|
|
219
|
-
api_url:
|
|
220
|
-
frontend_url:
|
|
221
|
-
...
|
|
218
|
+
stg: {
|
|
219
|
+
api_url: `https://${process.env.ENVIRONMENT || process.env.NEXT_PUBLIC_ENVIRONMENT}.go-stg.tmlmobilidade.pt/stops/api`,
|
|
220
|
+
frontend_url: `https://${process.env.ENVIRONMENT || process.env.NEXT_PUBLIC_ENVIRONMENT}.go-stg.tmlmobilidade.pt/stops`,
|
|
221
|
+
...DEFAULT_STG_CONFIG,
|
|
222
222
|
},
|
|
223
223
|
},
|
|
224
224
|
};
|
|
225
225
|
/* * */
|
|
226
226
|
/**
|
|
227
|
-
* Retrieves the value of a specific property from the
|
|
228
|
-
* @param
|
|
229
|
-
* @param property The property of the
|
|
227
|
+
* Retrieves the value of a specific property from the module configuration for a given module and environment.
|
|
228
|
+
* @param module The module ID.
|
|
229
|
+
* @param property The property of the module configuration to retrieve (e.g., 'api_url', 'frontend_url').
|
|
230
230
|
* @param environment The environment to get the property for. If not provided, it will use the ENVIRONMENT environment variable.
|
|
231
|
-
* @returns The value of the specified property for the given
|
|
231
|
+
* @returns The value of the specified property for the given module and environment.
|
|
232
232
|
*/
|
|
233
|
-
export function
|
|
234
|
-
// Get the desired
|
|
235
|
-
const
|
|
236
|
-
if (!
|
|
237
|
-
throw new Error(`[@core/lib]
|
|
238
|
-
// Extract the current
|
|
233
|
+
export function getModuleConfig(module, property, environment) {
|
|
234
|
+
// Get the desired module object
|
|
235
|
+
const moduleObject = MODULE_CONFIGS[module];
|
|
236
|
+
if (!moduleObject)
|
|
237
|
+
throw new Error(`[@core/lib] Module Config Object for "${module}" module not found. Available modules: ${Object.keys(MODULE_CONFIGS).join(', ')}`);
|
|
238
|
+
// Extract the current module environment either from the parameter
|
|
239
239
|
// or automatically from the set environment variable.
|
|
240
240
|
const currentEnvironment = environment || getCurrentEnvironment();
|
|
241
241
|
// Get the config group for the current environment
|
|
242
|
-
const configGroupForEnvironment =
|
|
243
|
-
if (!configGroupForEnvironment)
|
|
244
|
-
throw new Error(`[@core/lib] AppConfig group for app "${app}" in environment "${currentEnvironment}" environment not found. Available environments: ${Object.keys(appObject).join(', ')}`);
|
|
242
|
+
const configGroupForEnvironment = moduleObject[currentEnvironment] || moduleObject['stg'];
|
|
245
243
|
// Get the property value from the config group
|
|
246
244
|
const propertyValue = configGroupForEnvironment[property];
|
|
247
245
|
if (propertyValue === undefined)
|
|
248
|
-
throw new Error(`[@core/lib] Property "${property}" for
|
|
246
|
+
throw new Error(`[@core/lib] Property "${property}" for module "${module}" in environment "${currentEnvironment}" not found. Available properties: ${Object.keys(configGroupForEnvironment).join(', ')}`);
|
|
249
247
|
// Return the value
|
|
250
248
|
return propertyValue;
|
|
251
249
|
}
|
package/dist/app-routes.d.ts
CHANGED
|
@@ -238,5 +238,6 @@ export declare const API_ROUTES: Readonly<{
|
|
|
238
238
|
readonly STOPS_DETAIL: (id: string) => string;
|
|
239
239
|
readonly STOPS_DETAIL_LOCK: (id: string) => string;
|
|
240
240
|
readonly STOPS_LIST: `${string}/stops`;
|
|
241
|
+
readonly STOPS_VALID_ID: `${string}/stops/valid-id`;
|
|
241
242
|
};
|
|
242
243
|
}>;
|
package/dist/app-routes.js
CHANGED
|
@@ -2,141 +2,141 @@
|
|
|
2
2
|
* This file is auto-generated by the generate-routes.sh script.
|
|
3
3
|
* Do not edit this file manually.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { getModuleConfig } from './app-configs.js';
|
|
6
6
|
/* * */
|
|
7
7
|
export const PAGE_ROUTES = Object.freeze({
|
|
8
8
|
/* * */
|
|
9
9
|
/* ALERTS */
|
|
10
10
|
alerts: {
|
|
11
11
|
// BASE
|
|
12
|
-
BASE: `${
|
|
12
|
+
BASE: `${getModuleConfig('alerts', 'frontend_url')}`,
|
|
13
13
|
// ALERTS
|
|
14
|
-
ALERTS_DETAIL: (id) => `${
|
|
15
|
-
ALERTS_LIST: `${
|
|
14
|
+
ALERTS_DETAIL: (id) => `${getModuleConfig('alerts', 'frontend_url')}/${id}`,
|
|
15
|
+
ALERTS_LIST: `${getModuleConfig('alerts', 'frontend_url')}`,
|
|
16
16
|
},
|
|
17
17
|
/* * */
|
|
18
18
|
/* AUTH */
|
|
19
19
|
auth: {
|
|
20
20
|
// BASE
|
|
21
|
-
BASE: `${
|
|
21
|
+
BASE: `${getModuleConfig('auth', 'frontend_url')}`,
|
|
22
22
|
// AGENCIES
|
|
23
|
-
AGENCIES_DETAIL: (id) => `${
|
|
24
|
-
AGENCIES_LIST: `${
|
|
23
|
+
AGENCIES_DETAIL: (id) => `${getModuleConfig('auth', 'frontend_url')}/agencies/${id}`,
|
|
24
|
+
AGENCIES_LIST: `${getModuleConfig('auth', 'frontend_url')}/agencies`,
|
|
25
25
|
// CHANGE_PASSWORD
|
|
26
|
-
CHANGE_PASSWORD_LIST: `${
|
|
26
|
+
CHANGE_PASSWORD_LIST: `${getModuleConfig('auth', 'frontend_url')}/change-password`,
|
|
27
27
|
// HOME
|
|
28
|
-
HOME_DETAIL: (id) => `${
|
|
29
|
-
HOME_LIST: `${
|
|
28
|
+
HOME_DETAIL: (id) => `${getModuleConfig('auth', 'frontend_url')}/home/${id}`,
|
|
29
|
+
HOME_LIST: `${getModuleConfig('auth', 'frontend_url')}/home`,
|
|
30
30
|
// LOGIN
|
|
31
|
-
LOGIN_LIST: `${
|
|
31
|
+
LOGIN_LIST: `${getModuleConfig('auth', 'frontend_url')}/login`,
|
|
32
32
|
// ORGANIZATIONS
|
|
33
|
-
ORGANIZATIONS_DETAIL: (id) => `${
|
|
34
|
-
ORGANIZATIONS_LIST: `${
|
|
33
|
+
ORGANIZATIONS_DETAIL: (id) => `${getModuleConfig('auth', 'frontend_url')}/organizations/${id}`,
|
|
34
|
+
ORGANIZATIONS_LIST: `${getModuleConfig('auth', 'frontend_url')}/organizations`,
|
|
35
35
|
// RESET_PASSWORD
|
|
36
|
-
RESET_PASSWORD_LIST: `${
|
|
36
|
+
RESET_PASSWORD_LIST: `${getModuleConfig('auth', 'frontend_url')}/reset-password`,
|
|
37
37
|
// ROLES
|
|
38
|
-
ROLES_DETAIL: (id) => `${
|
|
39
|
-
ROLES_LIST: `${
|
|
38
|
+
ROLES_DETAIL: (id) => `${getModuleConfig('auth', 'frontend_url')}/roles/${id}`,
|
|
39
|
+
ROLES_LIST: `${getModuleConfig('auth', 'frontend_url')}/roles`,
|
|
40
40
|
// USERS
|
|
41
|
-
USERS_DETAIL: (id) => `${
|
|
42
|
-
USERS_LIST: `${
|
|
41
|
+
USERS_DETAIL: (id) => `${getModuleConfig('auth', 'frontend_url')}/users/${id}`,
|
|
42
|
+
USERS_LIST: `${getModuleConfig('auth', 'frontend_url')}/users`,
|
|
43
43
|
},
|
|
44
44
|
/* * */
|
|
45
45
|
/* CONTROLLER */
|
|
46
46
|
controller: {
|
|
47
47
|
// BASE
|
|
48
|
-
BASE: `${
|
|
48
|
+
BASE: `${getModuleConfig('controller', 'frontend_url')}`,
|
|
49
49
|
// RIDES
|
|
50
|
-
RIDES_DETAIL: (id) => `${
|
|
51
|
-
RIDES_LIST: `${
|
|
50
|
+
RIDES_DETAIL: (id) => `${getModuleConfig('controller', 'frontend_url')}/rides/${id}`,
|
|
51
|
+
RIDES_LIST: `${getModuleConfig('controller', 'frontend_url')}/rides`,
|
|
52
52
|
},
|
|
53
53
|
/* * */
|
|
54
54
|
/* DATES */
|
|
55
55
|
dates: {
|
|
56
56
|
// BASE
|
|
57
|
-
BASE: `${
|
|
57
|
+
BASE: `${getModuleConfig('dates', 'frontend_url')}`,
|
|
58
58
|
// ANNOTATIONS
|
|
59
|
-
ANNOTATIONS_DETAIL: (id) => `${
|
|
60
|
-
ANNOTATIONS_LIST: `${
|
|
59
|
+
ANNOTATIONS_DETAIL: (id) => `${getModuleConfig('dates', 'frontend_url')}/annotations/${id}`,
|
|
60
|
+
ANNOTATIONS_LIST: `${getModuleConfig('dates', 'frontend_url')}/annotations`,
|
|
61
61
|
// CALENDAR
|
|
62
|
-
CALENDAR_LIST: `${
|
|
62
|
+
CALENDAR_LIST: `${getModuleConfig('dates', 'frontend_url')}/calendar`,
|
|
63
63
|
// EVENTS
|
|
64
|
-
EVENTS_DETAIL: (id) => `${
|
|
65
|
-
EVENTS_LIST: `${
|
|
64
|
+
EVENTS_DETAIL: (id) => `${getModuleConfig('dates', 'frontend_url')}/events/${id}`,
|
|
65
|
+
EVENTS_LIST: `${getModuleConfig('dates', 'frontend_url')}/events`,
|
|
66
66
|
// HOLIDAYS
|
|
67
|
-
HOLIDAYS_DETAIL: (id) => `${
|
|
68
|
-
HOLIDAYS_LIST: `${
|
|
67
|
+
HOLIDAYS_DETAIL: (id) => `${getModuleConfig('dates', 'frontend_url')}/holidays/${id}`,
|
|
68
|
+
HOLIDAYS_LIST: `${getModuleConfig('dates', 'frontend_url')}/holidays`,
|
|
69
69
|
// YEAR_PERIODS
|
|
70
|
-
YEAR_PERIODS_DETAIL: (id) => `${
|
|
71
|
-
YEAR_PERIODS_LIST: `${
|
|
70
|
+
YEAR_PERIODS_DETAIL: (id) => `${getModuleConfig('dates', 'frontend_url')}/year-periods/${id}`,
|
|
71
|
+
YEAR_PERIODS_LIST: `${getModuleConfig('dates', 'frontend_url')}/year-periods`,
|
|
72
72
|
},
|
|
73
73
|
/* * */
|
|
74
74
|
/* FLEET */
|
|
75
75
|
fleet: {
|
|
76
76
|
// BASE
|
|
77
|
-
BASE: `${
|
|
77
|
+
BASE: `${getModuleConfig('fleet', 'frontend_url')}`,
|
|
78
78
|
// VEHICLES
|
|
79
|
-
VEHICLES_DETAIL: (id) => `${
|
|
80
|
-
VEHICLES_LIST: `${
|
|
79
|
+
VEHICLES_DETAIL: (id) => `${getModuleConfig('fleet', 'frontend_url')}/vehicles/${id}`,
|
|
80
|
+
VEHICLES_LIST: `${getModuleConfig('fleet', 'frontend_url')}/vehicles`,
|
|
81
81
|
},
|
|
82
82
|
/* * */
|
|
83
83
|
/* OFFER */
|
|
84
84
|
offer: {
|
|
85
85
|
// BASE
|
|
86
|
-
BASE: `${
|
|
86
|
+
BASE: `${getModuleConfig('offer', 'frontend_url')}`,
|
|
87
87
|
// FARES
|
|
88
|
-
FARES_DETAIL: (id) => `${
|
|
89
|
-
FARES_LIST: `${
|
|
88
|
+
FARES_DETAIL: (id) => `${getModuleConfig('offer', 'frontend_url')}/fares/${id}`,
|
|
89
|
+
FARES_LIST: `${getModuleConfig('offer', 'frontend_url')}/fares`,
|
|
90
90
|
// LINES
|
|
91
|
-
LINES_DETAIL: (id) => `${
|
|
92
|
-
LINES_LIST: `${
|
|
91
|
+
LINES_DETAIL: (id) => `${getModuleConfig('offer', 'frontend_url')}/lines/${id}`,
|
|
92
|
+
LINES_LIST: `${getModuleConfig('offer', 'frontend_url')}/lines`,
|
|
93
93
|
// PATTERN
|
|
94
|
-
PATTERN_DETAIL: (id, patternId, routeId) => `${
|
|
94
|
+
PATTERN_DETAIL: (id, patternId, routeId) => `${getModuleConfig('offer', 'frontend_url')}/lines/${id}/${routeId}/${patternId}`,
|
|
95
95
|
// ROUTE
|
|
96
|
-
ROUTE_DETAIL: (id, routeId) => `${
|
|
96
|
+
ROUTE_DETAIL: (id, routeId) => `${getModuleConfig('offer', 'frontend_url')}/lines/${id}/${routeId}`,
|
|
97
97
|
// TYPOLOGIES
|
|
98
|
-
TYPOLOGIES_DETAIL: (id) => `${
|
|
99
|
-
TYPOLOGIES_LIST: `${
|
|
98
|
+
TYPOLOGIES_DETAIL: (id) => `${getModuleConfig('offer', 'frontend_url')}/typologies/${id}`,
|
|
99
|
+
TYPOLOGIES_LIST: `${getModuleConfig('offer', 'frontend_url')}/typologies`,
|
|
100
100
|
// ZONES
|
|
101
|
-
ZONES_DETAIL: (id) => `${
|
|
102
|
-
ZONES_LIST: `${
|
|
101
|
+
ZONES_DETAIL: (id) => `${getModuleConfig('offer', 'frontend_url')}/zones/${id}`,
|
|
102
|
+
ZONES_LIST: `${getModuleConfig('offer', 'frontend_url')}/zones`,
|
|
103
103
|
},
|
|
104
104
|
/* * */
|
|
105
105
|
/* PERFORMANCE */
|
|
106
106
|
performance: {
|
|
107
107
|
// BASE
|
|
108
|
-
BASE: `${
|
|
108
|
+
BASE: `${getModuleConfig('performance', 'frontend_url')}`,
|
|
109
109
|
// AREAS_1
|
|
110
|
-
AREAS_1_LIST: `${
|
|
110
|
+
AREAS_1_LIST: `${getModuleConfig('performance', 'frontend_url')}/areas/1`,
|
|
111
111
|
// AREAS_2
|
|
112
|
-
AREAS_2_LIST: `${
|
|
112
|
+
AREAS_2_LIST: `${getModuleConfig('performance', 'frontend_url')}/areas/2`,
|
|
113
113
|
// DEMAND_DEMAND_BY
|
|
114
|
-
DEMAND_DEMAND_BY_LIST: `${
|
|
114
|
+
DEMAND_DEMAND_BY_LIST: `${getModuleConfig('performance', 'frontend_url')}/demand/demand-by`,
|
|
115
115
|
// DEMAND
|
|
116
|
-
DEMAND_LIST: `${
|
|
116
|
+
DEMAND_LIST: `${getModuleConfig('performance', 'frontend_url')}/demand`,
|
|
117
117
|
// SUPPLY
|
|
118
|
-
SUPPLY_LIST: `${
|
|
118
|
+
SUPPLY_LIST: `${getModuleConfig('performance', 'frontend_url')}/supply`,
|
|
119
119
|
},
|
|
120
120
|
/* * */
|
|
121
121
|
/* PLANS */
|
|
122
122
|
plans: {
|
|
123
123
|
// BASE
|
|
124
|
-
BASE: `${
|
|
124
|
+
BASE: `${getModuleConfig('plans', 'frontend_url')}`,
|
|
125
125
|
// APPROVED
|
|
126
|
-
APPROVED_DETAIL: (id) => `${
|
|
127
|
-
APPROVED_LIST: `${
|
|
126
|
+
APPROVED_DETAIL: (id) => `${getModuleConfig('plans', 'frontend_url')}/approved/${id}`,
|
|
127
|
+
APPROVED_LIST: `${getModuleConfig('plans', 'frontend_url')}/approved`,
|
|
128
128
|
// VALIDATIONS
|
|
129
|
-
VALIDATIONS_DETAIL: (id) => `${
|
|
130
|
-
VALIDATIONS_LIST: `${
|
|
129
|
+
VALIDATIONS_DETAIL: (id) => `${getModuleConfig('plans', 'frontend_url')}/validations/${id}`,
|
|
130
|
+
VALIDATIONS_LIST: `${getModuleConfig('plans', 'frontend_url')}/validations`,
|
|
131
131
|
},
|
|
132
132
|
/* * */
|
|
133
133
|
/* STOPS */
|
|
134
134
|
stops: {
|
|
135
135
|
// BASE
|
|
136
|
-
BASE: `${
|
|
136
|
+
BASE: `${getModuleConfig('stops', 'frontend_url')}`,
|
|
137
137
|
// STOPS
|
|
138
|
-
STOPS_DETAIL: (id) => `${
|
|
139
|
-
STOPS_LIST: `${
|
|
138
|
+
STOPS_DETAIL: (id) => `${getModuleConfig('stops', 'frontend_url')}/${id}`,
|
|
139
|
+
STOPS_LIST: `${getModuleConfig('stops', 'frontend_url')}`,
|
|
140
140
|
},
|
|
141
141
|
});
|
|
142
142
|
export const API_ROUTES = Object.freeze({
|
|
@@ -144,225 +144,226 @@ export const API_ROUTES = Object.freeze({
|
|
|
144
144
|
/* ALERTS */
|
|
145
145
|
alerts: {
|
|
146
146
|
// BASE
|
|
147
|
-
BASE: `${
|
|
147
|
+
BASE: `${getModuleConfig('alerts', 'api_url')}`,
|
|
148
148
|
// ALERTS
|
|
149
|
-
ALERTS_DETAIL: (id) => `${
|
|
150
|
-
ALERTS_DETAIL_IMAGE: (id) => `${
|
|
151
|
-
ALERTS_DETAIL_LOCK: (id) => `${
|
|
152
|
-
ALERTS_LIST: `${
|
|
153
|
-
ALERTS_RSS: `${
|
|
149
|
+
ALERTS_DETAIL: (id) => `${getModuleConfig('alerts', 'api_url')}/alerts/${id}`,
|
|
150
|
+
ALERTS_DETAIL_IMAGE: (id) => `${getModuleConfig('alerts', 'api_url')}/alerts/${id}/image`,
|
|
151
|
+
ALERTS_DETAIL_LOCK: (id) => `${getModuleConfig('alerts', 'api_url')}/alerts/${id}/lock`,
|
|
152
|
+
ALERTS_LIST: `${getModuleConfig('alerts', 'api_url')}/alerts`,
|
|
153
|
+
ALERTS_RSS: `${getModuleConfig('alerts', 'api_url')}/alerts.rss`,
|
|
154
154
|
// GTFS
|
|
155
|
-
GTFS_CARRIS_METROPOLITANA: `${
|
|
155
|
+
GTFS_CARRIS_METROPOLITANA: `${getModuleConfig('alerts', 'api_url')}/gtfs/carris-metropolitana`,
|
|
156
156
|
// RIDES
|
|
157
|
-
RIDES_DETAIL_RIDE: (id) => `${
|
|
158
|
-
RIDES_LIST: `${
|
|
159
|
-
RIDES_WS: `${
|
|
157
|
+
RIDES_DETAIL_RIDE: (id) => `${getModuleConfig('alerts', 'api_url')}/rides/${id}/ride`,
|
|
158
|
+
RIDES_LIST: `${getModuleConfig('alerts', 'api_url')}/rides`,
|
|
159
|
+
RIDES_WS: `${getModuleConfig('alerts', 'api_url')}/rides/ws`,
|
|
160
160
|
},
|
|
161
161
|
/* * */
|
|
162
162
|
/* AUTH */
|
|
163
163
|
auth: {
|
|
164
164
|
// BASE
|
|
165
|
-
BASE: `${
|
|
165
|
+
BASE: `${getModuleConfig('auth', 'api_url')}`,
|
|
166
166
|
// AGENCIES
|
|
167
|
-
AGENCIES_DETAIL: (id) => `${
|
|
168
|
-
AGENCIES_DETAIL_LOCK: (id) => `${
|
|
169
|
-
AGENCIES_LIST: `${
|
|
167
|
+
AGENCIES_DETAIL: (id) => `${getModuleConfig('auth', 'api_url')}/agencies/${id}`,
|
|
168
|
+
AGENCIES_DETAIL_LOCK: (id) => `${getModuleConfig('auth', 'api_url')}/agencies/${id}/lock`,
|
|
169
|
+
AGENCIES_LIST: `${getModuleConfig('auth', 'api_url')}/agencies`,
|
|
170
170
|
// AUTH
|
|
171
|
-
AUTH_CHANGE_PASSWORD: `${
|
|
172
|
-
AUTH_LOGIN: `${
|
|
173
|
-
AUTH_LOGOUT: `${
|
|
174
|
-
AUTH_SEND_PASSWORD_RESET_EMAIL: `${
|
|
171
|
+
AUTH_CHANGE_PASSWORD: `${getModuleConfig('auth', 'api_url')}/auth/change-password`,
|
|
172
|
+
AUTH_LOGIN: `${getModuleConfig('auth', 'api_url')}/auth/login`,
|
|
173
|
+
AUTH_LOGOUT: `${getModuleConfig('auth', 'api_url')}/auth/logout`,
|
|
174
|
+
AUTH_SEND_PASSWORD_RESET_EMAIL: `${getModuleConfig('auth', 'api_url')}/auth/send-password-reset-email`,
|
|
175
175
|
// NOTIFICATIONS
|
|
176
|
-
NOTIFICATIONS_DETAIL: (id) => `${
|
|
177
|
-
NOTIFICATIONS_DETAIL_MARK_AS_READ: (id) => `${
|
|
178
|
-
NOTIFICATIONS_LIST: `${
|
|
176
|
+
NOTIFICATIONS_DETAIL: (id) => `${getModuleConfig('auth', 'api_url')}/notifications/${id}`,
|
|
177
|
+
NOTIFICATIONS_DETAIL_MARK_AS_READ: (id) => `${getModuleConfig('auth', 'api_url')}/notifications/${id}/mark-as-read`,
|
|
178
|
+
NOTIFICATIONS_LIST: `${getModuleConfig('auth', 'api_url')}/notifications`,
|
|
179
179
|
// ORGANIZATIONS
|
|
180
|
-
ORGANIZATIONS_DETAIL: (id) => `${
|
|
181
|
-
ORGANIZATIONS_DETAIL_IMAGE: (id) => `${
|
|
182
|
-
ORGANIZATIONS_DETAIL_LOCK: (id) => `${
|
|
183
|
-
ORGANIZATIONS_DETAIL_LOGO: (id) => `${
|
|
184
|
-
ORGANIZATIONS_DETAIL_VAR_IMAGE: (id, theme) => `${
|
|
185
|
-
ORGANIZATIONS_LIST: `${
|
|
180
|
+
ORGANIZATIONS_DETAIL: (id) => `${getModuleConfig('auth', 'api_url')}/organizations/${id}`,
|
|
181
|
+
ORGANIZATIONS_DETAIL_IMAGE: (id) => `${getModuleConfig('auth', 'api_url')}/organizations/${id}/image`,
|
|
182
|
+
ORGANIZATIONS_DETAIL_LOCK: (id) => `${getModuleConfig('auth', 'api_url')}/organizations/${id}/lock`,
|
|
183
|
+
ORGANIZATIONS_DETAIL_LOGO: (id) => `${getModuleConfig('auth', 'api_url')}/organizations/${id}/logo`,
|
|
184
|
+
ORGANIZATIONS_DETAIL_VAR_IMAGE: (id, theme) => `${getModuleConfig('auth', 'api_url')}/organizations/${id}/${theme}/image`,
|
|
185
|
+
ORGANIZATIONS_LIST: `${getModuleConfig('auth', 'api_url')}/organizations`,
|
|
186
186
|
// PROPOSED-CHANGES
|
|
187
|
-
PROPOSED_CHANGES_DETAIL: (id) => `${
|
|
188
|
-
PROPOSED_CHANGES_LIST: `${
|
|
187
|
+
PROPOSED_CHANGES_DETAIL: (id) => `${getModuleConfig('auth', 'api_url')}/proposed-changes/${id}`,
|
|
188
|
+
PROPOSED_CHANGES_LIST: `${getModuleConfig('auth', 'api_url')}/proposed-changes`,
|
|
189
189
|
// ROLES
|
|
190
|
-
ROLES_DETAIL: (id) => `${
|
|
191
|
-
ROLES_DETAIL_LOCK: (id) => `${
|
|
192
|
-
ROLES_LIST: `${
|
|
190
|
+
ROLES_DETAIL: (id) => `${getModuleConfig('auth', 'api_url')}/roles/${id}`,
|
|
191
|
+
ROLES_DETAIL_LOCK: (id) => `${getModuleConfig('auth', 'api_url')}/roles/${id}/lock`,
|
|
192
|
+
ROLES_LIST: `${getModuleConfig('auth', 'api_url')}/roles`,
|
|
193
193
|
// USERS
|
|
194
|
-
USERS_DETAIL: (id) => `${
|
|
195
|
-
USERS_DETAIL_LOCK: (id) => `${
|
|
196
|
-
USERS_DETAIL_SIMPLIFIED: (id) => `${
|
|
197
|
-
USERS_LIST: `${
|
|
198
|
-
USERS_ME: `${
|
|
194
|
+
USERS_DETAIL: (id) => `${getModuleConfig('auth', 'api_url')}/users/${id}`,
|
|
195
|
+
USERS_DETAIL_LOCK: (id) => `${getModuleConfig('auth', 'api_url')}/users/${id}/lock`,
|
|
196
|
+
USERS_DETAIL_SIMPLIFIED: (id) => `${getModuleConfig('auth', 'api_url')}/users/${id}/simplified`,
|
|
197
|
+
USERS_LIST: `${getModuleConfig('auth', 'api_url')}/users`,
|
|
198
|
+
USERS_ME: `${getModuleConfig('auth', 'api_url')}/users/me`,
|
|
199
199
|
// WIKI
|
|
200
|
-
WIKI_DETAIL: (id) => `${
|
|
201
|
-
WIKI_LIST: `${
|
|
200
|
+
WIKI_DETAIL: (id) => `${getModuleConfig('auth', 'api_url')}/wiki/${id}`,
|
|
201
|
+
WIKI_LIST: `${getModuleConfig('auth', 'api_url')}/wiki`,
|
|
202
202
|
},
|
|
203
203
|
/* * */
|
|
204
204
|
/* CONTROLLER */
|
|
205
205
|
controller: {
|
|
206
206
|
// BASE
|
|
207
|
-
BASE: `${
|
|
207
|
+
BASE: `${getModuleConfig('controller', 'api_url')}`,
|
|
208
208
|
// RIDE-ACCEPTANCE
|
|
209
|
-
ACCEPTANCE_CHANGE_STATUS: (id) => `${
|
|
210
|
-
ACCEPTANCE_COMMENT: (id) => `${
|
|
211
|
-
ACCEPTANCE_DETAIL: (id) => `${
|
|
212
|
-
ACCEPTANCE_JUSTIFY: (id) => `${
|
|
213
|
-
ACCEPTANCE_LOCK: (id) => `${
|
|
209
|
+
ACCEPTANCE_CHANGE_STATUS: (id) => `${getModuleConfig('controller', 'api_url')}/rides/${id}/acceptance/change-status`,
|
|
210
|
+
ACCEPTANCE_COMMENT: (id) => `${getModuleConfig('controller', 'api_url')}/rides/${id}/acceptance/comment`,
|
|
211
|
+
ACCEPTANCE_DETAIL: (id) => `${getModuleConfig('controller', 'api_url')}/rides/${id}/acceptance`,
|
|
212
|
+
ACCEPTANCE_JUSTIFY: (id) => `${getModuleConfig('controller', 'api_url')}/rides/${id}/acceptance/justify`,
|
|
213
|
+
ACCEPTANCE_LOCK: (id) => `${getModuleConfig('controller', 'api_url')}/rides/${id}/acceptance/lock`,
|
|
214
214
|
// RIDES
|
|
215
|
-
RIDES_DETAIL_HASHED_SHAPE: (id) => `${
|
|
216
|
-
RIDES_DETAIL_HASHED_TRIP: (id) => `${
|
|
217
|
-
RIDES_DETAIL_REPROCESS: (id) => `${
|
|
218
|
-
RIDES_DETAIL_RIDE: (id) => `${
|
|
219
|
-
RIDES_DETAIL_SIMPLIFIED_APEX_LOCATIONS: (id) => `${
|
|
220
|
-
RIDES_DETAIL_SIMPLIFIED_APEX_ON_BOARD_REFUNDS: (id) => `${
|
|
221
|
-
RIDES_DETAIL_SIMPLIFIED_APEX_ON_BOARD_SALES: (id) => `${
|
|
222
|
-
RIDES_DETAIL_SIMPLIFIED_APEX_VALIDATIONS: (id) => `${
|
|
223
|
-
RIDES_DETAIL_VEHICLE_EVENTS: (id) => `${
|
|
224
|
-
RIDES_FAVORITES: `${
|
|
225
|
-
RIDES_LIST: `${
|
|
226
|
-
RIDES_WS: `${
|
|
215
|
+
RIDES_DETAIL_HASHED_SHAPE: (id) => `${getModuleConfig('controller', 'api_url')}/rides/${id}/hashed-shape`,
|
|
216
|
+
RIDES_DETAIL_HASHED_TRIP: (id) => `${getModuleConfig('controller', 'api_url')}/rides/${id}/hashed-trip`,
|
|
217
|
+
RIDES_DETAIL_REPROCESS: (id) => `${getModuleConfig('controller', 'api_url')}/rides/${id}/reprocess`,
|
|
218
|
+
RIDES_DETAIL_RIDE: (id) => `${getModuleConfig('controller', 'api_url')}/rides/${id}/ride`,
|
|
219
|
+
RIDES_DETAIL_SIMPLIFIED_APEX_LOCATIONS: (id) => `${getModuleConfig('controller', 'api_url')}/rides/${id}/simplified-apex-locations`,
|
|
220
|
+
RIDES_DETAIL_SIMPLIFIED_APEX_ON_BOARD_REFUNDS: (id) => `${getModuleConfig('controller', 'api_url')}/rides/${id}/simplified-apex-on-board-refunds`,
|
|
221
|
+
RIDES_DETAIL_SIMPLIFIED_APEX_ON_BOARD_SALES: (id) => `${getModuleConfig('controller', 'api_url')}/rides/${id}/simplified-apex-on-board-sales`,
|
|
222
|
+
RIDES_DETAIL_SIMPLIFIED_APEX_VALIDATIONS: (id) => `${getModuleConfig('controller', 'api_url')}/rides/${id}/simplified-apex-validations`,
|
|
223
|
+
RIDES_DETAIL_VEHICLE_EVENTS: (id) => `${getModuleConfig('controller', 'api_url')}/rides/${id}/vehicle-events`,
|
|
224
|
+
RIDES_FAVORITES: `${getModuleConfig('controller', 'api_url')}/rides/favorites`,
|
|
225
|
+
RIDES_LIST: `${getModuleConfig('controller', 'api_url')}/rides`,
|
|
226
|
+
RIDES_WS: `${getModuleConfig('controller', 'api_url')}/rides/ws`,
|
|
227
227
|
},
|
|
228
228
|
/* * */
|
|
229
229
|
/* DATES */
|
|
230
230
|
dates: {
|
|
231
231
|
// BASE
|
|
232
|
-
BASE: `${
|
|
232
|
+
BASE: `${getModuleConfig('dates', 'api_url')}`,
|
|
233
233
|
// ANNOTATIONS
|
|
234
|
-
ANNOTATIONS_DETAIL: (id) => `${
|
|
235
|
-
ANNOTATIONS_DETAIL_LOCK: (id) => `${
|
|
236
|
-
ANNOTATIONS_LIST: `${
|
|
234
|
+
ANNOTATIONS_DETAIL: (id) => `${getModuleConfig('dates', 'api_url')}/annotations/${id}`,
|
|
235
|
+
ANNOTATIONS_DETAIL_LOCK: (id) => `${getModuleConfig('dates', 'api_url')}/annotations/${id}/lock`,
|
|
236
|
+
ANNOTATIONS_LIST: `${getModuleConfig('dates', 'api_url')}/annotations`,
|
|
237
237
|
// EVENTS
|
|
238
|
-
EVENTS_DETAIL: (id) => `${
|
|
239
|
-
EVENTS_DETAIL_LOCK: (id) => `${
|
|
240
|
-
EVENTS_LIST: `${
|
|
238
|
+
EVENTS_DETAIL: (id) => `${getModuleConfig('dates', 'api_url')}/events/${id}`,
|
|
239
|
+
EVENTS_DETAIL_LOCK: (id) => `${getModuleConfig('dates', 'api_url')}/events/${id}/lock`,
|
|
240
|
+
EVENTS_LIST: `${getModuleConfig('dates', 'api_url')}/events`,
|
|
241
241
|
// HOLIDAYS
|
|
242
|
-
HOLIDAYS_DETAIL: (id) => `${
|
|
243
|
-
HOLIDAYS_DETAIL_LOCK: (id) => `${
|
|
244
|
-
HOLIDAYS_LIST: `${
|
|
242
|
+
HOLIDAYS_DETAIL: (id) => `${getModuleConfig('dates', 'api_url')}/holidays/${id}`,
|
|
243
|
+
HOLIDAYS_DETAIL_LOCK: (id) => `${getModuleConfig('dates', 'api_url')}/holidays/${id}/lock`,
|
|
244
|
+
HOLIDAYS_LIST: `${getModuleConfig('dates', 'api_url')}/holidays`,
|
|
245
245
|
// YEAR-PERIODS
|
|
246
|
-
YEAR_PERIODS_CHECK_CONFLICTS: `${
|
|
247
|
-
YEAR_PERIODS_DETAIL: (id) => `${
|
|
248
|
-
YEAR_PERIODS_DETAIL_LOCK: (id) => `${
|
|
249
|
-
YEAR_PERIODS_LIST: `${
|
|
246
|
+
YEAR_PERIODS_CHECK_CONFLICTS: `${getModuleConfig('dates', 'api_url')}/year-periods/check-conflicts`,
|
|
247
|
+
YEAR_PERIODS_DETAIL: (id) => `${getModuleConfig('dates', 'api_url')}/year-periods/${id}`,
|
|
248
|
+
YEAR_PERIODS_DETAIL_LOCK: (id) => `${getModuleConfig('dates', 'api_url')}/year-periods/${id}/lock`,
|
|
249
|
+
YEAR_PERIODS_LIST: `${getModuleConfig('dates', 'api_url')}/year-periods`,
|
|
250
250
|
},
|
|
251
251
|
/* * */
|
|
252
252
|
/* EXPORTER */
|
|
253
253
|
exporter: {
|
|
254
254
|
// BASE
|
|
255
|
-
BASE: `${
|
|
255
|
+
BASE: `${getModuleConfig('exporter', 'api_url')}`,
|
|
256
256
|
// EXPORTER
|
|
257
|
-
EXPORTER_DETAIL_DOWNLOAD: (id) => `${
|
|
258
|
-
EXPORTER_LIST: `${
|
|
257
|
+
EXPORTER_DETAIL_DOWNLOAD: (id) => `${getModuleConfig('exporter', 'api_url')}/exporter/${id}/download`,
|
|
258
|
+
EXPORTER_LIST: `${getModuleConfig('exporter', 'api_url')}/exporter`,
|
|
259
259
|
// GTFS-MERGED
|
|
260
|
-
GTFS_MERGED_DOWNLOAD: `${
|
|
260
|
+
GTFS_MERGED_DOWNLOAD: `${getModuleConfig('exporter', 'api_url')}/gtfs-merged/download`,
|
|
261
261
|
},
|
|
262
262
|
/* * */
|
|
263
263
|
/* FLEET */
|
|
264
264
|
fleet: {
|
|
265
265
|
// BASE
|
|
266
|
-
BASE: `${
|
|
266
|
+
BASE: `${getModuleConfig('fleet', 'api_url')}`,
|
|
267
267
|
// VEHICLES
|
|
268
|
-
VEHICLES_DETAIL: (id) => `${
|
|
269
|
-
VEHICLES_DETAIL_LAST_EVENT: (id) => `${
|
|
270
|
-
VEHICLES_DETAIL_LOCK: (id) => `${
|
|
271
|
-
VEHICLES_LIST: `${
|
|
272
|
-
VEHICLES_POSITIONS: `${
|
|
268
|
+
VEHICLES_DETAIL: (id) => `${getModuleConfig('fleet', 'api_url')}/vehicles/${id}`,
|
|
269
|
+
VEHICLES_DETAIL_LAST_EVENT: (id) => `${getModuleConfig('fleet', 'api_url')}/vehicles/${id}/last-event`,
|
|
270
|
+
VEHICLES_DETAIL_LOCK: (id) => `${getModuleConfig('fleet', 'api_url')}/vehicles/${id}/lock`,
|
|
271
|
+
VEHICLES_LIST: `${getModuleConfig('fleet', 'api_url')}/vehicles`,
|
|
272
|
+
VEHICLES_POSITIONS: `${getModuleConfig('fleet', 'api_url')}/vehicles/positions`,
|
|
273
273
|
},
|
|
274
274
|
/* * */
|
|
275
275
|
/* LOCATIONS */
|
|
276
276
|
locations: {
|
|
277
277
|
// BASE
|
|
278
|
-
BASE: `${
|
|
278
|
+
BASE: `${getModuleConfig('locations', 'api_url')}`,
|
|
279
279
|
// LOCATIONS
|
|
280
|
-
LOCATIONS_COORDINATES: `${
|
|
281
|
-
LOCATIONS_DISTRICTS: `${
|
|
282
|
-
LOCATIONS_LOCALITIES: `${
|
|
283
|
-
LOCATIONS_MUNICIPALITIES: `${
|
|
284
|
-
LOCATIONS_PARISHES: `${
|
|
280
|
+
LOCATIONS_COORDINATES: `${getModuleConfig('locations', 'api_url')}/locations/coordinates`,
|
|
281
|
+
LOCATIONS_DISTRICTS: `${getModuleConfig('locations', 'api_url')}/locations/districts`,
|
|
282
|
+
LOCATIONS_LOCALITIES: `${getModuleConfig('locations', 'api_url')}/locations/localities`,
|
|
283
|
+
LOCATIONS_MUNICIPALITIES: `${getModuleConfig('locations', 'api_url')}/locations/municipalities`,
|
|
284
|
+
LOCATIONS_PARISHES: `${getModuleConfig('locations', 'api_url')}/locations/parishes`,
|
|
285
285
|
},
|
|
286
286
|
/* * */
|
|
287
287
|
/* OFFER */
|
|
288
288
|
offer: {
|
|
289
289
|
// BASE
|
|
290
|
-
BASE: `${
|
|
290
|
+
BASE: `${getModuleConfig('offer', 'api_url')}`,
|
|
291
291
|
// FARES
|
|
292
|
-
FARES_DETAIL: (id) => `${
|
|
293
|
-
FARES_DETAIL_LOCK: (id) => `${
|
|
294
|
-
FARES_LIST: `${
|
|
292
|
+
FARES_DETAIL: (id) => `${getModuleConfig('offer', 'api_url')}/fares/${id}`,
|
|
293
|
+
FARES_DETAIL_LOCK: (id) => `${getModuleConfig('offer', 'api_url')}/fares/${id}/lock`,
|
|
294
|
+
FARES_LIST: `${getModuleConfig('offer', 'api_url')}/fares`,
|
|
295
295
|
// GTFS
|
|
296
|
-
GTFS_CREATE_EXPORT: `${
|
|
297
|
-
GTFS_PARSE: `${
|
|
296
|
+
GTFS_CREATE_EXPORT: `${getModuleConfig('offer', 'api_url')}/gtfs/create-export`,
|
|
297
|
+
GTFS_PARSE: `${getModuleConfig('offer', 'api_url')}/gtfs/parse`,
|
|
298
298
|
// LINES
|
|
299
|
-
LINES_DETAIL: (id) => `${
|
|
300
|
-
LINES_DETAIL_LOCK: (id) => `${
|
|
301
|
-
LINES_LIST: `${
|
|
299
|
+
LINES_DETAIL: (id) => `${getModuleConfig('offer', 'api_url')}/lines/${id}`,
|
|
300
|
+
LINES_DETAIL_LOCK: (id) => `${getModuleConfig('offer', 'api_url')}/lines/${id}/lock`,
|
|
301
|
+
LINES_LIST: `${getModuleConfig('offer', 'api_url')}/lines`,
|
|
302
302
|
// PATTERNS
|
|
303
|
-
PATTERNS_DETAIL: (id) => `${
|
|
304
|
-
PATTERNS_DETAIL_COMMENT: (id) => `${
|
|
305
|
-
PATTERNS_DETAIL_IMPORT_GTFS: (id) => `${
|
|
306
|
-
PATTERNS_DETAIL_LOCK: (id) => `${
|
|
307
|
-
PATTERNS_LIST: `${
|
|
303
|
+
PATTERNS_DETAIL: (id) => `${getModuleConfig('offer', 'api_url')}/patterns/${id}`,
|
|
304
|
+
PATTERNS_DETAIL_COMMENT: (id) => `${getModuleConfig('offer', 'api_url')}/patterns/${id}/comment`,
|
|
305
|
+
PATTERNS_DETAIL_IMPORT_GTFS: (id) => `${getModuleConfig('offer', 'api_url')}/patterns/${id}/import-gtfs`,
|
|
306
|
+
PATTERNS_DETAIL_LOCK: (id) => `${getModuleConfig('offer', 'api_url')}/patterns/${id}/lock`,
|
|
307
|
+
PATTERNS_LIST: `${getModuleConfig('offer', 'api_url')}/patterns`,
|
|
308
308
|
// ROUTES
|
|
309
|
-
ROUTES_DETAIL: (id) => `${
|
|
310
|
-
ROUTES_DETAIL_LOCK: (id) => `${
|
|
311
|
-
ROUTES_LIST: `${
|
|
309
|
+
ROUTES_DETAIL: (id) => `${getModuleConfig('offer', 'api_url')}/routes/${id}`,
|
|
310
|
+
ROUTES_DETAIL_LOCK: (id) => `${getModuleConfig('offer', 'api_url')}/routes/${id}/lock`,
|
|
311
|
+
ROUTES_LIST: `${getModuleConfig('offer', 'api_url')}/routes`,
|
|
312
312
|
// TYPOLOGIES
|
|
313
|
-
TYPOLOGIES_DETAIL: (id) => `${
|
|
314
|
-
TYPOLOGIES_DETAIL_LOCK: (id) => `${
|
|
315
|
-
TYPOLOGIES_LIST: `${
|
|
313
|
+
TYPOLOGIES_DETAIL: (id) => `${getModuleConfig('offer', 'api_url')}/typologies/${id}`,
|
|
314
|
+
TYPOLOGIES_DETAIL_LOCK: (id) => `${getModuleConfig('offer', 'api_url')}/typologies/${id}/lock`,
|
|
315
|
+
TYPOLOGIES_LIST: `${getModuleConfig('offer', 'api_url')}/typologies`,
|
|
316
316
|
// ZONES
|
|
317
|
-
ZONES_DETAIL: (id) => `${
|
|
318
|
-
ZONES_DETAIL_LOCK: (id) => `${
|
|
319
|
-
ZONES_LIST: `${
|
|
317
|
+
ZONES_DETAIL: (id) => `${getModuleConfig('offer', 'api_url')}/zones/${id}`,
|
|
318
|
+
ZONES_DETAIL_LOCK: (id) => `${getModuleConfig('offer', 'api_url')}/zones/${id}/lock`,
|
|
319
|
+
ZONES_LIST: `${getModuleConfig('offer', 'api_url')}/zones`,
|
|
320
320
|
},
|
|
321
321
|
/* * */
|
|
322
322
|
/* PERFORMANCE */
|
|
323
323
|
performance: {
|
|
324
324
|
// BASE
|
|
325
|
-
BASE: `${
|
|
325
|
+
BASE: `${getModuleConfig('performance', 'api_url')}`,
|
|
326
326
|
// DATES
|
|
327
|
-
DATES_LIST: `${
|
|
327
|
+
DATES_LIST: `${getModuleConfig('performance', 'api_url')}/dates`,
|
|
328
328
|
// METRICS
|
|
329
|
-
METRICS_DETAIL: (id) => `${
|
|
329
|
+
METRICS_DETAIL: (id) => `${getModuleConfig('performance', 'api_url')}/metrics/${id}`,
|
|
330
330
|
// NETWORK
|
|
331
|
-
NETWORK_LINES: `${
|
|
332
|
-
NETWORK_PATTERNS: `${
|
|
331
|
+
NETWORK_LINES: `${getModuleConfig('performance', 'api_url')}/network/lines`,
|
|
332
|
+
NETWORK_PATTERNS: `${getModuleConfig('performance', 'api_url')}/network/patterns`,
|
|
333
333
|
},
|
|
334
334
|
/* * */
|
|
335
335
|
/* PLANS */
|
|
336
336
|
plans: {
|
|
337
337
|
// BASE
|
|
338
|
-
BASE: `${
|
|
338
|
+
BASE: `${getModuleConfig('plans', 'api_url')}`,
|
|
339
339
|
// PLANS
|
|
340
|
-
PLANS_APPROVED: `${
|
|
341
|
-
PLANS_DETAIL: (id) => `${
|
|
342
|
-
PLANS_DETAIL_CHANGE_GTFS: (id) => `${
|
|
343
|
-
PLANS_DETAIL_CONTROLLER_REPROCESS: (id) => `${
|
|
344
|
-
PLANS_DETAIL_LOCK: (id) => `${
|
|
345
|
-
PLANS_DETAIL_OPERATION_FILE: (id) => `${
|
|
346
|
-
PLANS_DETAIL_OPERATION_FILE_DOWNLOAD: (id) => `${
|
|
347
|
-
PLANS_DRT_MODEL: (id) => `${
|
|
348
|
-
PLANS_LIST: `${
|
|
340
|
+
PLANS_APPROVED: `${getModuleConfig('plans', 'api_url')}/plans/approved`,
|
|
341
|
+
PLANS_DETAIL: (id) => `${getModuleConfig('plans', 'api_url')}/plans/${id}`,
|
|
342
|
+
PLANS_DETAIL_CHANGE_GTFS: (id) => `${getModuleConfig('plans', 'api_url')}/plans/${id}/change-gtfs`,
|
|
343
|
+
PLANS_DETAIL_CONTROLLER_REPROCESS: (id) => `${getModuleConfig('plans', 'api_url')}/plans/${id}/controller-reprocess`,
|
|
344
|
+
PLANS_DETAIL_LOCK: (id) => `${getModuleConfig('plans', 'api_url')}/plans/${id}/lock`,
|
|
345
|
+
PLANS_DETAIL_OPERATION_FILE: (id) => `${getModuleConfig('plans', 'api_url')}/plans/${id}/operation-file`,
|
|
346
|
+
PLANS_DETAIL_OPERATION_FILE_DOWNLOAD: (id) => `${getModuleConfig('plans', 'api_url')}/plans/${id}/operation-file/download`,
|
|
347
|
+
PLANS_DRT_MODEL: (id) => `${getModuleConfig('plans', 'api_url')}/plans/drt-model/${id}`,
|
|
348
|
+
PLANS_LIST: `${getModuleConfig('plans', 'api_url')}/plans`,
|
|
349
349
|
// VALIDATIONS
|
|
350
|
-
VALIDATIONS_DETAIL: (id) => `${
|
|
351
|
-
VALIDATIONS_DETAIL_FILE: (id) => `${
|
|
352
|
-
VALIDATIONS_DETAIL_FILE_DOWNLOAD: (id) => `${
|
|
353
|
-
VALIDATIONS_DETAIL_LOCK: (id) => `${
|
|
354
|
-
VALIDATIONS_DETAIL_PROCESSING_STATUS: (id) => `${
|
|
355
|
-
VALIDATIONS_DETAIL_REQUEST_APPROVAL: (id) => `${
|
|
356
|
-
VALIDATIONS_LIST: `${
|
|
350
|
+
VALIDATIONS_DETAIL: (id) => `${getModuleConfig('plans', 'api_url')}/validations/${id}`,
|
|
351
|
+
VALIDATIONS_DETAIL_FILE: (id) => `${getModuleConfig('plans', 'api_url')}/validations/${id}/file`,
|
|
352
|
+
VALIDATIONS_DETAIL_FILE_DOWNLOAD: (id) => `${getModuleConfig('plans', 'api_url')}/validations/${id}/file/download`,
|
|
353
|
+
VALIDATIONS_DETAIL_LOCK: (id) => `${getModuleConfig('plans', 'api_url')}/validations/${id}/lock`,
|
|
354
|
+
VALIDATIONS_DETAIL_PROCESSING_STATUS: (id) => `${getModuleConfig('plans', 'api_url')}/validations/${id}/processing-status`,
|
|
355
|
+
VALIDATIONS_DETAIL_REQUEST_APPROVAL: (id) => `${getModuleConfig('plans', 'api_url')}/validations/${id}/request-approval`,
|
|
356
|
+
VALIDATIONS_LIST: `${getModuleConfig('plans', 'api_url')}/validations`,
|
|
357
357
|
},
|
|
358
358
|
/* * */
|
|
359
359
|
/* STOPS */
|
|
360
360
|
stops: {
|
|
361
361
|
// BASE
|
|
362
|
-
BASE: `${
|
|
362
|
+
BASE: `${getModuleConfig('stops', 'api_url')}`,
|
|
363
363
|
// STOPS
|
|
364
|
-
STOPS_DETAIL: (id) => `${
|
|
365
|
-
STOPS_DETAIL_LOCK: (id) => `${
|
|
366
|
-
STOPS_LIST: `${
|
|
364
|
+
STOPS_DETAIL: (id) => `${getModuleConfig('stops', 'api_url')}/stops/${id}`,
|
|
365
|
+
STOPS_DETAIL_LOCK: (id) => `${getModuleConfig('stops', 'api_url')}/stops/${id}/lock`,
|
|
366
|
+
STOPS_LIST: `${getModuleConfig('stops', 'api_url')}/stops`,
|
|
367
|
+
STOPS_VALID_ID: `${getModuleConfig('stops', 'api_url')}/stops/valid-id`,
|
|
367
368
|
},
|
|
368
369
|
});
|
package/dist/earliest-date.js
CHANGED
|
@@ -11,7 +11,7 @@ export function getEarliestDate() {
|
|
|
11
11
|
//
|
|
12
12
|
// In production, return the fixed date of
|
|
13
13
|
// 1 January 2024, in the Europe/Lisbon timezone.
|
|
14
|
-
if (getCurrentEnvironment() === '
|
|
14
|
+
if (getCurrentEnvironment() === 'prd') {
|
|
15
15
|
return Dates
|
|
16
16
|
.fromOperationalDate('20240101', 'Europe/Lisbon')
|
|
17
17
|
.set({ hour: 4, millisecond: 0, minute: 0, second: 0 });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tmlmobilidade/consts",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "20260418.947.46",
|
|
4
4
|
"author": {
|
|
5
5
|
"email": "iso@tmlmobilidade.pt",
|
|
6
6
|
"name": "TML-ISO"
|
|
@@ -29,6 +29,9 @@
|
|
|
29
29
|
],
|
|
30
30
|
"main": "./dist/index.js",
|
|
31
31
|
"types": "./dist/index.d.ts",
|
|
32
|
+
"exports": {
|
|
33
|
+
".": "./dist/index.js"
|
|
34
|
+
},
|
|
32
35
|
"scripts": {
|
|
33
36
|
"build": "tsc && resolve-tspaths",
|
|
34
37
|
"lint": "eslint ./src/ && tsc --noEmit",
|
|
@@ -41,7 +44,7 @@
|
|
|
41
44
|
"devDependencies": {
|
|
42
45
|
"@tmlmobilidade/tsconfig": "*",
|
|
43
46
|
"@tmlmobilidade/types": "*",
|
|
44
|
-
"@types/node": "25.
|
|
47
|
+
"@types/node": "25.6.0",
|
|
45
48
|
"resolve-tspaths": "0.8.23",
|
|
46
49
|
"tsc-watch": "7.2.0",
|
|
47
50
|
"typescript": "5.9.3"
|