@sfxcode/nuxt-mongocamp-server 1.5.0 → 1.5.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/README.md CHANGED
@@ -30,6 +30,7 @@ export default defineNuxtConfig({
30
30
  | `paginationSize` | `number` | `500` | Default rows per page for search/list composables. Values below 10 fall back to the default. |
31
31
  | `refreshToken` | `boolean` | — | Whether the client auto-refreshes the session token on an interval after login. |
32
32
  | `tokenRefreshInterval` | `number` | `5000` | Refresh interval in ms. Values below 5000 fall back to the default. |
33
+ | `sessionMaxAge` | `number` | `2592000` (30 days) | Max age in seconds of the `mongocamp-session` cookie. Values <= 0 fall back to the default. |
33
34
 
34
35
  A missing `url` throws during `nuxi dev`/`nuxi build`/`nuxi generate` (not during `nuxi prepare`, so IDE/type-stub generation still works without a configured backend).
35
36
 
package/dist/module.d.mts CHANGED
@@ -7,6 +7,7 @@ interface ModuleOptions {
7
7
  paginationSize?: number;
8
8
  refreshToken: boolean;
9
9
  tokenRefreshInterval: number;
10
+ sessionMaxAge?: number;
10
11
  }
11
12
  declare module '@nuxt/schema' {
12
13
  interface PublicRuntimeConfig {
@@ -15,6 +16,7 @@ declare module '@nuxt/schema' {
15
16
  paginationSize: number;
16
17
  refreshToken: boolean;
17
18
  tokenRefreshInterval: number;
19
+ sessionMaxAge: number;
18
20
  };
19
21
  }
20
22
  interface RuntimeConfig {
package/dist/module.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@sfxcode/nuxt-mongocamp-server",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "configKey": "mongocamp",
5
5
  "compatibility": {
6
6
  "nuxt": ">=3.16.0"
7
7
  },
8
8
  "builder": {
9
- "@nuxt/module-builder": "1.0.2",
9
+ "@nuxt/module-builder": "1.0.3",
10
10
  "unbuild": "3.6.1"
11
11
  }
12
12
  }
package/dist/module.mjs CHANGED
@@ -4,7 +4,7 @@ import { consola } from 'consola';
4
4
  export * from '../dist/runtime/api/index.js';
5
5
 
6
6
  const name = "@sfxcode/nuxt-mongocamp-server";
7
- const version = "1.5.0";
7
+ const version = "1.5.1";
8
8
 
9
9
  const module$1 = defineNuxtModule({
10
10
  meta: {
@@ -30,13 +30,16 @@ const module$1 = defineNuxtModule({
30
30
  consola.warn(`[mongocamp] tokenRefreshInterval of ${options.tokenRefreshInterval} is below the minimum of 5000, falling back to 5000`);
31
31
  if (!options.tokenRefreshInterval || options.tokenRefreshInterval < 5e3)
32
32
  options.tokenRefreshInterval = 5e3;
33
+ if (!options.sessionMaxAge || options.sessionMaxAge <= 0)
34
+ options.sessionMaxAge = 60 * 60 * 24 * 30;
33
35
  nuxt.options.runtimeConfig.public.mongocamp = defu(
34
36
  nuxt.options.runtimeConfig.public.mongocamp,
35
37
  {
36
38
  url: options.url,
37
39
  paginationSize: options.paginationSize,
38
40
  refreshToken: options.refreshToken,
39
- tokenRefreshInterval: options.tokenRefreshInterval
41
+ tokenRefreshInterval: options.tokenRefreshInterval,
42
+ sessionMaxAge: options.sessionMaxAge
40
43
  }
41
44
  );
42
45
  nuxt.options.runtimeConfig.mongocampApiKey = nuxt.options.runtimeConfig.mongocampApiKey ?? options.apiKey ?? "";
@@ -1,6 +1,8 @@
1
- import { useCookie } from "#app";
1
+ import { useCookie, useRuntimeConfig } from "#app";
2
2
  export function useMongocampStorage() {
3
- return useCookie("mongocamp", {
4
- default: () => ({ token: "", profile: { user: "", isAdmin: false } })
3
+ const config = useRuntimeConfig();
4
+ return useCookie("mongocamp-session", {
5
+ default: () => ({ token: "", profile: { user: "", isAdmin: false } }),
6
+ maxAge: config.public.mongocamp?.sessionMaxAge ?? 60 * 60 * 24 * 30
5
7
  });
6
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sfxcode/nuxt-mongocamp-server",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -32,7 +32,7 @@
32
32
  "dev": "nuxi dev playground",
33
33
  "dev:build": "nuxi build playground",
34
34
  "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
35
- "release": "npm run lint && npm run test && npm run prepack && changelogen --minor --release && npm publish --access public && git push --follow-tags",
35
+ "release": "npm run lint && npm run test && npm run prepack && changelogen --patch --release && npm publish --access public && git push --follow-tags",
36
36
  "lint": "eslint .",
37
37
  "lint:fix": "eslint --fix .",
38
38
  "test": "vitest run",
@@ -43,24 +43,24 @@
43
43
  "api-codegen": "openapi-generator-cli generate -i ./openapi/docs.yaml -g typescript-fetch -o src/runtime/api --additional-properties=typescriptThreePlus=true,supportsES6=true"
44
44
  },
45
45
  "dependencies": {
46
- "@nuxt/kit": "^4.4.8",
47
- "@vueuse/nuxt": "^14.3.0",
46
+ "@nuxt/kit": "^4.5.1",
47
+ "@vueuse/nuxt": "^14.4.0",
48
48
  "consola": "^3.4.2",
49
49
  "defu": "^6.1.7"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@nuxt/devtools": "4.0.0-alpha.7",
53
53
  "@nuxt/eslint-config": "^1.16.0",
54
- "@nuxt/module-builder": "^1.0.2",
55
- "@nuxt/schema": "^4.4.8",
56
- "@nuxt/test-utils": "^4.0.3",
57
- "@openapitools/openapi-generator-cli": "^2.39.0",
58
- "@types/node": "^26.0.0",
54
+ "@nuxt/module-builder": "^1.0.3",
55
+ "@nuxt/schema": "^4.5.1",
56
+ "@nuxt/test-utils": "^4.1.0",
57
+ "@openapitools/openapi-generator-cli": "^2.40.1",
58
+ "@types/node": "^26.1.2",
59
59
  "@unocss/nuxt": "66.7.2",
60
60
  "changelogen": "^0.6.2",
61
- "eslint": "^10.5.0",
62
- "nuxt": "^4.4.8",
63
- "vitest": "^4.1.9"
61
+ "eslint": "^10.8.0",
62
+ "nuxt": "^4.5.1",
63
+ "vitest": "^4.1.10"
64
64
  },
65
65
  "packageManager": "pnpm@10.30.0+sha512.2b5753de015d480eeb88f5b5b61e0051f05b4301808a82ec8b840c9d2adf7748eb352c83f5c1593ca703ff1017295bc3fdd3119abb9686efc96b9fcb18200937"
66
66
  }