@h3ravel/session 0.1.0-alpha.9 → 1.29.0-alpha.11
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/dist/index.cjs +43 -237
- package/dist/index.d.ts +2 -2
- package/dist/index.js +11 -201
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
2
3
|
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -6,16 +7,12 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
6
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
9
|
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
}
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
+
get: ((k) => from[k]).bind(null, key),
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
19
16
|
}
|
|
20
17
|
return to;
|
|
21
18
|
};
|
|
@@ -23,25 +20,24 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
23
20
|
value: mod,
|
|
24
21
|
enumerable: true
|
|
25
22
|
}) : target, mod));
|
|
26
|
-
|
|
27
23
|
//#endregion
|
|
28
|
-
let
|
|
29
|
-
let
|
|
24
|
+
let _h3ravel_support = require("@h3ravel/support");
|
|
25
|
+
let _h3ravel_database = require("@h3ravel/database");
|
|
30
26
|
let crypto$1 = require("crypto");
|
|
31
|
-
crypto$1 = __toESM(crypto$1);
|
|
32
|
-
let
|
|
33
|
-
let
|
|
27
|
+
crypto$1 = __toESM(crypto$1, 1);
|
|
28
|
+
let _h3ravel_foundation = require("@h3ravel/foundation");
|
|
29
|
+
let _h3ravel_contracts = require("@h3ravel/contracts");
|
|
34
30
|
let fs = require("fs");
|
|
35
31
|
let path = require("path");
|
|
36
|
-
path = __toESM(path);
|
|
37
|
-
let
|
|
38
|
-
|
|
32
|
+
path = __toESM(path, 1);
|
|
33
|
+
let _h3ravel_musket = require("@h3ravel/musket");
|
|
34
|
+
let h3 = require("h3");
|
|
39
35
|
//#region src/Encryption.ts
|
|
40
36
|
var Encryption = class {
|
|
41
37
|
key;
|
|
42
38
|
constructor() {
|
|
43
39
|
const appKey = process.env.APP_KEY;
|
|
44
|
-
if (!appKey) throw new
|
|
40
|
+
if (!appKey) throw new _h3ravel_foundation.ConfigException("APP_KEY not set in env");
|
|
45
41
|
this.key = (0, crypto$1.createHash)("sha256").update(Buffer.from(appKey, "base64")).digest();
|
|
46
42
|
}
|
|
47
43
|
/**
|
|
@@ -70,7 +66,6 @@ var Encryption = class {
|
|
|
70
66
|
}
|
|
71
67
|
}
|
|
72
68
|
};
|
|
73
|
-
|
|
74
69
|
//#endregion
|
|
75
70
|
//#region src/FlashBag.ts
|
|
76
71
|
/**
|
|
@@ -201,7 +196,6 @@ var FlashBag = class {
|
|
|
201
196
|
this.flashData.old = {};
|
|
202
197
|
}
|
|
203
198
|
};
|
|
204
|
-
|
|
205
199
|
//#endregion
|
|
206
200
|
//#region src/drivers/Driver.ts
|
|
207
201
|
/**
|
|
@@ -209,7 +203,7 @@ var FlashBag = class {
|
|
|
209
203
|
*
|
|
210
204
|
* Base Session driver.
|
|
211
205
|
*/
|
|
212
|
-
var Driver = class extends
|
|
206
|
+
var Driver = class extends _h3ravel_contracts.ISessionDriver {
|
|
213
207
|
encryptor = new Encryption();
|
|
214
208
|
sessionId;
|
|
215
209
|
flashBag = new FlashBag();
|
|
@@ -244,7 +238,7 @@ var Driver = class extends __h3ravel_contracts.ISessionDriver {
|
|
|
244
238
|
* @returns
|
|
245
239
|
*/
|
|
246
240
|
get(key, defaultValue) {
|
|
247
|
-
return (0,
|
|
241
|
+
return (0, _h3ravel_support.safeDot)(this.getAll(), key) || defaultValue;
|
|
248
242
|
}
|
|
249
243
|
/**
|
|
250
244
|
* Store a value in the session
|
|
@@ -264,7 +258,7 @@ var Driver = class extends __h3ravel_contracts.ISessionDriver {
|
|
|
264
258
|
*/
|
|
265
259
|
put(key, value) {
|
|
266
260
|
const payload = this.fetchPayload();
|
|
267
|
-
(0,
|
|
261
|
+
(0, _h3ravel_support.setNested)(payload, key, value);
|
|
268
262
|
return this.savePayload(payload);
|
|
269
263
|
}
|
|
270
264
|
/**
|
|
@@ -451,7 +445,6 @@ var Driver = class extends __h3ravel_contracts.ISessionDriver {
|
|
|
451
445
|
return this.savePayload({});
|
|
452
446
|
}
|
|
453
447
|
};
|
|
454
|
-
|
|
455
448
|
//#endregion
|
|
456
449
|
//#region src/drivers/DatabaseDriver.ts
|
|
457
450
|
/**
|
|
@@ -461,6 +454,8 @@ var Driver = class extends __h3ravel_contracts.ISessionDriver {
|
|
|
461
454
|
* The `payload` column contains all session key/value pairs as JSON.
|
|
462
455
|
*/
|
|
463
456
|
var DatabaseDriver = class extends Driver {
|
|
457
|
+
sessionId;
|
|
458
|
+
table;
|
|
464
459
|
/**
|
|
465
460
|
*
|
|
466
461
|
* @param sessionId The current session ID
|
|
@@ -475,7 +470,7 @@ var DatabaseDriver = class extends Driver {
|
|
|
475
470
|
* Get the query builder for this table
|
|
476
471
|
*/
|
|
477
472
|
query() {
|
|
478
|
-
return
|
|
473
|
+
return _h3ravel_database.DB.table(this.table).where("id", this.sessionId);
|
|
479
474
|
}
|
|
480
475
|
/**
|
|
481
476
|
* Fetch the session payload
|
|
@@ -501,7 +496,7 @@ var DatabaseDriver = class extends Driver {
|
|
|
501
496
|
payload: encrypted,
|
|
502
497
|
last_activity: now
|
|
503
498
|
});
|
|
504
|
-
else await
|
|
499
|
+
else await _h3ravel_database.DB.table(this.table).insert({
|
|
505
500
|
id: this.sessionId,
|
|
506
501
|
payload: encrypted,
|
|
507
502
|
last_activity: now
|
|
@@ -526,7 +521,7 @@ var DatabaseDriver = class extends Driver {
|
|
|
526
521
|
* Get a value from the session
|
|
527
522
|
*/
|
|
528
523
|
async get(key, defaultValue) {
|
|
529
|
-
return (0,
|
|
524
|
+
return (0, _h3ravel_support.safeDot)(await this.getAll(), key) || defaultValue;
|
|
530
525
|
}
|
|
531
526
|
/**
|
|
532
527
|
* Set one or multiple session values
|
|
@@ -541,7 +536,7 @@ var DatabaseDriver = class extends Driver {
|
|
|
541
536
|
*/
|
|
542
537
|
async put(key, value) {
|
|
543
538
|
const payload = await this.fetchPayload();
|
|
544
|
-
(0,
|
|
539
|
+
(0, _h3ravel_support.setNested)(payload, key, value);
|
|
545
540
|
await this.savePayload(payload);
|
|
546
541
|
}
|
|
547
542
|
/**
|
|
@@ -674,7 +669,7 @@ var DatabaseDriver = class extends Driver {
|
|
|
674
669
|
* Invalidate the session and regenerate
|
|
675
670
|
*/
|
|
676
671
|
async invalidate() {
|
|
677
|
-
await
|
|
672
|
+
await _h3ravel_database.DB.table(this.table).where("id", this.sessionId).delete();
|
|
678
673
|
this.sessionId = crypto.randomUUID();
|
|
679
674
|
this.flashBag = new FlashBag();
|
|
680
675
|
await this.savePayload({});
|
|
@@ -686,7 +681,6 @@ var DatabaseDriver = class extends Driver {
|
|
|
686
681
|
this.flashBag.ageFlashData();
|
|
687
682
|
}
|
|
688
683
|
};
|
|
689
|
-
|
|
690
684
|
//#endregion
|
|
691
685
|
//#region src/drivers/FileDriver.ts
|
|
692
686
|
/**
|
|
@@ -697,6 +691,9 @@ var DatabaseDriver = class extends Driver {
|
|
|
697
691
|
* Ideal for local development or low-scale deployments.
|
|
698
692
|
*/
|
|
699
693
|
var FileDriver = class extends Driver {
|
|
694
|
+
sessionId;
|
|
695
|
+
sessionDir;
|
|
696
|
+
cwd;
|
|
700
697
|
constructor(sessionId, sessionDir = path.default.resolve(".sessions"), cwd = process.cwd()) {
|
|
701
698
|
super();
|
|
702
699
|
this.sessionId = sessionId;
|
|
@@ -758,7 +755,6 @@ var FileDriver = class extends Driver {
|
|
|
758
755
|
this.savePayload({});
|
|
759
756
|
}
|
|
760
757
|
};
|
|
761
|
-
|
|
762
758
|
//#endregion
|
|
763
759
|
//#region src/drivers/MemoryDriver.ts
|
|
764
760
|
/**
|
|
@@ -768,6 +764,7 @@ var FileDriver = class extends Driver {
|
|
|
768
764
|
* Intended for tests, local development, or short-lived apps.
|
|
769
765
|
*/
|
|
770
766
|
var MemoryDriver = class MemoryDriver extends Driver {
|
|
767
|
+
sessionId;
|
|
771
768
|
static store = {};
|
|
772
769
|
constructor(sessionId) {
|
|
773
770
|
super();
|
|
@@ -801,13 +798,15 @@ var MemoryDriver = class MemoryDriver extends Driver {
|
|
|
801
798
|
this.savePayload({});
|
|
802
799
|
}
|
|
803
800
|
};
|
|
804
|
-
|
|
805
801
|
//#endregion
|
|
806
802
|
//#region src/drivers/RedisDriver.ts
|
|
807
803
|
/**
|
|
808
804
|
* RedisDriver (placeholder)
|
|
809
805
|
*/
|
|
810
806
|
var RedisDriver = class extends Driver {
|
|
807
|
+
sessionId;
|
|
808
|
+
redisClient;
|
|
809
|
+
prefix;
|
|
811
810
|
static store = {};
|
|
812
811
|
constructor(sessionId, redisClient, prefix) {
|
|
813
812
|
super();
|
|
@@ -837,7 +836,6 @@ var RedisDriver = class extends Driver {
|
|
|
837
836
|
this.savePayload({});
|
|
838
837
|
}
|
|
839
838
|
};
|
|
840
|
-
|
|
841
839
|
//#endregion
|
|
842
840
|
//#region src/adapters.ts
|
|
843
841
|
/**
|
|
@@ -870,10 +868,9 @@ const redisBuilder = (sessionId, options = {}) => {
|
|
|
870
868
|
const client = options.client;
|
|
871
869
|
return new RedisDriver(sessionId, client, options.prefix ?? "h3ravel:sessions:");
|
|
872
870
|
};
|
|
873
|
-
|
|
874
871
|
//#endregion
|
|
875
872
|
//#region src/Commands/MakeSessionTableCommand.ts
|
|
876
|
-
var MakeSessionTableCommand = class extends
|
|
873
|
+
var MakeSessionTableCommand = class extends _h3ravel_musket.Command {
|
|
877
874
|
/**
|
|
878
875
|
* The name and signature of the console command.
|
|
879
876
|
*
|
|
@@ -887,8 +884,8 @@ var MakeSessionTableCommand = class extends __h3ravel_musket.Command {
|
|
|
887
884
|
*/
|
|
888
885
|
description = "Create a migration for the session database table";
|
|
889
886
|
async handle() {
|
|
890
|
-
await
|
|
891
|
-
if (!exists) return
|
|
887
|
+
await _h3ravel_database.DB.instance().schema.hasTable("sessions").then(async function(exists) {
|
|
888
|
+
if (!exists) return _h3ravel_database.DB.instance().schema.createTable("sessions", (table) => {
|
|
892
889
|
table.string("id", 255).primary();
|
|
893
890
|
table.bigInteger("user_id").nullable().index();
|
|
894
891
|
table.string("ip_address", 45).nullable();
|
|
@@ -900,194 +897,6 @@ var MakeSessionTableCommand = class extends __h3ravel_musket.Command {
|
|
|
900
897
|
this.info("INFO: session table created successfully.");
|
|
901
898
|
}
|
|
902
899
|
};
|
|
903
|
-
|
|
904
|
-
//#endregion
|
|
905
|
-
//#region ../../node_modules/.pnpm/h3@2.0.1-rc.5/node_modules/h3/dist/h3.mjs
|
|
906
|
-
const kEventNS = "h3.internal.event.";
|
|
907
|
-
const kEventRes = /* @__PURE__ */ Symbol.for(`${kEventNS}res`);
|
|
908
|
-
const kEventResHeaders = /* @__PURE__ */ Symbol.for(`${kEventNS}res.headers`);
|
|
909
|
-
function parse(str, options) {
|
|
910
|
-
if (typeof str !== "string") throw new TypeError("argument str must be a string");
|
|
911
|
-
const obj = {};
|
|
912
|
-
const opt = options || {};
|
|
913
|
-
const dec = opt.decode || decode;
|
|
914
|
-
let index = 0;
|
|
915
|
-
while (index < str.length) {
|
|
916
|
-
const eqIdx = str.indexOf("=", index);
|
|
917
|
-
if (eqIdx === -1) break;
|
|
918
|
-
let endIdx = str.indexOf(";", index);
|
|
919
|
-
if (endIdx === -1) endIdx = str.length;
|
|
920
|
-
else if (endIdx < eqIdx) {
|
|
921
|
-
index = str.lastIndexOf(";", eqIdx - 1) + 1;
|
|
922
|
-
continue;
|
|
923
|
-
}
|
|
924
|
-
const key = str.slice(index, eqIdx).trim();
|
|
925
|
-
if (opt?.filter && !opt?.filter(key)) {
|
|
926
|
-
index = endIdx + 1;
|
|
927
|
-
continue;
|
|
928
|
-
}
|
|
929
|
-
if (void 0 === obj[key]) {
|
|
930
|
-
let val = str.slice(eqIdx + 1, endIdx).trim();
|
|
931
|
-
if (val.codePointAt(0) === 34) val = val.slice(1, -1);
|
|
932
|
-
obj[key] = tryDecode(val, dec);
|
|
933
|
-
}
|
|
934
|
-
index = endIdx + 1;
|
|
935
|
-
}
|
|
936
|
-
return obj;
|
|
937
|
-
}
|
|
938
|
-
function decode(str) {
|
|
939
|
-
return str.includes("%") ? decodeURIComponent(str) : str;
|
|
940
|
-
}
|
|
941
|
-
function tryDecode(str, decode2) {
|
|
942
|
-
try {
|
|
943
|
-
return decode2(str);
|
|
944
|
-
} catch {
|
|
945
|
-
return str;
|
|
946
|
-
}
|
|
947
|
-
}
|
|
948
|
-
const fieldContentRegExp = /^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;
|
|
949
|
-
function serialize(name, value, options) {
|
|
950
|
-
const opt = options || {};
|
|
951
|
-
const enc = opt.encode || encodeURIComponent;
|
|
952
|
-
if (typeof enc !== "function") throw new TypeError("option encode is invalid");
|
|
953
|
-
if (!fieldContentRegExp.test(name)) throw new TypeError("argument name is invalid");
|
|
954
|
-
const encodedValue = enc(value);
|
|
955
|
-
if (encodedValue && !fieldContentRegExp.test(encodedValue)) throw new TypeError("argument val is invalid");
|
|
956
|
-
let str = name + "=" + encodedValue;
|
|
957
|
-
if (void 0 !== opt.maxAge && opt.maxAge !== null) {
|
|
958
|
-
const maxAge = opt.maxAge - 0;
|
|
959
|
-
if (Number.isNaN(maxAge) || !Number.isFinite(maxAge)) throw new TypeError("option maxAge is invalid");
|
|
960
|
-
str += "; Max-Age=" + Math.floor(maxAge);
|
|
961
|
-
}
|
|
962
|
-
if (opt.domain) {
|
|
963
|
-
if (!fieldContentRegExp.test(opt.domain)) throw new TypeError("option domain is invalid");
|
|
964
|
-
str += "; Domain=" + opt.domain;
|
|
965
|
-
}
|
|
966
|
-
if (opt.path) {
|
|
967
|
-
if (!fieldContentRegExp.test(opt.path)) throw new TypeError("option path is invalid");
|
|
968
|
-
str += "; Path=" + opt.path;
|
|
969
|
-
}
|
|
970
|
-
if (opt.expires) {
|
|
971
|
-
if (!isDate(opt.expires) || Number.isNaN(opt.expires.valueOf())) throw new TypeError("option expires is invalid");
|
|
972
|
-
str += "; Expires=" + opt.expires.toUTCString();
|
|
973
|
-
}
|
|
974
|
-
if (opt.httpOnly) str += "; HttpOnly";
|
|
975
|
-
if (opt.secure) str += "; Secure";
|
|
976
|
-
if (opt.priority) switch (typeof opt.priority === "string" ? opt.priority.toLowerCase() : opt.priority) {
|
|
977
|
-
case "low":
|
|
978
|
-
str += "; Priority=Low";
|
|
979
|
-
break;
|
|
980
|
-
case "medium":
|
|
981
|
-
str += "; Priority=Medium";
|
|
982
|
-
break;
|
|
983
|
-
case "high":
|
|
984
|
-
str += "; Priority=High";
|
|
985
|
-
break;
|
|
986
|
-
default: throw new TypeError("option priority is invalid");
|
|
987
|
-
}
|
|
988
|
-
if (opt.sameSite) switch (typeof opt.sameSite === "string" ? opt.sameSite.toLowerCase() : opt.sameSite) {
|
|
989
|
-
case true:
|
|
990
|
-
str += "; SameSite=Strict";
|
|
991
|
-
break;
|
|
992
|
-
case "lax":
|
|
993
|
-
str += "; SameSite=Lax";
|
|
994
|
-
break;
|
|
995
|
-
case "strict":
|
|
996
|
-
str += "; SameSite=Strict";
|
|
997
|
-
break;
|
|
998
|
-
case "none":
|
|
999
|
-
str += "; SameSite=None";
|
|
1000
|
-
break;
|
|
1001
|
-
default: throw new TypeError("option sameSite is invalid");
|
|
1002
|
-
}
|
|
1003
|
-
if (opt.partitioned) str += "; Partitioned";
|
|
1004
|
-
return str;
|
|
1005
|
-
}
|
|
1006
|
-
function isDate(val) {
|
|
1007
|
-
return Object.prototype.toString.call(val) === "[object Date]" || val instanceof Date;
|
|
1008
|
-
}
|
|
1009
|
-
function parseSetCookie(setCookieValue, options) {
|
|
1010
|
-
const parts = (setCookieValue || "").split(";").filter((str) => typeof str === "string" && !!str.trim());
|
|
1011
|
-
const parsed = _parseNameValuePair(parts.shift() || "");
|
|
1012
|
-
const name = parsed.name;
|
|
1013
|
-
let value = parsed.value;
|
|
1014
|
-
try {
|
|
1015
|
-
value = options?.decode === false ? value : (options?.decode || decodeURIComponent)(value);
|
|
1016
|
-
} catch {}
|
|
1017
|
-
const cookie = {
|
|
1018
|
-
name,
|
|
1019
|
-
value
|
|
1020
|
-
};
|
|
1021
|
-
for (const part of parts) {
|
|
1022
|
-
const sides = part.split("=");
|
|
1023
|
-
const partKey = (sides.shift() || "").trimStart().toLowerCase();
|
|
1024
|
-
const partValue = sides.join("=");
|
|
1025
|
-
switch (partKey) {
|
|
1026
|
-
case "expires":
|
|
1027
|
-
cookie.expires = new Date(partValue);
|
|
1028
|
-
break;
|
|
1029
|
-
case "max-age":
|
|
1030
|
-
cookie.maxAge = Number.parseInt(partValue, 10);
|
|
1031
|
-
break;
|
|
1032
|
-
case "secure":
|
|
1033
|
-
cookie.secure = true;
|
|
1034
|
-
break;
|
|
1035
|
-
case "httponly":
|
|
1036
|
-
cookie.httpOnly = true;
|
|
1037
|
-
break;
|
|
1038
|
-
case "samesite":
|
|
1039
|
-
cookie.sameSite = partValue;
|
|
1040
|
-
break;
|
|
1041
|
-
default: cookie[partKey] = partValue;
|
|
1042
|
-
}
|
|
1043
|
-
}
|
|
1044
|
-
return cookie;
|
|
1045
|
-
}
|
|
1046
|
-
function _parseNameValuePair(nameValuePairStr) {
|
|
1047
|
-
let name = "";
|
|
1048
|
-
let value = "";
|
|
1049
|
-
const nameValueArr = nameValuePairStr.split("=");
|
|
1050
|
-
if (nameValueArr.length > 1) {
|
|
1051
|
-
name = nameValueArr.shift();
|
|
1052
|
-
value = nameValueArr.join("=");
|
|
1053
|
-
} else value = nameValuePairStr;
|
|
1054
|
-
return {
|
|
1055
|
-
name,
|
|
1056
|
-
value
|
|
1057
|
-
};
|
|
1058
|
-
}
|
|
1059
|
-
function parseCookies(event) {
|
|
1060
|
-
return parse(event.req.headers.get("cookie") || "");
|
|
1061
|
-
}
|
|
1062
|
-
function getCookie(event, name) {
|
|
1063
|
-
return parseCookies(event)[name];
|
|
1064
|
-
}
|
|
1065
|
-
function setCookie(event, name, value, options) {
|
|
1066
|
-
const newCookie = serialize(name, value, {
|
|
1067
|
-
path: "/",
|
|
1068
|
-
...options
|
|
1069
|
-
});
|
|
1070
|
-
const currentCookies = event.res.headers.getSetCookie();
|
|
1071
|
-
if (currentCookies.length === 0) {
|
|
1072
|
-
event.res.headers.set("set-cookie", newCookie);
|
|
1073
|
-
return;
|
|
1074
|
-
}
|
|
1075
|
-
const newCookieKey = _getDistinctCookieKey(name, options || {});
|
|
1076
|
-
event.res.headers.delete("set-cookie");
|
|
1077
|
-
for (const cookie of currentCookies) {
|
|
1078
|
-
if (_getDistinctCookieKey(cookie.split("=")?.[0], parseSetCookie(cookie)) === newCookieKey) continue;
|
|
1079
|
-
event.res.headers.append("set-cookie", cookie);
|
|
1080
|
-
}
|
|
1081
|
-
event.res.headers.append("set-cookie", newCookie);
|
|
1082
|
-
}
|
|
1083
|
-
function _getDistinctCookieKey(name, options) {
|
|
1084
|
-
return [
|
|
1085
|
-
name,
|
|
1086
|
-
options.domain || "",
|
|
1087
|
-
options.path || "/"
|
|
1088
|
-
].join(";");
|
|
1089
|
-
}
|
|
1090
|
-
|
|
1091
900
|
//#endregion
|
|
1092
901
|
//#region src/SessionStore.ts
|
|
1093
902
|
/**
|
|
@@ -1115,7 +924,6 @@ var SessionStore = class {
|
|
|
1115
924
|
return builder(sessionId, options);
|
|
1116
925
|
}
|
|
1117
926
|
};
|
|
1118
|
-
|
|
1119
927
|
//#endregion
|
|
1120
928
|
//#region src/SessionManager.ts
|
|
1121
929
|
/**
|
|
@@ -1124,7 +932,7 @@ var SessionStore = class {
|
|
|
1124
932
|
* Handles session initialization, ID generation, and encryption.
|
|
1125
933
|
* Each request gets a unique session namespace tied to its ID.
|
|
1126
934
|
*/
|
|
1127
|
-
var SessionManager = class SessionManager extends
|
|
935
|
+
var SessionManager = class SessionManager extends _h3ravel_contracts.ISessionManager {
|
|
1128
936
|
app;
|
|
1129
937
|
ctx;
|
|
1130
938
|
driver;
|
|
@@ -1135,7 +943,7 @@ var SessionManager = class SessionManager extends __h3ravel_contracts.ISessionMa
|
|
|
1135
943
|
constructor(app, driverName = "file", driverOptions = {}) {
|
|
1136
944
|
super();
|
|
1137
945
|
this.appKey = process.env.APP_KEY;
|
|
1138
|
-
if (app instanceof
|
|
946
|
+
if (app instanceof _h3ravel_contracts.IHttpContext) {
|
|
1139
947
|
this.request = app.request;
|
|
1140
948
|
this.ctx = app;
|
|
1141
949
|
this.app = app.app;
|
|
@@ -1178,10 +986,10 @@ var SessionManager = class SessionManager extends __h3ravel_contracts.ISessionMa
|
|
|
1178
986
|
* Resolve the session ID from cookie, header, or create a new one.
|
|
1179
987
|
*/
|
|
1180
988
|
resolveSessionId() {
|
|
1181
|
-
const cookieSession = getCookie(this.ctx.event, "h3ravel_session");
|
|
989
|
+
const cookieSession = (0, h3.getCookie)(this.ctx.event, "h3ravel_session");
|
|
1182
990
|
if (cookieSession) return cookieSession;
|
|
1183
991
|
const newId = this.generateSessionId();
|
|
1184
|
-
setCookie(this.ctx.event, "h3ravel_session", newId, {
|
|
992
|
+
(0, h3.setCookie)(this.ctx.event, "h3ravel_session", newId, {
|
|
1185
993
|
httpOnly: true,
|
|
1186
994
|
secure: true,
|
|
1187
995
|
sameSite: "lax",
|
|
@@ -1392,10 +1200,9 @@ var SessionManager = class SessionManager extends __h3ravel_contracts.ISessionMa
|
|
|
1392
1200
|
return this.driver.ageFlashData();
|
|
1393
1201
|
}
|
|
1394
1202
|
};
|
|
1395
|
-
|
|
1396
1203
|
//#endregion
|
|
1397
1204
|
//#region src/Providers/SessionServiceProvider.ts
|
|
1398
|
-
var SessionServiceProvider = class extends
|
|
1205
|
+
var SessionServiceProvider = class extends _h3ravel_support.ServiceProvider {
|
|
1399
1206
|
static priority = 895;
|
|
1400
1207
|
static order = "before:HttpServiceProvider";
|
|
1401
1208
|
register() {
|
|
@@ -1415,7 +1222,6 @@ var SessionServiceProvider = class extends __h3ravel_support.ServiceProvider {
|
|
|
1415
1222
|
this.registerCommands([MakeSessionTableCommand]);
|
|
1416
1223
|
}
|
|
1417
1224
|
};
|
|
1418
|
-
|
|
1419
1225
|
//#endregion
|
|
1420
1226
|
exports.DatabaseDriver = DatabaseDriver;
|
|
1421
1227
|
exports.Driver = Driver;
|
|
@@ -1431,4 +1237,4 @@ exports.SessionStore = SessionStore;
|
|
|
1431
1237
|
exports.dbBuilder = dbBuilder;
|
|
1432
1238
|
exports.fileBuilder = fileBuilder;
|
|
1433
1239
|
exports.memoryBuilder = memoryBuilder;
|
|
1434
|
-
exports.redisBuilder = redisBuilder;
|
|
1240
|
+
exports.redisBuilder = redisBuilder;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference path="./app.globals.d.ts" />
|
|
2
|
-
import * as _h3ravel_contracts0 from "@h3ravel/contracts";
|
|
3
2
|
import { IApplication, IHttpContext, ISessionDriver, ISessionManager, SessionDriverBuilder, SessionDriverOption } from "@h3ravel/contracts";
|
|
4
3
|
import { Command } from "@h3ravel/musket";
|
|
5
4
|
import { ServiceProvider } from "@h3ravel/support";
|
|
@@ -531,6 +530,7 @@ declare class RedisDriver extends Driver implements ISessionDriver {
|
|
|
531
530
|
/**
|
|
532
531
|
* The current session ID
|
|
533
532
|
*/
|
|
533
|
+
|
|
534
534
|
sessionId: string, redisClient?: "RedisClient" | undefined, prefix?: string | undefined);
|
|
535
535
|
/**
|
|
536
536
|
* Fetch and return session payload.
|
|
@@ -768,7 +768,7 @@ declare class SessionStore {
|
|
|
768
768
|
*
|
|
769
769
|
* If driver not found, throws. Options is a simple key/value bag passed to the builder.
|
|
770
770
|
*/
|
|
771
|
-
static make(name: 'file' | 'memory' | 'database' | 'redis', sessionId: string, options?: SessionDriverOption):
|
|
771
|
+
static make(name: 'file' | 'memory' | 'database' | 'redis', sessionId: string, options?: SessionDriverOption): import("@h3ravel/contracts").ISessionDriver;
|
|
772
772
|
}
|
|
773
773
|
//#endregion
|
|
774
774
|
export { DatabaseDriver, Driver, Encryption, FileDriver, FlashBag, MakeSessionTableCommand, MemoryDriver, RedisDriver, SessionManager, SessionServiceProvider, SessionStore, dbBuilder, fileBuilder, memoryBuilder, redisBuilder };
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { IHttpContext, ISessionDriver, ISessionManager } from "@h3ravel/contract
|
|
|
6
6
|
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "fs";
|
|
7
7
|
import path from "path";
|
|
8
8
|
import { Command } from "@h3ravel/musket";
|
|
9
|
-
|
|
9
|
+
import { getCookie, setCookie } from "h3";
|
|
10
10
|
//#region src/Encryption.ts
|
|
11
11
|
var Encryption = class {
|
|
12
12
|
key;
|
|
@@ -41,7 +41,6 @@ var Encryption = class {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
|
|
45
44
|
//#endregion
|
|
46
45
|
//#region src/FlashBag.ts
|
|
47
46
|
/**
|
|
@@ -172,7 +171,6 @@ var FlashBag = class {
|
|
|
172
171
|
this.flashData.old = {};
|
|
173
172
|
}
|
|
174
173
|
};
|
|
175
|
-
|
|
176
174
|
//#endregion
|
|
177
175
|
//#region src/drivers/Driver.ts
|
|
178
176
|
/**
|
|
@@ -422,7 +420,6 @@ var Driver = class extends ISessionDriver {
|
|
|
422
420
|
return this.savePayload({});
|
|
423
421
|
}
|
|
424
422
|
};
|
|
425
|
-
|
|
426
423
|
//#endregion
|
|
427
424
|
//#region src/drivers/DatabaseDriver.ts
|
|
428
425
|
/**
|
|
@@ -432,6 +429,8 @@ var Driver = class extends ISessionDriver {
|
|
|
432
429
|
* The `payload` column contains all session key/value pairs as JSON.
|
|
433
430
|
*/
|
|
434
431
|
var DatabaseDriver = class extends Driver {
|
|
432
|
+
sessionId;
|
|
433
|
+
table;
|
|
435
434
|
/**
|
|
436
435
|
*
|
|
437
436
|
* @param sessionId The current session ID
|
|
@@ -657,7 +656,6 @@ var DatabaseDriver = class extends Driver {
|
|
|
657
656
|
this.flashBag.ageFlashData();
|
|
658
657
|
}
|
|
659
658
|
};
|
|
660
|
-
|
|
661
659
|
//#endregion
|
|
662
660
|
//#region src/drivers/FileDriver.ts
|
|
663
661
|
/**
|
|
@@ -668,6 +666,9 @@ var DatabaseDriver = class extends Driver {
|
|
|
668
666
|
* Ideal for local development or low-scale deployments.
|
|
669
667
|
*/
|
|
670
668
|
var FileDriver = class extends Driver {
|
|
669
|
+
sessionId;
|
|
670
|
+
sessionDir;
|
|
671
|
+
cwd;
|
|
671
672
|
constructor(sessionId, sessionDir = path.resolve(".sessions"), cwd = process.cwd()) {
|
|
672
673
|
super();
|
|
673
674
|
this.sessionId = sessionId;
|
|
@@ -729,7 +730,6 @@ var FileDriver = class extends Driver {
|
|
|
729
730
|
this.savePayload({});
|
|
730
731
|
}
|
|
731
732
|
};
|
|
732
|
-
|
|
733
733
|
//#endregion
|
|
734
734
|
//#region src/drivers/MemoryDriver.ts
|
|
735
735
|
/**
|
|
@@ -739,6 +739,7 @@ var FileDriver = class extends Driver {
|
|
|
739
739
|
* Intended for tests, local development, or short-lived apps.
|
|
740
740
|
*/
|
|
741
741
|
var MemoryDriver = class MemoryDriver extends Driver {
|
|
742
|
+
sessionId;
|
|
742
743
|
static store = {};
|
|
743
744
|
constructor(sessionId) {
|
|
744
745
|
super();
|
|
@@ -772,13 +773,15 @@ var MemoryDriver = class MemoryDriver extends Driver {
|
|
|
772
773
|
this.savePayload({});
|
|
773
774
|
}
|
|
774
775
|
};
|
|
775
|
-
|
|
776
776
|
//#endregion
|
|
777
777
|
//#region src/drivers/RedisDriver.ts
|
|
778
778
|
/**
|
|
779
779
|
* RedisDriver (placeholder)
|
|
780
780
|
*/
|
|
781
781
|
var RedisDriver = class extends Driver {
|
|
782
|
+
sessionId;
|
|
783
|
+
redisClient;
|
|
784
|
+
prefix;
|
|
782
785
|
static store = {};
|
|
783
786
|
constructor(sessionId, redisClient, prefix) {
|
|
784
787
|
super();
|
|
@@ -808,7 +811,6 @@ var RedisDriver = class extends Driver {
|
|
|
808
811
|
this.savePayload({});
|
|
809
812
|
}
|
|
810
813
|
};
|
|
811
|
-
|
|
812
814
|
//#endregion
|
|
813
815
|
//#region src/adapters.ts
|
|
814
816
|
/**
|
|
@@ -841,7 +843,6 @@ const redisBuilder = (sessionId, options = {}) => {
|
|
|
841
843
|
const client = options.client;
|
|
842
844
|
return new RedisDriver(sessionId, client, options.prefix ?? "h3ravel:sessions:");
|
|
843
845
|
};
|
|
844
|
-
|
|
845
846
|
//#endregion
|
|
846
847
|
//#region src/Commands/MakeSessionTableCommand.ts
|
|
847
848
|
var MakeSessionTableCommand = class extends Command {
|
|
@@ -871,194 +872,6 @@ var MakeSessionTableCommand = class extends Command {
|
|
|
871
872
|
this.info("INFO: session table created successfully.");
|
|
872
873
|
}
|
|
873
874
|
};
|
|
874
|
-
|
|
875
|
-
//#endregion
|
|
876
|
-
//#region ../../node_modules/.pnpm/h3@2.0.1-rc.5/node_modules/h3/dist/h3.mjs
|
|
877
|
-
const kEventNS = "h3.internal.event.";
|
|
878
|
-
const kEventRes = /* @__PURE__ */ Symbol.for(`${kEventNS}res`);
|
|
879
|
-
const kEventResHeaders = /* @__PURE__ */ Symbol.for(`${kEventNS}res.headers`);
|
|
880
|
-
function parse(str, options) {
|
|
881
|
-
if (typeof str !== "string") throw new TypeError("argument str must be a string");
|
|
882
|
-
const obj = {};
|
|
883
|
-
const opt = options || {};
|
|
884
|
-
const dec = opt.decode || decode;
|
|
885
|
-
let index = 0;
|
|
886
|
-
while (index < str.length) {
|
|
887
|
-
const eqIdx = str.indexOf("=", index);
|
|
888
|
-
if (eqIdx === -1) break;
|
|
889
|
-
let endIdx = str.indexOf(";", index);
|
|
890
|
-
if (endIdx === -1) endIdx = str.length;
|
|
891
|
-
else if (endIdx < eqIdx) {
|
|
892
|
-
index = str.lastIndexOf(";", eqIdx - 1) + 1;
|
|
893
|
-
continue;
|
|
894
|
-
}
|
|
895
|
-
const key = str.slice(index, eqIdx).trim();
|
|
896
|
-
if (opt?.filter && !opt?.filter(key)) {
|
|
897
|
-
index = endIdx + 1;
|
|
898
|
-
continue;
|
|
899
|
-
}
|
|
900
|
-
if (void 0 === obj[key]) {
|
|
901
|
-
let val = str.slice(eqIdx + 1, endIdx).trim();
|
|
902
|
-
if (val.codePointAt(0) === 34) val = val.slice(1, -1);
|
|
903
|
-
obj[key] = tryDecode(val, dec);
|
|
904
|
-
}
|
|
905
|
-
index = endIdx + 1;
|
|
906
|
-
}
|
|
907
|
-
return obj;
|
|
908
|
-
}
|
|
909
|
-
function decode(str) {
|
|
910
|
-
return str.includes("%") ? decodeURIComponent(str) : str;
|
|
911
|
-
}
|
|
912
|
-
function tryDecode(str, decode2) {
|
|
913
|
-
try {
|
|
914
|
-
return decode2(str);
|
|
915
|
-
} catch {
|
|
916
|
-
return str;
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
const fieldContentRegExp = /^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;
|
|
920
|
-
function serialize(name, value, options) {
|
|
921
|
-
const opt = options || {};
|
|
922
|
-
const enc = opt.encode || encodeURIComponent;
|
|
923
|
-
if (typeof enc !== "function") throw new TypeError("option encode is invalid");
|
|
924
|
-
if (!fieldContentRegExp.test(name)) throw new TypeError("argument name is invalid");
|
|
925
|
-
const encodedValue = enc(value);
|
|
926
|
-
if (encodedValue && !fieldContentRegExp.test(encodedValue)) throw new TypeError("argument val is invalid");
|
|
927
|
-
let str = name + "=" + encodedValue;
|
|
928
|
-
if (void 0 !== opt.maxAge && opt.maxAge !== null) {
|
|
929
|
-
const maxAge = opt.maxAge - 0;
|
|
930
|
-
if (Number.isNaN(maxAge) || !Number.isFinite(maxAge)) throw new TypeError("option maxAge is invalid");
|
|
931
|
-
str += "; Max-Age=" + Math.floor(maxAge);
|
|
932
|
-
}
|
|
933
|
-
if (opt.domain) {
|
|
934
|
-
if (!fieldContentRegExp.test(opt.domain)) throw new TypeError("option domain is invalid");
|
|
935
|
-
str += "; Domain=" + opt.domain;
|
|
936
|
-
}
|
|
937
|
-
if (opt.path) {
|
|
938
|
-
if (!fieldContentRegExp.test(opt.path)) throw new TypeError("option path is invalid");
|
|
939
|
-
str += "; Path=" + opt.path;
|
|
940
|
-
}
|
|
941
|
-
if (opt.expires) {
|
|
942
|
-
if (!isDate(opt.expires) || Number.isNaN(opt.expires.valueOf())) throw new TypeError("option expires is invalid");
|
|
943
|
-
str += "; Expires=" + opt.expires.toUTCString();
|
|
944
|
-
}
|
|
945
|
-
if (opt.httpOnly) str += "; HttpOnly";
|
|
946
|
-
if (opt.secure) str += "; Secure";
|
|
947
|
-
if (opt.priority) switch (typeof opt.priority === "string" ? opt.priority.toLowerCase() : opt.priority) {
|
|
948
|
-
case "low":
|
|
949
|
-
str += "; Priority=Low";
|
|
950
|
-
break;
|
|
951
|
-
case "medium":
|
|
952
|
-
str += "; Priority=Medium";
|
|
953
|
-
break;
|
|
954
|
-
case "high":
|
|
955
|
-
str += "; Priority=High";
|
|
956
|
-
break;
|
|
957
|
-
default: throw new TypeError("option priority is invalid");
|
|
958
|
-
}
|
|
959
|
-
if (opt.sameSite) switch (typeof opt.sameSite === "string" ? opt.sameSite.toLowerCase() : opt.sameSite) {
|
|
960
|
-
case true:
|
|
961
|
-
str += "; SameSite=Strict";
|
|
962
|
-
break;
|
|
963
|
-
case "lax":
|
|
964
|
-
str += "; SameSite=Lax";
|
|
965
|
-
break;
|
|
966
|
-
case "strict":
|
|
967
|
-
str += "; SameSite=Strict";
|
|
968
|
-
break;
|
|
969
|
-
case "none":
|
|
970
|
-
str += "; SameSite=None";
|
|
971
|
-
break;
|
|
972
|
-
default: throw new TypeError("option sameSite is invalid");
|
|
973
|
-
}
|
|
974
|
-
if (opt.partitioned) str += "; Partitioned";
|
|
975
|
-
return str;
|
|
976
|
-
}
|
|
977
|
-
function isDate(val) {
|
|
978
|
-
return Object.prototype.toString.call(val) === "[object Date]" || val instanceof Date;
|
|
979
|
-
}
|
|
980
|
-
function parseSetCookie(setCookieValue, options) {
|
|
981
|
-
const parts = (setCookieValue || "").split(";").filter((str) => typeof str === "string" && !!str.trim());
|
|
982
|
-
const parsed = _parseNameValuePair(parts.shift() || "");
|
|
983
|
-
const name = parsed.name;
|
|
984
|
-
let value = parsed.value;
|
|
985
|
-
try {
|
|
986
|
-
value = options?.decode === false ? value : (options?.decode || decodeURIComponent)(value);
|
|
987
|
-
} catch {}
|
|
988
|
-
const cookie = {
|
|
989
|
-
name,
|
|
990
|
-
value
|
|
991
|
-
};
|
|
992
|
-
for (const part of parts) {
|
|
993
|
-
const sides = part.split("=");
|
|
994
|
-
const partKey = (sides.shift() || "").trimStart().toLowerCase();
|
|
995
|
-
const partValue = sides.join("=");
|
|
996
|
-
switch (partKey) {
|
|
997
|
-
case "expires":
|
|
998
|
-
cookie.expires = new Date(partValue);
|
|
999
|
-
break;
|
|
1000
|
-
case "max-age":
|
|
1001
|
-
cookie.maxAge = Number.parseInt(partValue, 10);
|
|
1002
|
-
break;
|
|
1003
|
-
case "secure":
|
|
1004
|
-
cookie.secure = true;
|
|
1005
|
-
break;
|
|
1006
|
-
case "httponly":
|
|
1007
|
-
cookie.httpOnly = true;
|
|
1008
|
-
break;
|
|
1009
|
-
case "samesite":
|
|
1010
|
-
cookie.sameSite = partValue;
|
|
1011
|
-
break;
|
|
1012
|
-
default: cookie[partKey] = partValue;
|
|
1013
|
-
}
|
|
1014
|
-
}
|
|
1015
|
-
return cookie;
|
|
1016
|
-
}
|
|
1017
|
-
function _parseNameValuePair(nameValuePairStr) {
|
|
1018
|
-
let name = "";
|
|
1019
|
-
let value = "";
|
|
1020
|
-
const nameValueArr = nameValuePairStr.split("=");
|
|
1021
|
-
if (nameValueArr.length > 1) {
|
|
1022
|
-
name = nameValueArr.shift();
|
|
1023
|
-
value = nameValueArr.join("=");
|
|
1024
|
-
} else value = nameValuePairStr;
|
|
1025
|
-
return {
|
|
1026
|
-
name,
|
|
1027
|
-
value
|
|
1028
|
-
};
|
|
1029
|
-
}
|
|
1030
|
-
function parseCookies(event) {
|
|
1031
|
-
return parse(event.req.headers.get("cookie") || "");
|
|
1032
|
-
}
|
|
1033
|
-
function getCookie(event, name) {
|
|
1034
|
-
return parseCookies(event)[name];
|
|
1035
|
-
}
|
|
1036
|
-
function setCookie(event, name, value, options) {
|
|
1037
|
-
const newCookie = serialize(name, value, {
|
|
1038
|
-
path: "/",
|
|
1039
|
-
...options
|
|
1040
|
-
});
|
|
1041
|
-
const currentCookies = event.res.headers.getSetCookie();
|
|
1042
|
-
if (currentCookies.length === 0) {
|
|
1043
|
-
event.res.headers.set("set-cookie", newCookie);
|
|
1044
|
-
return;
|
|
1045
|
-
}
|
|
1046
|
-
const newCookieKey = _getDistinctCookieKey(name, options || {});
|
|
1047
|
-
event.res.headers.delete("set-cookie");
|
|
1048
|
-
for (const cookie of currentCookies) {
|
|
1049
|
-
if (_getDistinctCookieKey(cookie.split("=")?.[0], parseSetCookie(cookie)) === newCookieKey) continue;
|
|
1050
|
-
event.res.headers.append("set-cookie", cookie);
|
|
1051
|
-
}
|
|
1052
|
-
event.res.headers.append("set-cookie", newCookie);
|
|
1053
|
-
}
|
|
1054
|
-
function _getDistinctCookieKey(name, options) {
|
|
1055
|
-
return [
|
|
1056
|
-
name,
|
|
1057
|
-
options.domain || "",
|
|
1058
|
-
options.path || "/"
|
|
1059
|
-
].join(";");
|
|
1060
|
-
}
|
|
1061
|
-
|
|
1062
875
|
//#endregion
|
|
1063
876
|
//#region src/SessionStore.ts
|
|
1064
877
|
/**
|
|
@@ -1086,7 +899,6 @@ var SessionStore = class {
|
|
|
1086
899
|
return builder(sessionId, options);
|
|
1087
900
|
}
|
|
1088
901
|
};
|
|
1089
|
-
|
|
1090
902
|
//#endregion
|
|
1091
903
|
//#region src/SessionManager.ts
|
|
1092
904
|
/**
|
|
@@ -1363,7 +1175,6 @@ var SessionManager = class SessionManager extends ISessionManager {
|
|
|
1363
1175
|
return this.driver.ageFlashData();
|
|
1364
1176
|
}
|
|
1365
1177
|
};
|
|
1366
|
-
|
|
1367
1178
|
//#endregion
|
|
1368
1179
|
//#region src/Providers/SessionServiceProvider.ts
|
|
1369
1180
|
var SessionServiceProvider = class extends ServiceProvider {
|
|
@@ -1386,6 +1197,5 @@ var SessionServiceProvider = class extends ServiceProvider {
|
|
|
1386
1197
|
this.registerCommands([MakeSessionTableCommand]);
|
|
1387
1198
|
}
|
|
1388
1199
|
};
|
|
1389
|
-
|
|
1390
1200
|
//#endregion
|
|
1391
|
-
export { DatabaseDriver, Driver, Encryption, FileDriver, FlashBag, MakeSessionTableCommand, MemoryDriver, RedisDriver, SessionManager, SessionServiceProvider, SessionStore, dbBuilder, fileBuilder, memoryBuilder, redisBuilder };
|
|
1201
|
+
export { DatabaseDriver, Driver, Encryption, FileDriver, FlashBag, MakeSessionTableCommand, MemoryDriver, RedisDriver, SessionManager, SessionServiceProvider, SessionStore, dbBuilder, fileBuilder, memoryBuilder, redisBuilder };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h3ravel/session",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.29.0-alpha.11",
|
|
4
4
|
"description": "Provides a unified session management layer for h3ravel, with secure encryption, consistent API design, and optional adapters (memory, file, redis, db).",
|
|
5
5
|
"h3ravel": {
|
|
6
6
|
"providers": [
|
|
@@ -43,16 +43,16 @@
|
|
|
43
43
|
"session"
|
|
44
44
|
],
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@h3ravel/database": "^11.
|
|
47
|
-
"@h3ravel/foundation": "^
|
|
48
|
-
"@h3ravel/shared": "^
|
|
46
|
+
"@h3ravel/database": "^11.15.0-alpha.11",
|
|
47
|
+
"@h3ravel/foundation": "^1.29.0-alpha.11",
|
|
48
|
+
"@h3ravel/shared": "^1.29.0-alpha.11"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@h3ravel/contracts": "^
|
|
52
|
-
"typescript": "^
|
|
51
|
+
"@h3ravel/contracts": "^1.29.0-alpha.11",
|
|
52
|
+
"typescript": "^6.0.0"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
|
-
"build": "tsdown --config-loader
|
|
55
|
+
"build": "tsdown --config-loader unrun",
|
|
56
56
|
"dev": "tsx watch src/index.ts",
|
|
57
57
|
"start": "node dist/index.js",
|
|
58
58
|
"lint": "eslint . --ext .ts",
|