@tmlmobilidade/go-interfaces-cachedb 20260918.1329.38 → 20260918.1854.0

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.
@@ -39,8 +39,8 @@ declare class CacheDbClass {
39
39
  /**
40
40
  * Retrieves a cache entry by its key.
41
41
  * @param key The key of the cache entry to retrieve.
42
- * @returns A promise that resolves with the cache entry value,
43
- * or `null` if not found.
42
+ * @returns A promise that resolves with the JSON parsed cache entry value,
43
+ * or `undefined` if not found.
44
44
  * @throws Will throw an error if the retrieval process fails.
45
45
  */
46
46
  getNew<T>(key: CacheDbKey): Promise<CachedData<T> | undefined>;
@@ -58,7 +58,7 @@ declare class CacheDbClass {
58
58
  */
59
59
  set(key: CacheDbKey, value: string, ttl?: number): Promise<void>;
60
60
  /**
61
- * Saves a cache entry with an optional time-to-live (TTL).
61
+ * Saves a JSON cache entry with an optional time-to-live (TTL).
62
62
  * @param key The key of the cache entry to save.
63
63
  * @param value The value of the cache entry to save. Must be a string.
64
64
  * @param ttl Optional time-to-live (TTL) in seconds. Omit when not needed.
package/dist/interface.js CHANGED
@@ -74,8 +74,8 @@ class CacheDbClass {
74
74
  /**
75
75
  * Retrieves a cache entry by its key.
76
76
  * @param key The key of the cache entry to retrieve.
77
- * @returns A promise that resolves with the cache entry value,
78
- * or `null` if not found.
77
+ * @returns A promise that resolves with the JSON parsed cache entry value,
78
+ * or `undefined` if not found.
79
79
  * @throws Will throw an error if the retrieval process fails.
80
80
  */
81
81
  async getNew(key) {
@@ -116,7 +116,7 @@ class CacheDbClass {
116
116
  await this.client.set(key, value);
117
117
  }
118
118
  /**
119
- * Saves a cache entry with an optional time-to-live (TTL).
119
+ * Saves a JSON cache entry with an optional time-to-live (TTL).
120
120
  * @param key The key of the cache entry to save.
121
121
  * @param value The value of the cache entry to save. Must be a string.
122
122
  * @param ttl Optional time-to-live (TTL) in seconds. Omit when not needed.
package/dist/keys.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const cacheDbKeyValues: readonly ["hub:v1:navegante:app-enabled", "hub:v1:alerts:published:json", "hub:v1:alerts:published:json:cm", "hub:v1:alerts:published:gtfs", "hub:v1:alerts:published:gtfs:cm", "hub:v1:alerts:published:rss", "hub:v1:alerts:published:rss:cm", "hub:v1:plans:approved:json", "hub:v1:realtime:vehicles:metadata:json", "hub:v1:realtime:vehicles:positions:json", "hub:v1:realtime:vehicles:positions:gtfs", "hub:v1:realtime:eta:all", "hub:v1:realtime:eta:all:gtfs", `hub:v1:realtime:eta:by-trip:${string}`, `hub:v1:realtime:eta:by-stop:${string}`, `hub:v1:realtime:eta:by-trip:${string}:gtfs`, `hub:v1:realtime:eta:by-stop:${string}:gtfs`, "hub:v1:network:dates", "hub:v1:network:periods", "hub:v1:network:stops", `hub:v1:network:stops:${string}`, "hub:v1:network:legacy-stops-map", "hub:v1:network:lines", `hub:v1:network:lines:${string}`, "hub:v1:network:routes", `hub:v1:network:routes:${string}`, "hub:v1:network:plans", `hub:v1:network:plans:${string}`, "hub:v1:metrics:demand:by-agency:by-operational-date:json", "hub:v1:network:vehicles:protobuf", `hub:v1:network:patterns:${string}`, `hub:v1:network:shapes:${string}`];
1
+ export declare const cacheDbKeyValues: readonly ["hub:v1:navegante:app-enabled", "hub:v1:agencies:json", "hub:v1:alerts:published:json", "hub:v1:alerts:published:json:cm", "hub:v1:alerts:published:gtfs", "hub:v1:alerts:published:gtfs:cm", "hub:v1:alerts:published:rss", "hub:v1:alerts:published:rss:cm", "hub:v1:plans:approved:json", "hub:v1:realtime:vehicles:metadata:json", "hub:v1:realtime:vehicles:positions:json", "hub:v1:realtime:vehicles:positions:gtfs", "hub:v1:realtime:eta:all", "hub:v1:realtime:eta:all:gtfs", `hub:v1:realtime:eta:by-trip:${string}`, `hub:v1:realtime:eta:by-stop:${string}`, `hub:v1:realtime:eta:by-trip:${string}:gtfs`, `hub:v1:realtime:eta:by-stop:${string}:gtfs`, "hub:v1:network:dates", "hub:v1:network:periods", "hub:v1:network:stops", `hub:v1:network:stops:${string}`, "hub:v1:network:legacy-stops-map", "hub:v1:network:lines", `hub:v1:network:lines:${string}`, "hub:v1:network:routes", `hub:v1:network:routes:${string}`, "hub:v1:network:plans", `hub:v1:network:plans:${string}`, "hub:v1:metrics:demand:by-agency:by-operational-date:json", "hub:v1:network:vehicles:protobuf", `hub:v1:network:patterns:${string}`, `hub:v1:network:shapes:${string}`];
2
2
  export type CacheDbKey = typeof cacheDbKeyValues[number];
package/dist/keys.js CHANGED
@@ -2,6 +2,7 @@
2
2
  const dynamicKey = () => 'use-for-dynamic-key';
3
3
  export const cacheDbKeyValues = [
4
4
  'hub:v1:navegante:app-enabled',
5
+ 'hub:v1:agencies:json',
5
6
  'hub:v1:alerts:published:json',
6
7
  'hub:v1:alerts:published:json:cm',
7
8
  'hub:v1:alerts:published:gtfs',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/go-interfaces-cachedb",
3
- "version": "20260918.1329.38",
3
+ "version": "20260918.1854.0",
4
4
  "author": {
5
5
  "email": "iso@tmlmobilidade.pt",
6
6
  "name": "TML-ISO"