@tmlmobilidade/consts 20260320.1741.37 → 20260320.1746.41
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.js +23 -23
- package/dist/earliest-date.d.ts +7 -0
- package/dist/earliest-date.js +28 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +4 -1
package/dist/app-configs.js
CHANGED
|
@@ -8,7 +8,7 @@ const DEFAULT_PRODUCTION_CONFIG = {
|
|
|
8
8
|
};
|
|
9
9
|
const DEFAULT_STAGING_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
14
|
const APP_CONFIGS = {
|
|
@@ -26,8 +26,8 @@ const APP_CONFIGS = {
|
|
|
26
26
|
...DEFAULT_PRODUCTION_CONFIG,
|
|
27
27
|
},
|
|
28
28
|
staging: {
|
|
29
|
-
api_url: 'https://
|
|
30
|
-
frontend_url: 'https://
|
|
29
|
+
api_url: 'https://go-stg.tmlmobilidade.pt/alerts/api',
|
|
30
|
+
frontend_url: 'https://go-stg.tmlmobilidade.pt/alerts',
|
|
31
31
|
...DEFAULT_STAGING_CONFIG,
|
|
32
32
|
},
|
|
33
33
|
},
|
|
@@ -45,8 +45,8 @@ const APP_CONFIGS = {
|
|
|
45
45
|
...DEFAULT_PRODUCTION_CONFIG,
|
|
46
46
|
},
|
|
47
47
|
staging: {
|
|
48
|
-
api_url: 'https://
|
|
49
|
-
frontend_url: 'https://
|
|
48
|
+
api_url: 'https://go-stg.tmlmobilidade.pt/auth/api',
|
|
49
|
+
frontend_url: 'https://go-stg.tmlmobilidade.pt/auth',
|
|
50
50
|
...DEFAULT_STAGING_CONFIG,
|
|
51
51
|
},
|
|
52
52
|
},
|
|
@@ -64,8 +64,8 @@ const APP_CONFIGS = {
|
|
|
64
64
|
...DEFAULT_PRODUCTION_CONFIG,
|
|
65
65
|
},
|
|
66
66
|
staging: {
|
|
67
|
-
api_url: 'https://
|
|
68
|
-
frontend_url: 'https://
|
|
67
|
+
api_url: 'https://go-stg.tmlmobilidade.pt/controller/api',
|
|
68
|
+
frontend_url: 'https://go-stg.tmlmobilidade.pt/controller',
|
|
69
69
|
...DEFAULT_STAGING_CONFIG,
|
|
70
70
|
},
|
|
71
71
|
},
|
|
@@ -83,8 +83,8 @@ const APP_CONFIGS = {
|
|
|
83
83
|
...DEFAULT_PRODUCTION_CONFIG,
|
|
84
84
|
},
|
|
85
85
|
staging: {
|
|
86
|
-
api_url: 'https://
|
|
87
|
-
frontend_url: 'https://
|
|
86
|
+
api_url: 'https://go-stg.tmlmobilidade.pt/dates/api',
|
|
87
|
+
frontend_url: 'https://go-stg.tmlmobilidade.pt/dates',
|
|
88
88
|
...DEFAULT_STAGING_CONFIG,
|
|
89
89
|
},
|
|
90
90
|
},
|
|
@@ -102,8 +102,8 @@ const APP_CONFIGS = {
|
|
|
102
102
|
...DEFAULT_PRODUCTION_CONFIG,
|
|
103
103
|
},
|
|
104
104
|
staging: {
|
|
105
|
-
api_url: 'https://
|
|
106
|
-
frontend_url: 'https://
|
|
105
|
+
api_url: 'https://go-stg.tmlmobilidade.pt/exporter/api',
|
|
106
|
+
frontend_url: 'https://go-stg.tmlmobilidade.pt/exporter',
|
|
107
107
|
...DEFAULT_STAGING_CONFIG,
|
|
108
108
|
},
|
|
109
109
|
},
|
|
@@ -121,8 +121,8 @@ const APP_CONFIGS = {
|
|
|
121
121
|
...DEFAULT_PRODUCTION_CONFIG,
|
|
122
122
|
},
|
|
123
123
|
staging: {
|
|
124
|
-
api_url: 'https://
|
|
125
|
-
frontend_url: 'https://
|
|
124
|
+
api_url: 'https://go-stg.tmlmobilidade.pt/fleet/api',
|
|
125
|
+
frontend_url: 'https://go-stg.tmlmobilidade.pt/fleet',
|
|
126
126
|
...DEFAULT_STAGING_CONFIG,
|
|
127
127
|
},
|
|
128
128
|
},
|
|
@@ -140,8 +140,8 @@ const APP_CONFIGS = {
|
|
|
140
140
|
...DEFAULT_PRODUCTION_CONFIG,
|
|
141
141
|
},
|
|
142
142
|
staging: {
|
|
143
|
-
api_url: 'https://
|
|
144
|
-
frontend_url: 'https://
|
|
143
|
+
api_url: 'https://go-stg.tmlmobilidade.pt/locations/api',
|
|
144
|
+
frontend_url: 'https://go-stg.tmlmobilidade.pt/locations',
|
|
145
145
|
...DEFAULT_STAGING_CONFIG,
|
|
146
146
|
},
|
|
147
147
|
},
|
|
@@ -159,8 +159,8 @@ const APP_CONFIGS = {
|
|
|
159
159
|
...DEFAULT_PRODUCTION_CONFIG,
|
|
160
160
|
},
|
|
161
161
|
staging: {
|
|
162
|
-
api_url: 'https://
|
|
163
|
-
frontend_url: 'https://
|
|
162
|
+
api_url: 'https://go-stg.tmlmobilidade.pt/offer/api',
|
|
163
|
+
frontend_url: 'https://go-stg.tmlmobilidade.pt/offer',
|
|
164
164
|
...DEFAULT_STAGING_CONFIG,
|
|
165
165
|
},
|
|
166
166
|
},
|
|
@@ -178,8 +178,8 @@ const APP_CONFIGS = {
|
|
|
178
178
|
...DEFAULT_PRODUCTION_CONFIG,
|
|
179
179
|
},
|
|
180
180
|
staging: {
|
|
181
|
-
api_url: 'https://
|
|
182
|
-
frontend_url: 'https://
|
|
181
|
+
api_url: 'https://go-stg.tmlmobilidade.pt/performance/api',
|
|
182
|
+
frontend_url: 'https://go-stg.tmlmobilidade.pt/performance',
|
|
183
183
|
...DEFAULT_STAGING_CONFIG,
|
|
184
184
|
},
|
|
185
185
|
},
|
|
@@ -197,8 +197,8 @@ const APP_CONFIGS = {
|
|
|
197
197
|
...DEFAULT_PRODUCTION_CONFIG,
|
|
198
198
|
},
|
|
199
199
|
staging: {
|
|
200
|
-
api_url: 'https://
|
|
201
|
-
frontend_url: 'https://
|
|
200
|
+
api_url: 'https://go-stg.tmlmobilidade.pt/plans/api',
|
|
201
|
+
frontend_url: 'https://go-stg.tmlmobilidade.pt/plans',
|
|
202
202
|
...DEFAULT_STAGING_CONFIG,
|
|
203
203
|
},
|
|
204
204
|
},
|
|
@@ -216,8 +216,8 @@ const APP_CONFIGS = {
|
|
|
216
216
|
...DEFAULT_PRODUCTION_CONFIG,
|
|
217
217
|
},
|
|
218
218
|
staging: {
|
|
219
|
-
api_url: 'https://
|
|
220
|
-
frontend_url: 'https://
|
|
219
|
+
api_url: 'https://go-stg.tmlmobilidade.pt/stops/api',
|
|
220
|
+
frontend_url: 'https://go-stg.tmlmobilidade.pt/stops',
|
|
221
221
|
...DEFAULT_STAGING_CONFIG,
|
|
222
222
|
},
|
|
223
223
|
},
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Dates } from '@tmlmobilidade/dates';
|
|
2
|
+
/**
|
|
3
|
+
* Get the earliest date for data synchronization
|
|
4
|
+
* based on the current environment.
|
|
5
|
+
* @returns A Dates object with the earliest date for synchronization.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getEarliestDate(): Dates;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { Dates } from '@tmlmobilidade/dates';
|
|
3
|
+
import { getCurrentEnvironment } from '@tmlmobilidade/types';
|
|
4
|
+
/**
|
|
5
|
+
* Get the earliest date for data synchronization
|
|
6
|
+
* based on the current environment.
|
|
7
|
+
* @returns A Dates object with the earliest date for synchronization.
|
|
8
|
+
*/
|
|
9
|
+
export function getEarliestDate() {
|
|
10
|
+
//
|
|
11
|
+
//
|
|
12
|
+
// In production, return the fixed date of
|
|
13
|
+
// 1 January 2024, in the Europe/Lisbon timezone.
|
|
14
|
+
if (getCurrentEnvironment() === 'production') {
|
|
15
|
+
return Dates
|
|
16
|
+
.fromOperationalDate('20240101', 'Europe/Lisbon')
|
|
17
|
+
.set({ hour: 4, millisecond: 0, minute: 0, second: 0 });
|
|
18
|
+
}
|
|
19
|
+
//
|
|
20
|
+
// In non-production environments, return
|
|
21
|
+
// the date one week ago from now.
|
|
22
|
+
return Dates
|
|
23
|
+
.now('Europe/Lisbon')
|
|
24
|
+
.minus({ weeks: 1 })
|
|
25
|
+
.set({ hour: 4, millisecond: 0, minute: 0, second: 0 });
|
|
26
|
+
//
|
|
27
|
+
}
|
|
28
|
+
;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './app-configs.js';
|
|
|
2
2
|
export * from './app-routes.js';
|
|
3
3
|
export * from './ascii-art.js';
|
|
4
4
|
export * from './contacts.js';
|
|
5
|
+
export * from './earliest-date.js';
|
|
5
6
|
export * from './http-exception.js';
|
|
6
7
|
export * from './http-status.js';
|
|
7
8
|
export * from './mime-types.js';
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export * from './app-configs.js';
|
|
|
2
2
|
export * from './app-routes.js';
|
|
3
3
|
export * from './ascii-art.js';
|
|
4
4
|
export * from './contacts.js';
|
|
5
|
+
export * from './earliest-date.js';
|
|
5
6
|
export * from './http-exception.js';
|
|
6
7
|
export * from './http-status.js';
|
|
7
8
|
export * from './mime-types.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tmlmobilidade/consts",
|
|
3
|
-
"version": "20260320.
|
|
3
|
+
"version": "20260320.1746.41",
|
|
4
4
|
"author": {
|
|
5
5
|
"email": "iso@tmlmobilidade.pt",
|
|
6
6
|
"name": "TML-ISO"
|
|
@@ -35,6 +35,9 @@
|
|
|
35
35
|
"lint:fix": "eslint ./src/ --fix",
|
|
36
36
|
"watch": "tsc-watch --onSuccess 'resolve-tspaths'"
|
|
37
37
|
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@tmlmobilidade/dates": "*"
|
|
40
|
+
},
|
|
38
41
|
"devDependencies": {
|
|
39
42
|
"@tmlmobilidade/tsconfig": "*",
|
|
40
43
|
"@tmlmobilidade/types": "*",
|