@adonisjs/session 7.7.0 → 8.0.0-next.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.
Files changed (85) hide show
  1. package/build/cookie-aLBno-zS.js +31 -0
  2. package/build/debug-Ba-0Cgn9.js +3 -0
  3. package/build/dynamodb-CU8BrQfU.js +72 -0
  4. package/build/factories/main.d.ts +1 -1
  5. package/build/factories/main.js +25 -49
  6. package/build/factories/session_middleware_factory.d.ts +2 -2
  7. package/build/file-CNxCs957.js +71 -0
  8. package/build/index.d.ts +6 -7
  9. package/build/index.js +5 -33
  10. package/build/providers/session_provider.d.ts +2 -3
  11. package/build/providers/session_provider.js +27 -64
  12. package/build/redis-Bcjum7z7.js +36 -0
  13. package/build/session-CBqhcnvJ.js +209 -0
  14. package/build/session-Cc1LPXRc.js +107 -0
  15. package/build/session_middleware-CS0R7hmq.js +27 -0
  16. package/build/src/client.d.ts +46 -10
  17. package/build/src/client.js +38 -9
  18. package/build/src/debug.d.ts +1 -1
  19. package/build/src/define_config.d.ts +49 -10
  20. package/build/src/errors.d.ts +20 -9
  21. package/build/src/plugins/edge.d.ts +16 -2
  22. package/build/src/plugins/edge.js +74 -126
  23. package/build/src/plugins/japa/api_client.d.ts +22 -4
  24. package/build/src/plugins/japa/api_client.js +76 -97
  25. package/build/src/plugins/japa/browser_client.d.ts +18 -4
  26. package/build/src/plugins/japa/browser_client.js +58 -82
  27. package/build/src/session.d.ts +170 -65
  28. package/build/src/session_middleware.d.ts +28 -5
  29. package/build/src/session_middleware.js +5 -11
  30. package/build/src/stores/cookie.d.ts +41 -7
  31. package/build/src/stores/dynamodb.d.ts +44 -8
  32. package/build/src/stores/file.d.ts +34 -8
  33. package/build/src/stores/memory.d.ts +32 -15
  34. package/build/src/stores/redis.d.ts +39 -16
  35. package/build/src/types.d.ts +151 -82
  36. package/build/src/types.js +1 -1
  37. package/build/src/values_store.d.ts +113 -21
  38. package/build/values_store-smX0sQBJ.js +78 -0
  39. package/package.json +57 -56
  40. package/build/chunk-5ECC6OWF.js +0 -8
  41. package/build/chunk-5ECC6OWF.js.map +0 -1
  42. package/build/chunk-6BSSM3HO.js +0 -44
  43. package/build/chunk-6BSSM3HO.js.map +0 -1
  44. package/build/chunk-G7KFHA57.js +0 -59
  45. package/build/chunk-G7KFHA57.js.map +0 -1
  46. package/build/chunk-GCO66PQD.js +0 -85
  47. package/build/chunk-GCO66PQD.js.map +0 -1
  48. package/build/chunk-PZ5AY32C.js +0 -10
  49. package/build/chunk-PZ5AY32C.js.map +0 -1
  50. package/build/chunk-Q24L5XPC.js +0 -186
  51. package/build/chunk-Q24L5XPC.js.map +0 -1
  52. package/build/chunk-TE5JP3SX.js +0 -151
  53. package/build/chunk-TE5JP3SX.js.map +0 -1
  54. package/build/chunk-V3OAEXMJ.js +0 -8
  55. package/build/chunk-V3OAEXMJ.js.map +0 -1
  56. package/build/chunk-XP3CBOXR.js +0 -414
  57. package/build/chunk-XP3CBOXR.js.map +0 -1
  58. package/build/commands/commands.json +0 -1
  59. package/build/commands/main.d.ts +0 -4
  60. package/build/commands/main.js +0 -36
  61. package/build/commands/make_session_table.d.ts +0 -9
  62. package/build/commands/make_session_table.js +0 -21
  63. package/build/commands/make_session_table.js.map +0 -1
  64. package/build/cookie-3C33DMWA.js +0 -57
  65. package/build/cookie-3C33DMWA.js.map +0 -1
  66. package/build/database-443FB7MM.js +0 -118
  67. package/build/database-443FB7MM.js.map +0 -1
  68. package/build/dynamodb-53YXEFIJ.js +0 -108
  69. package/build/dynamodb-53YXEFIJ.js.map +0 -1
  70. package/build/factories/main.js.map +0 -1
  71. package/build/file-K3GBSVSU.js +0 -117
  72. package/build/file-K3GBSVSU.js.map +0 -1
  73. package/build/index.js.map +0 -1
  74. package/build/make/migration/sessions.stub +0 -26
  75. package/build/providers/session_provider.js.map +0 -1
  76. package/build/redis-YGX2CNE2.js +0 -119
  77. package/build/redis-YGX2CNE2.js.map +0 -1
  78. package/build/src/client.js.map +0 -1
  79. package/build/src/plugins/edge.js.map +0 -1
  80. package/build/src/plugins/japa/api_client.js.map +0 -1
  81. package/build/src/plugins/japa/browser_client.js.map +0 -1
  82. package/build/src/session_collection.d.ts +0 -55
  83. package/build/src/session_middleware.js.map +0 -1
  84. package/build/src/stores/database.d.ts +0 -55
  85. package/build/src/types.js.map +0 -1
@@ -0,0 +1,31 @@
1
+ import { t as debug_default } from "./debug-Ba-0Cgn9.js";
2
+ var CookieStore = class {
3
+ #ctx;
4
+ #config;
5
+ constructor(config, ctx) {
6
+ this.#config = config;
7
+ this.#ctx = ctx;
8
+ debug_default("initiating cookie store %O", this.#config);
9
+ }
10
+ read(sessionId) {
11
+ debug_default("cookie store: reading session data %s", sessionId);
12
+ const cookieValue = this.#ctx.request.encryptedCookie(sessionId);
13
+ if (typeof cookieValue !== "object") return null;
14
+ return cookieValue;
15
+ }
16
+ write(sessionId, values) {
17
+ debug_default("cookie store: writing session data %s: %O", sessionId, values);
18
+ this.#ctx.response.encryptedCookie(sessionId, values, this.#config);
19
+ }
20
+ destroy(sessionId) {
21
+ debug_default("cookie store: destroying session data %s", sessionId);
22
+ if (this.#ctx.request.cookiesList()[sessionId]) this.#ctx.response.clearCookie(sessionId);
23
+ }
24
+ touch(sessionId) {
25
+ const value = this.read(sessionId);
26
+ debug_default("cookie store: touching session data %s", sessionId);
27
+ if (!value) return;
28
+ this.write(sessionId, value);
29
+ }
30
+ };
31
+ export { CookieStore };
@@ -0,0 +1,3 @@
1
+ import { debuglog } from "node:util";
2
+ var debug_default = debuglog("adonisjs:session");
3
+ export { debug_default as t };
@@ -0,0 +1,72 @@
1
+ import { t as debug_default } from "./debug-Ba-0Cgn9.js";
2
+ import string from "@adonisjs/core/helpers/string";
3
+ import { MessageBuilder } from "@adonisjs/core/helpers";
4
+ import { marshall, unmarshall } from "@aws-sdk/util-dynamodb";
5
+ import { DeleteItemCommand, GetItemCommand, PutItemCommand, UpdateItemCommand } from "@aws-sdk/client-dynamodb";
6
+ var DynamoDBStore = class {
7
+ #client;
8
+ #tableName;
9
+ #keyAttribute;
10
+ #ttlSeconds;
11
+ #valueAttribute = "value";
12
+ #expiresAtAttribute = "expires_at";
13
+ constructor(client, age, options) {
14
+ this.#client = client;
15
+ this.#tableName = options?.tableName ?? "Session";
16
+ this.#keyAttribute = options?.keyAttribute ?? "key";
17
+ this.#ttlSeconds = string.seconds.parse(age);
18
+ debug_default("initiating dynamodb store");
19
+ }
20
+ async read(sessionId) {
21
+ debug_default("dynamodb store: reading session data %s", sessionId);
22
+ const command = new GetItemCommand({
23
+ TableName: this.#tableName,
24
+ Key: marshall({ [this.#keyAttribute]: sessionId })
25
+ });
26
+ const response = await this.#client.send(command);
27
+ if (!response.Item) return null;
28
+ if (!response.Item[this.#valueAttribute]) return null;
29
+ const item = unmarshall(response.Item);
30
+ const contents = item[this.#valueAttribute];
31
+ const expiresAt = item[this.#expiresAtAttribute];
32
+ if (Date.now() > expiresAt) return null;
33
+ try {
34
+ return new MessageBuilder().verify(contents, sessionId);
35
+ } catch {
36
+ return null;
37
+ }
38
+ }
39
+ async write(sessionId, values) {
40
+ debug_default("dynamodb store: writing session data %s, %O", sessionId, values);
41
+ const message = new MessageBuilder().build(values, void 0, sessionId);
42
+ const command = new PutItemCommand({
43
+ TableName: this.#tableName,
44
+ Item: marshall({
45
+ [this.#keyAttribute]: sessionId,
46
+ [this.#valueAttribute]: message,
47
+ [this.#expiresAtAttribute]: Date.now() + this.#ttlSeconds * 1e3
48
+ })
49
+ });
50
+ await this.#client.send(command);
51
+ }
52
+ async destroy(sessionId) {
53
+ debug_default("dynamodb store: destroying session data %s", sessionId);
54
+ const command = new DeleteItemCommand({
55
+ TableName: this.#tableName,
56
+ Key: marshall({ [this.#keyAttribute]: sessionId })
57
+ });
58
+ await this.#client.send(command);
59
+ }
60
+ async touch(sessionId) {
61
+ debug_default("dynamodb store: touching session data %s", sessionId);
62
+ const command = new UpdateItemCommand({
63
+ TableName: this.#tableName,
64
+ Key: marshall({ [this.#keyAttribute]: sessionId }),
65
+ UpdateExpression: "SET #expires_at = :expires_at",
66
+ ExpressionAttributeNames: { "#expires_at": this.#expiresAtAttribute },
67
+ ExpressionAttributeValues: marshall({ ":expires_at": Date.now() + this.#ttlSeconds * 1e3 })
68
+ });
69
+ await this.#client.send(command);
70
+ }
71
+ };
72
+ export { DynamoDBStore };
@@ -1 +1 @@
1
- export { SessionMiddlewareFactory } from './session_middleware_factory.js';
1
+ export { SessionMiddlewareFactory } from './session_middleware_factory.ts';
@@ -1,53 +1,29 @@
1
- import {
2
- defineConfig
3
- } from "../chunk-Q24L5XPC.js";
4
- import "../chunk-V3OAEXMJ.js";
5
- import "../chunk-G7KFHA57.js";
6
- import {
7
- SessionMiddleware
8
- } from "../chunk-6BSSM3HO.js";
9
- import "../chunk-XP3CBOXR.js";
10
- import "../chunk-TE5JP3SX.js";
11
- import "../chunk-5ECC6OWF.js";
12
- import "../chunk-PZ5AY32C.js";
13
-
14
- // factories/session_middleware_factory.ts
1
+ import "../session-CBqhcnvJ.js";
2
+ import { t as defineConfig } from "../session-Cc1LPXRc.js";
3
+ import "../debug-Ba-0Cgn9.js";
4
+ import "../values_store-smX0sQBJ.js";
5
+ import { t as SessionMiddleware } from "../session_middleware-CS0R7hmq.js";
15
6
  import { Emitter } from "@adonisjs/core/events";
16
7
  import { AppFactory } from "@adonisjs/core/factories/app";
17
8
  var SessionMiddlewareFactory = class {
18
- #config = {
19
- store: "memory",
20
- stores: {}
21
- };
22
- #emitter;
23
- #getApp() {
24
- return new AppFactory().create(new URL("./", import.meta.url), () => {
25
- });
26
- }
27
- #getEmitter() {
28
- return this.#emitter || new Emitter(this.#getApp());
29
- }
30
- /**
31
- * Merge custom options
32
- */
33
- merge(options) {
34
- if (options.config) {
35
- this.#config = options.config;
36
- }
37
- if (options.emitter) {
38
- this.#emitter = options.emitter;
39
- }
40
- return this;
41
- }
42
- /**
43
- * Creates an instance of the session middleware
44
- */
45
- async create() {
46
- const config = await defineConfig(this.#config).resolver(this.#getApp());
47
- return new SessionMiddleware(config, this.#getEmitter());
48
- }
9
+ #config = {
10
+ store: "memory",
11
+ stores: {}
12
+ };
13
+ #emitter;
14
+ #getApp() {
15
+ return new AppFactory().create(new URL("./", import.meta.url), () => {});
16
+ }
17
+ #getEmitter() {
18
+ return this.#emitter || new Emitter(this.#getApp());
19
+ }
20
+ merge(options) {
21
+ if (options.config) this.#config = options.config;
22
+ if (options.emitter) this.#emitter = options.emitter;
23
+ return this;
24
+ }
25
+ async create() {
26
+ return new SessionMiddleware(await defineConfig(this.#config).resolver(this.#getApp()), this.#getEmitter());
27
+ }
49
28
  };
50
- export {
51
- SessionMiddlewareFactory
52
- };
53
- //# sourceMappingURL=main.js.map
29
+ export { SessionMiddlewareFactory };
@@ -1,7 +1,7 @@
1
1
  import { Emitter } from '@adonisjs/core/events';
2
2
  import type { EventsList } from '@adonisjs/core/types';
3
- import SessionMiddleware from '../src/session_middleware.js';
4
- import type { SessionConfig, SessionStoreFactory } from '../src/types.js';
3
+ import SessionMiddleware from '../src/session_middleware.ts';
4
+ import type { SessionConfig, SessionStoreFactory } from '../src/types.ts';
5
5
  /**
6
6
  * Exposes the API to create an instance of the session middleware
7
7
  * without additional plumbing
@@ -0,0 +1,71 @@
1
+ import { t as debug_default } from "./debug-Ba-0Cgn9.js";
2
+ import string from "@adonisjs/core/helpers/string";
3
+ import { MessageBuilder } from "@adonisjs/core/helpers";
4
+ import { dirname, join } from "node:path";
5
+ import { access, mkdir, readFile, rm, stat, utimes, writeFile } from "node:fs/promises";
6
+ var FileStore = class {
7
+ #config;
8
+ #age;
9
+ constructor(config, age) {
10
+ this.#config = config;
11
+ this.#age = age;
12
+ debug_default("initiating file store %O", this.#config);
13
+ }
14
+ #getFilePath(sessionId) {
15
+ return join(this.#config.location, `${sessionId}.txt`);
16
+ }
17
+ async #pathExists(path) {
18
+ try {
19
+ await access(path);
20
+ return true;
21
+ } catch {
22
+ return false;
23
+ }
24
+ }
25
+ async #stats(path) {
26
+ try {
27
+ return await stat(path);
28
+ } catch {
29
+ return null;
30
+ }
31
+ }
32
+ async #outputFile(path, contents) {
33
+ const pathDirname = dirname(path);
34
+ if (!await this.#pathExists(pathDirname)) await mkdir(pathDirname, { recursive: true });
35
+ await writeFile(path, contents, "utf-8");
36
+ }
37
+ async read(sessionId) {
38
+ const filePath = this.#getFilePath(sessionId);
39
+ debug_default("file store: reading session data %", sessionId);
40
+ const stats = await this.#stats(filePath);
41
+ if (!stats) return null;
42
+ const sessionWillExpireAt = stats.mtimeMs + string.seconds.parse(this.#age) * 1e3;
43
+ if (Date.now() > sessionWillExpireAt) {
44
+ debug_default("file store: expired session data %s", sessionId);
45
+ return null;
46
+ }
47
+ let contents = await readFile(filePath, "utf-8");
48
+ contents = contents.trim();
49
+ if (!contents) return null;
50
+ try {
51
+ return new MessageBuilder().verify(contents, sessionId);
52
+ } catch {
53
+ return null;
54
+ }
55
+ }
56
+ async write(sessionId, values) {
57
+ debug_default("file store: writing session data %s: %O", sessionId, values);
58
+ const filePath = this.#getFilePath(sessionId);
59
+ const message = new MessageBuilder().build(values, void 0, sessionId);
60
+ await this.#outputFile(filePath, message);
61
+ }
62
+ async destroy(sessionId) {
63
+ debug_default("file store: destroying session data %s", sessionId);
64
+ await rm(this.#getFilePath(sessionId), { force: true });
65
+ }
66
+ async touch(sessionId) {
67
+ debug_default("file store: touching session data %s", sessionId);
68
+ await utimes(this.#getFilePath(sessionId), /* @__PURE__ */ new Date(), /* @__PURE__ */ new Date());
69
+ }
70
+ };
71
+ export { FileStore };
package/build/index.d.ts CHANGED
@@ -6,10 +6,9 @@
6
6
  * For the full copyright and license information, please view the LICENSE
7
7
  * file that was distributed with this source code.
8
8
  */
9
- export * as errors from './src/errors.js';
10
- export { configure } from './configure.js';
11
- export { Session } from './src/session.js';
12
- export { stubsRoot } from './stubs/main.js';
13
- export { defineConfig, stores } from './src/define_config.js';
14
- export { SessionCollection } from './src/session_collection.js';
15
- export { ReadOnlyValuesStore, ValuesStore } from './src/values_store.js';
9
+ export * as errors from './src/errors.ts';
10
+ export { configure } from './configure.ts';
11
+ export { Session } from './src/session.ts';
12
+ export { stubsRoot } from './stubs/main.ts';
13
+ export { defineConfig, stores } from './src/define_config.ts';
14
+ export { ReadOnlyValuesStore, ValuesStore } from './src/values_store.ts';
package/build/index.js CHANGED
@@ -1,33 +1,5 @@
1
- import {
2
- configure,
3
- defineConfig,
4
- stores
5
- } from "./chunk-Q24L5XPC.js";
6
- import {
7
- stubsRoot
8
- } from "./chunk-V3OAEXMJ.js";
9
- import {
10
- SessionCollection
11
- } from "./chunk-G7KFHA57.js";
12
- import {
13
- Session,
14
- errors_exports
15
- } from "./chunk-XP3CBOXR.js";
16
- import {
17
- ReadOnlyValuesStore,
18
- ValuesStore
19
- } from "./chunk-TE5JP3SX.js";
20
- import "./chunk-5ECC6OWF.js";
21
- import "./chunk-PZ5AY32C.js";
22
- export {
23
- ReadOnlyValuesStore,
24
- Session,
25
- SessionCollection,
26
- ValuesStore,
27
- configure,
28
- defineConfig,
29
- errors_exports as errors,
30
- stores,
31
- stubsRoot
32
- };
33
- //# sourceMappingURL=index.js.map
1
+ import { n as errors_exports, t as Session } from "./session-CBqhcnvJ.js";
2
+ import { i as stubsRoot, n as stores, r as configure, t as defineConfig } from "./session-Cc1LPXRc.js";
3
+ import "./debug-Ba-0Cgn9.js";
4
+ import { n as ValuesStore, t as ReadOnlyValuesStore } from "./values_store-smX0sQBJ.js";
5
+ export { ReadOnlyValuesStore, Session, ValuesStore, configure, defineConfig, errors_exports as errors, stores, stubsRoot };
@@ -1,5 +1,5 @@
1
1
  import type { ApplicationService } from '@adonisjs/core/types';
2
- import type { Session } from '../src/session.js';
2
+ import type { Session } from '../src/session.ts';
3
3
  /**
4
4
  * Events emitted by the session class
5
5
  */
@@ -23,7 +23,6 @@ declare module '@adonisjs/core/types' {
23
23
  * AdonisJS application
24
24
  */
25
25
  export default class SessionProvider {
26
- #private;
27
26
  protected app: ApplicationService;
28
27
  constructor(app: ApplicationService);
29
28
  /**
@@ -32,7 +31,7 @@ export default class SessionProvider {
32
31
  */
33
32
  protected registerEdgePlugin(): Promise<void>;
34
33
  /**
35
- * Registering bindings
34
+ * Registering muddleware
36
35
  */
37
36
  register(): void;
38
37
  /**
@@ -1,67 +1,30 @@
1
- import {
2
- SessionCollection
3
- } from "../chunk-G7KFHA57.js";
4
- import {
5
- SessionMiddleware
6
- } from "../chunk-6BSSM3HO.js";
7
- import "../chunk-XP3CBOXR.js";
8
- import "../chunk-TE5JP3SX.js";
9
- import "../chunk-5ECC6OWF.js";
10
- import "../chunk-PZ5AY32C.js";
11
-
12
- // providers/session_provider.ts
1
+ import "../session-CBqhcnvJ.js";
2
+ import "../debug-Ba-0Cgn9.js";
3
+ import "../values_store-smX0sQBJ.js";
4
+ import { t as SessionMiddleware } from "../session_middleware-CS0R7hmq.js";
5
+ import { RuntimeException } from "@adonisjs/core/exceptions";
13
6
  import { configProvider } from "@adonisjs/core";
14
- import { RuntimeException } from "@poppinss/utils";
15
7
  var SessionProvider = class {
16
- constructor(app) {
17
- this.app = app;
18
- }
19
- /**
20
- * Registers edge plugin when edge is installed
21
- * in the user application.
22
- */
23
- async registerEdgePlugin() {
24
- if (this.app.usingEdgeJS) {
25
- const edge = await import("edge.js");
26
- const { edgePluginSession } = await import("../src/plugins/edge.js");
27
- edge.default.use(edgePluginSession);
28
- }
29
- }
30
- /**
31
- * Resolves the session config from the config provider
32
- */
33
- async #resolveConfig() {
34
- const sessionConfigProvider = this.app.config.get("session", {});
35
- const config = await configProvider.resolve(this.app, sessionConfigProvider);
36
- if (!config) {
37
- throw new RuntimeException(
38
- 'Invalid "config/session.ts" file. Make sure you are using the "defineConfig" method'
39
- );
40
- }
41
- return config;
42
- }
43
- /**
44
- * Registering bindings
45
- */
46
- register() {
47
- this.app.container.singleton(SessionMiddleware, async (resolver) => {
48
- const config = await this.#resolveConfig();
49
- const emitter = await resolver.make("emitter");
50
- return new SessionMiddleware(config, emitter);
51
- });
52
- this.app.container.singleton(SessionCollection, async () => {
53
- const config = await this.#resolveConfig();
54
- return new SessionCollection(config);
55
- });
56
- }
57
- /**
58
- * Adding edge tags (if edge is installed)
59
- */
60
- async boot() {
61
- await this.registerEdgePlugin();
62
- }
8
+ constructor(app) {
9
+ this.app = app;
10
+ }
11
+ async registerEdgePlugin() {
12
+ if (this.app.usingEdgeJS) {
13
+ const edge = await import("edge.js");
14
+ const { edgePluginSession } = await import("../src/plugins/edge.js");
15
+ edge.default.use(edgePluginSession);
16
+ }
17
+ }
18
+ register() {
19
+ this.app.container.singleton(SessionMiddleware, async (resolver) => {
20
+ const sessionConfigProvider = this.app.config.get("session", {});
21
+ const config = await configProvider.resolve(this.app, sessionConfigProvider);
22
+ if (!config) throw new RuntimeException("Invalid \"config/session.ts\" file. Make sure you are using the \"defineConfig\" method");
23
+ return new SessionMiddleware(config, await resolver.make("emitter"));
24
+ });
25
+ }
26
+ async boot() {
27
+ await this.registerEdgePlugin();
28
+ }
63
29
  };
64
- export {
65
- SessionProvider as default
66
- };
67
- //# sourceMappingURL=session_provider.js.map
30
+ export { SessionProvider as default };
@@ -0,0 +1,36 @@
1
+ import { t as debug_default } from "./debug-Ba-0Cgn9.js";
2
+ import string from "@adonisjs/core/helpers/string";
3
+ import { MessageBuilder } from "@adonisjs/core/helpers";
4
+ var RedisStore = class {
5
+ #connection;
6
+ #ttlSeconds;
7
+ constructor(connection, age) {
8
+ this.#connection = connection;
9
+ this.#ttlSeconds = string.seconds.parse(age);
10
+ debug_default("initiating redis store");
11
+ }
12
+ async read(sessionId) {
13
+ debug_default("redis store: reading session data %s", sessionId);
14
+ const contents = await this.#connection.get(sessionId);
15
+ if (!contents) return null;
16
+ try {
17
+ return new MessageBuilder().verify(contents, sessionId);
18
+ } catch {
19
+ return null;
20
+ }
21
+ }
22
+ async write(sessionId, values) {
23
+ debug_default("redis store: writing session data %s, %O", sessionId, values);
24
+ const message = new MessageBuilder().build(values, void 0, sessionId);
25
+ await this.#connection.setex(sessionId, this.#ttlSeconds, message);
26
+ }
27
+ async destroy(sessionId) {
28
+ debug_default("redis store: destroying session data %s", sessionId);
29
+ await this.#connection.del(sessionId);
30
+ }
31
+ async touch(sessionId) {
32
+ debug_default("redis store: touching session data %s", sessionId);
33
+ await this.#connection.expire(sessionId, this.#ttlSeconds);
34
+ }
35
+ };
36
+ export { RedisStore };