@tmlmobilidade/databases 20260514.1436.37 → 20260514.1556.50

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.
@@ -46,9 +46,7 @@ declare class ApiCacheClass {
46
46
  * Saves a cache entry with an optional time-to-live (TTL).
47
47
  * @param key The key of the cache entry to save.
48
48
  * @param value The value of the cache entry to save. Must be a string.
49
- * @param ttl Optional time-to-live for the cache entry in seconds.
50
- * If not provided, the entry will persist indefinitely.
51
- * @param params Optional params to replace `{named}` tokens in the key.
49
+ * @param options Optional params / TTL. Omit when neither applies.
52
50
  */
53
51
  set(key: ApiCacheKey, value: string, options?: {
54
52
  params?: ApiCacheKeyParams;
@@ -89,9 +89,7 @@ class ApiCacheClass {
89
89
  * Saves a cache entry with an optional time-to-live (TTL).
90
90
  * @param key The key of the cache entry to save.
91
91
  * @param value The value of the cache entry to save. Must be a string.
92
- * @param ttl Optional time-to-live for the cache entry in seconds.
93
- * If not provided, the entry will persist indefinitely.
94
- * @param params Optional params to replace `{named}` tokens in the key.
92
+ * @param options Optional params / TTL. Omit when neither applies.
95
93
  */
96
94
  async set(key, value, options) {
97
95
  const parsedKey = resolveApiCacheKey(key, options?.params);
@@ -1,4 +1,4 @@
1
1
  export type ApiCacheKeyParams = Record<string, boolean | number | string>;
2
- export declare const ApiCacheKeyValues: readonly ["hub:alerts:published:json", "hub:alerts:published:gtfs", "hub:alerts:published:rss", "hub:plans:approved:json", "hub:plans:gtfs", "hub:plans:gtfs:cm", "hub:facilities:json", "hub:facilities:helpdesks:json", "hub:facilities:boat_stations:json", "hub:facilities:light_rail_stations:json", "hub:facilities:subway_stations:json", "hub:facilities:train_stations:json", "hub:facilities:pips:json", "hub:facilities:schools:json", "hub:facilities:stores:json", "hub:locations:municipalities:json", "hub:locations:districts:json", "hub:locations:localities:json", "hub:locations:parishes:json", "hub:network:dates:json", "hub:network:periods:json", "hub:network:stops:json", "hub:network:lines:json", "hub:network:routes:json", "hub:network:plans:json", "hub:network:vehicles:json", "hub:network:vehicles:protobuf:json", "hub:network:patterns:{patternId}:json", "hub:network:shapes:{shapeId}:json"];
2
+ export declare const ApiCacheKeyValues: readonly ["hub:alerts:published:json", "hub:alerts:published:gtfs", "hub:alerts:published:rss", "hub:plans:approved:json", "hub:plans:gtfs", "hub:plans:gtfs:cm", "hub:facilities", "hub:facilities:helpdesk", "hub:facilities:boat_stations", "hub:facilities:light_rail_stations", "hub:facilities:subway_stations", "hub:facilities:train_stations", "hub:facilities:pips", "hub:facilities:schools", "hub:facilities:stores", "hub:locations:municipalities", "hub:locations:districts", "hub:locations:localities", "hub:locations:parishes", "hub:network:dates", "hub:network:periods", "hub:network:stops", "hub:network:lines", "hub:network:routes", "hub:network:plans", "hub:network:vehicles", "hub:network:vehicles:protobuf", "hub:network:patterns:{patternId}", "hub:network:shapes:{shapeId}"];
3
3
  export type ApiCacheKey = typeof ApiCacheKeyValues[number];
4
4
  export declare function resolveApiCacheKey(key: ApiCacheKey, params?: ApiCacheKeyParams): string;
@@ -6,29 +6,29 @@ export const ApiCacheKeyValues = [
6
6
  'hub:plans:approved:json',
7
7
  'hub:plans:gtfs',
8
8
  'hub:plans:gtfs:cm',
9
- 'hub:facilities:json',
10
- 'hub:facilities:helpdesks:json',
11
- 'hub:facilities:boat_stations:json',
12
- 'hub:facilities:light_rail_stations:json',
13
- 'hub:facilities:subway_stations:json',
14
- 'hub:facilities:train_stations:json',
15
- 'hub:facilities:pips:json',
16
- 'hub:facilities:schools:json',
17
- 'hub:facilities:stores:json',
18
- 'hub:locations:municipalities:json',
19
- 'hub:locations:districts:json',
20
- 'hub:locations:localities:json',
21
- 'hub:locations:parishes:json',
22
- 'hub:network:dates:json',
23
- 'hub:network:periods:json',
24
- 'hub:network:stops:json',
25
- 'hub:network:lines:json',
26
- 'hub:network:routes:json',
27
- 'hub:network:plans:json',
28
- 'hub:network:vehicles:json',
29
- 'hub:network:vehicles:protobuf:json',
30
- 'hub:network:patterns:{patternId}:json',
31
- 'hub:network:shapes:{shapeId}:json',
9
+ 'hub:facilities',
10
+ 'hub:facilities:helpdesk',
11
+ 'hub:facilities:boat_stations',
12
+ 'hub:facilities:light_rail_stations',
13
+ 'hub:facilities:subway_stations',
14
+ 'hub:facilities:train_stations',
15
+ 'hub:facilities:pips',
16
+ 'hub:facilities:schools',
17
+ 'hub:facilities:stores',
18
+ 'hub:locations:municipalities',
19
+ 'hub:locations:districts',
20
+ 'hub:locations:localities',
21
+ 'hub:locations:parishes',
22
+ 'hub:network:dates',
23
+ 'hub:network:periods',
24
+ 'hub:network:stops',
25
+ 'hub:network:lines',
26
+ 'hub:network:routes',
27
+ 'hub:network:plans',
28
+ 'hub:network:vehicles',
29
+ 'hub:network:vehicles:protobuf',
30
+ 'hub:network:patterns:{patternId}',
31
+ 'hub:network:shapes:{shapeId}',
32
32
  ];
33
33
  export function resolveApiCacheKey(key, params) {
34
34
  const resolvedKey = key.replace(/\{([^{}]+)\}/g, (_match, paramName) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/databases",
3
- "version": "20260514.1436.37",
3
+ "version": "20260514.1556.50",
4
4
  "author": {
5
5
  "email": "iso@tmlmobilidade.pt",
6
6
  "name": "TML-ISO"