@technomoron/api-server-base 1.1.7 → 1.1.9

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/README.txt CHANGED
@@ -109,6 +109,7 @@ accessCookie (string, default 'dat') Access token cookie name.
109
109
  refreshCookie (string, default 'drt') Refresh token cookie name.
110
110
  accessExpiry (number, default 60 * 15) Access token lifetime in seconds.
111
111
  refreshExpiry (number, default 30 * 24 * 60 * 60 * 1000) Refresh token lifetime in milliseconds.
112
+ sessionRefreshExpiry (number, default 24 * 60 * 60) Session token lifetime in seconds when clients opt out of "remember me" cookies.
112
113
  authApi (boolean, default false) Toggle you can use when mounting auth routes.
113
114
  devMode (boolean, default false) Custom hook for development only features.
114
115
  debug (boolean, default false) When true the server logs inbound requests via dumpRequest.
@@ -326,6 +326,7 @@ function fillConfig(config) {
326
326
  refreshCookie: config.refreshCookie ?? 'drt',
327
327
  accessExpiry: config.accessExpiry ?? 60 * 15,
328
328
  refreshExpiry: config.refreshExpiry ?? 30 * 24 * 60 * 60,
329
+ sessionRefreshExpiry: config.sessionRefreshExpiry ?? 24 * 60 * 60,
329
330
  authApi: config.authApi ?? false,
330
331
  devMode: config.devMode ?? false,
331
332
  hydrateGetBody: config.hydrateGetBody ?? true,
@@ -92,6 +92,7 @@ export interface ApiServerConf {
92
92
  refreshCookie: string;
93
93
  accessExpiry: number;
94
94
  refreshExpiry: number;
95
+ sessionRefreshExpiry: number;
95
96
  authApi: boolean;
96
97
  devMode: boolean;
97
98
  hydrateGetBody: boolean;
@@ -10,6 +10,8 @@ export interface AuthTokenMetadata {
10
10
  os?: string;
11
11
  scope?: string | string[];
12
12
  loginType?: string;
13
+ refreshTtlSeconds?: number;
14
+ sessionCookie?: boolean;
13
15
  revokeSessions?: 'device' | 'domain' | 'client' | 'user';
14
16
  }
15
17
  export interface AuthTokenData extends AuthTokenMetadata {
@@ -92,6 +92,7 @@ export interface ApiServerConf {
92
92
  refreshCookie: string;
93
93
  accessExpiry: number;
94
94
  refreshExpiry: number;
95
+ sessionRefreshExpiry: number;
95
96
  authApi: boolean;
96
97
  devMode: boolean;
97
98
  hydrateGetBody: boolean;
@@ -318,6 +318,7 @@ function fillConfig(config) {
318
318
  refreshCookie: config.refreshCookie ?? 'drt',
319
319
  accessExpiry: config.accessExpiry ?? 60 * 15,
320
320
  refreshExpiry: config.refreshExpiry ?? 30 * 24 * 60 * 60,
321
+ sessionRefreshExpiry: config.sessionRefreshExpiry ?? 24 * 60 * 60,
321
322
  authApi: config.authApi ?? false,
322
323
  devMode: config.devMode ?? false,
323
324
  hydrateGetBody: config.hydrateGetBody ?? true,
@@ -10,6 +10,8 @@ export interface AuthTokenMetadata {
10
10
  os?: string;
11
11
  scope?: string | string[];
12
12
  loginType?: string;
13
+ refreshTtlSeconds?: number;
14
+ sessionCookie?: boolean;
13
15
  revokeSessions?: 'device' | 'domain' | 'client' | 'user';
14
16
  }
15
17
  export interface AuthTokenData extends AuthTokenMetadata {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@technomoron/api-server-base",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "description": "Api Server Skeleton / Base Class",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.cjs",
@@ -28,14 +28,14 @@
28
28
  "scrub": "rm -rf ./node_modules/ pnpm-lock.yaml ./dist/",
29
29
  "build:cjs": "tsc --project tsconfig/tsconfig.cjs.json && node scripts/prepare-cjs.cjs",
30
30
  "build:esm": "tsc --project tsconfig/tsconfig.esm.json",
31
- "build": "npm run build:cjs && npm run build:esm",
31
+ "build": "node scripts/run-builds.cjs",
32
32
  "test": "vitest run",
33
33
  "test:watch": "vitest --watch",
34
- "prepublishOnly": "npm run build:cjs && npm run build:esm",
34
+ "prepublishOnly": "node scripts/run-builds.cjs",
35
35
  "lint": "eslint --ext .js,.ts,.vue ./",
36
36
  "lintfix": "eslint --fix --ext .js,.ts,.vue ./",
37
37
  "format": "eslint --fix --ext .js,.ts,.vue ./ && prettier --write \"**/*.{js,jsx,ts,tsx,vue,json,css,scss,md}\"",
38
- "cleanbuild": "rm -rf ./dist/ && eslint --fix --ext .js,.ts,.vue ./ && prettier --write \"**/*.{js,jsx,ts,tsx,vue,json,css,scss,md}\" && npm run build",
38
+ "cleanbuild": "rm -rf ./dist/ && eslint --fix --ext .js,.ts,.vue ./ && prettier --log-level warn --write \"**/*.{js,jsx,ts,tsx,vue,json,css,scss,md}\" && node scripts/run-builds.cjs",
39
39
  "pretty": "prettier --write \"**/*.{js,jsx,ts,tsx,vue,json,css,scss,md}\""
40
40
  },
41
41
  "dependencies": {
@@ -65,6 +65,11 @@
65
65
  "typescript": "^5.9.3",
66
66
  "vitest": "^3.2.4"
67
67
  },
68
+ "pnpm": {
69
+ "onlyBuiltDependencies": [
70
+ "esbuild"
71
+ ]
72
+ },
68
73
  "files": [
69
74
  "dist/",
70
75
  "package.json"