@authup/server-kit 1.0.0-beta.21 → 1.0.0-beta.22

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.
@@ -0,0 +1,9 @@
1
+ import type { CacheClearOptions, CacheSetOptions } from '../types';
2
+ export interface CacheAdapter {
3
+ set(key: string, value: any, options: CacheSetOptions): Promise<void>;
4
+ get(key: string): Promise<any | undefined>;
5
+ drop(key: string): Promise<void>;
6
+ dropMany(keys: string[]): Promise<void>;
7
+ clear(options: CacheClearOptions): Promise<void>;
8
+ }
9
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/services/cache/adapters/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEnE,MAAM,WAAW,YAAY;IACzB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtE,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,GAAG,SAAS,CAAC,CAAC;IAE3C,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzC,KAAK,CAAC,OAAO,EAAE,iBAAiB,GAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACrD"}
@@ -0,0 +1,3 @@
1
+ import type { CacheKeyBuildOptions } from './types';
2
+ export declare function buildCacheKey(options: CacheKeyBuildOptions): string;
3
+ //# sourceMappingURL=helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../src/services/cache/helper.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,UAE1D"}
@@ -0,0 +1,6 @@
1
+ export * from './adapters';
2
+ export * from './helper';
3
+ export * from './singleton';
4
+ export * from './module';
5
+ export * from './types';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/cache/index.ts"],"names":[],"mappings":"AAOA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { CacheAdapter } from './adapters';
2
+ import type { CacheClearOptions, CacheSetOptions } from './types';
3
+ export declare class Cache {
4
+ protected adapter: CacheAdapter;
5
+ constructor(adapter: CacheAdapter);
6
+ set(key: string, value: any, options?: CacheSetOptions): Promise<void>;
7
+ get(key: string): Promise<any | undefined>;
8
+ drop(key: string): Promise<void>;
9
+ dropMany(keys: string[]): Promise<void>;
10
+ clear(options?: CacheClearOptions): Promise<void>;
11
+ }
12
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/services/cache/module.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAElE,qBAAa,KAAK;IACd,SAAS,CAAC,OAAO,EAAG,YAAY,CAAC;gBAErB,OAAO,EAAE,YAAY;IAI3B,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,GAAE,eAAoB,GAAI,OAAO,CAAC,IAAI,CAAC;IAI3E,GAAG,CAAC,GAAG,EAAE,MAAM,GAAI,OAAO,CAAC,GAAG,GAAG,SAAS,CAAC;IAI3C,IAAI,CAAC,GAAG,EAAE,MAAM,GAAI,OAAO,CAAC,IAAI,CAAC;IAIjC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAI,OAAO,CAAC,IAAI,CAAC;IAIxC,KAAK,CAAC,OAAO,GAAE,iBAAsB,GAAI,OAAO,CAAC,IAAI,CAAC;CAG/D"}
@@ -0,0 +1,3 @@
1
+ import { Cache } from './module';
2
+ export declare function useCache(): Cache;
3
+ //# sourceMappingURL=singleton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"singleton.d.ts","sourceRoot":"","sources":["../../../src/services/cache/singleton.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAgBjC,wBAAgB,QAAQ,UAEvB"}
@@ -0,0 +1,16 @@
1
+ export type CacheKeyBuildOptions = {
2
+ key: string;
3
+ prefix?: string;
4
+ suffix?: string;
5
+ };
6
+ export type CacheSetOptions = {
7
+ /**
8
+ * Time to live in milliseconds (ms).
9
+ */
10
+ ttl?: number;
11
+ };
12
+ export type CacheClearOptions = {
13
+ prefix?: string;
14
+ suffix?: string;
15
+ };
16
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/cache/types.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,oBAAoB,GAAG;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;CAClB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC1B;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;CAClB,CAAC"}
@@ -1,3 +1,4 @@
1
+ export * from './cache';
1
2
  export * from './logger';
2
3
  export * from './redis';
3
4
  export * from './vault';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAOA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAOA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@authup/server-kit",
3
- "version": "1.0.0-beta.21",
3
+ "version": "1.0.0-beta.22",
4
4
  "description": "A toolkit for server-side services.",
5
+ "license": "Apache-2.0",
5
6
  "exports": {
6
7
  "./package.json": "./package.json",
7
8
  ".": {
@@ -14,7 +15,7 @@
14
15
  "module": "./dist/index.mjs",
15
16
  "types": "./dist/index.d.ts",
16
17
  "files": [
17
- "dist/"
18
+ "dist"
18
19
  ],
19
20
  "scripts": {
20
21
  "build:types": "tsc --emitDeclarationOnly -p tsconfig.build.json",
@@ -40,7 +41,6 @@
40
41
  "email": "contact@tada5hi.net",
41
42
  "url": "https://github.com/tada5hi"
42
43
  },
43
- "license": "Apache-2.0",
44
44
  "repository": {
45
45
  "type": "git",
46
46
  "url": "git+https://github.com/authup/authup.git",
@@ -52,6 +52,7 @@
52
52
  "homepage": "https://github.com/authup/authup#readme",
53
53
  "dependencies": {
54
54
  "@hapic/vault": "^2.3.3",
55
+ "@isaacs/ttlcache": "^1.4.1",
55
56
  "@node-rs/bcrypt": "^1.10.5",
56
57
  "@node-rs/jsonwebtoken": "^0.5.7",
57
58
  "@socket.io/redis-emitter": "^5.1.0",
@@ -63,10 +64,10 @@
63
64
  "winston": "^3.15.0"
64
65
  },
65
66
  "devDependencies": {
66
- "@authup/kit": "^1.0.0-beta.21"
67
+ "@authup/kit": "^1.0.0-beta.22"
67
68
  },
68
69
  "peerDependencies": {
69
- "@authup/kit": "^1.0.0-beta.21"
70
+ "@authup/kit": "^1.0.0-beta.22"
70
71
  },
71
72
  "publishConfig": {
72
73
  "access": "public"