hysteria-orm 10.4.0 → 10.4.1

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/lib/index.d.cts CHANGED
@@ -1078,9 +1078,32 @@ type AdminJsInstance = {
1078
1078
  };
1079
1079
 
1080
1080
  interface CacheAdapter {
1081
+ /**
1082
+ * @description Gets a value from the cache
1083
+ * @param key The key to get the value from
1084
+ * @returns The value from the cache
1085
+ */
1081
1086
  get<T = void>(key: string): Promise<T>;
1087
+ /**
1088
+ * @description Sets a value in the cache
1089
+ * @param key The key to set the value to
1090
+ * @param data The value to set in the cache
1091
+ * @param ttl The time to live for the value in milliseconds
1092
+ */
1082
1093
  set<T = any>(key: string, data: T, ttl?: number): Promise<void>;
1094
+ /**
1095
+ * @description Invalidates a value from the cache
1096
+ * @param key The key to invalidate the value from
1097
+ */
1083
1098
  invalidate(key: string): Promise<void>;
1099
+ /**
1100
+ * @description Invalidates all values from the cache starting with the given key
1101
+ * @param key The key to invalidate the values from
1102
+ */
1103
+ invalidateAll(key: string): Promise<void>;
1104
+ /**
1105
+ * @description Disconnects from the cache adapter if needed when the data source disconnects
1106
+ */
1084
1107
  disconnect?(): Promise<void>;
1085
1108
  }
1086
1109
 
@@ -4009,6 +4032,11 @@ declare class SqlDataSource<D extends SqlDataSourceType = SqlDataSourceType, T e
4009
4032
  */
4010
4033
  invalidCache<K extends keyof C>(key: K, ...args: Parameters<C[K]>): Promise<void>;
4011
4034
  invalidCache<K extends keyof C>(key: K): Promise<void>;
4035
+ /**
4036
+ * @description Invalidates all values from the cache starting with the given key
4037
+ * @param key The key to invalidate the values from
4038
+ */
4039
+ invalidateAllCache(key: string): Promise<void>;
4012
4040
  /**
4013
4041
  * @description Clones the SqlDataSource instance
4014
4042
  * @param options.shouldRecreatePool Whether to recreate the pool of connections for the given driver, by default it's false
@@ -5299,6 +5327,7 @@ declare class InMemoryAdapter implements CacheAdapter {
5299
5327
  get<T = void>(key: string): Promise<T>;
5300
5328
  set<T = any>(key: string, data: T, ttl?: number): Promise<void>;
5301
5329
  invalidate(key: string): Promise<void>;
5330
+ invalidateAll(key: string): Promise<void>;
5302
5331
  }
5303
5332
 
5304
5333
  declare class RedisCacheAdapter implements CacheAdapter {
@@ -5309,6 +5338,7 @@ declare class RedisCacheAdapter implements CacheAdapter {
5309
5338
  get<T = void>(key: string): Promise<T>;
5310
5339
  set<T = any>(key: string, data: T, ttl?: number): Promise<void>;
5311
5340
  invalidate(key: string): Promise<void>;
5341
+ invalidateAll(key: string): Promise<void>;
5312
5342
  private serializeData;
5313
5343
  private deserializeData;
5314
5344
  disconnect(): Promise<void>;
package/lib/index.d.ts CHANGED
@@ -1078,9 +1078,32 @@ type AdminJsInstance = {
1078
1078
  };
1079
1079
 
1080
1080
  interface CacheAdapter {
1081
+ /**
1082
+ * @description Gets a value from the cache
1083
+ * @param key The key to get the value from
1084
+ * @returns The value from the cache
1085
+ */
1081
1086
  get<T = void>(key: string): Promise<T>;
1087
+ /**
1088
+ * @description Sets a value in the cache
1089
+ * @param key The key to set the value to
1090
+ * @param data The value to set in the cache
1091
+ * @param ttl The time to live for the value in milliseconds
1092
+ */
1082
1093
  set<T = any>(key: string, data: T, ttl?: number): Promise<void>;
1094
+ /**
1095
+ * @description Invalidates a value from the cache
1096
+ * @param key The key to invalidate the value from
1097
+ */
1083
1098
  invalidate(key: string): Promise<void>;
1099
+ /**
1100
+ * @description Invalidates all values from the cache starting with the given key
1101
+ * @param key The key to invalidate the values from
1102
+ */
1103
+ invalidateAll(key: string): Promise<void>;
1104
+ /**
1105
+ * @description Disconnects from the cache adapter if needed when the data source disconnects
1106
+ */
1084
1107
  disconnect?(): Promise<void>;
1085
1108
  }
1086
1109
 
@@ -4009,6 +4032,11 @@ declare class SqlDataSource<D extends SqlDataSourceType = SqlDataSourceType, T e
4009
4032
  */
4010
4033
  invalidCache<K extends keyof C>(key: K, ...args: Parameters<C[K]>): Promise<void>;
4011
4034
  invalidCache<K extends keyof C>(key: K): Promise<void>;
4035
+ /**
4036
+ * @description Invalidates all values from the cache starting with the given key
4037
+ * @param key The key to invalidate the values from
4038
+ */
4039
+ invalidateAllCache(key: string): Promise<void>;
4012
4040
  /**
4013
4041
  * @description Clones the SqlDataSource instance
4014
4042
  * @param options.shouldRecreatePool Whether to recreate the pool of connections for the given driver, by default it's false
@@ -5299,6 +5327,7 @@ declare class InMemoryAdapter implements CacheAdapter {
5299
5327
  get<T = void>(key: string): Promise<T>;
5300
5328
  set<T = any>(key: string, data: T, ttl?: number): Promise<void>;
5301
5329
  invalidate(key: string): Promise<void>;
5330
+ invalidateAll(key: string): Promise<void>;
5302
5331
  }
5303
5332
 
5304
5333
  declare class RedisCacheAdapter implements CacheAdapter {
@@ -5309,6 +5338,7 @@ declare class RedisCacheAdapter implements CacheAdapter {
5309
5338
  get<T = void>(key: string): Promise<T>;
5310
5339
  set<T = any>(key: string, data: T, ttl?: number): Promise<void>;
5311
5340
  invalidate(key: string): Promise<void>;
5341
+ invalidateAll(key: string): Promise<void>;
5312
5342
  private serializeData;
5313
5343
  private deserializeData;
5314
5344
  disconnect(): Promise<void>;