insite-cookie 2.0.11 → 2.0.13
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/client/Setter.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { InSiteWebSocket } from "insite-ws/client";
|
|
2
2
|
import { type Method } from "../common";
|
|
3
|
-
type Options = {
|
|
3
|
+
export type Options = {
|
|
4
4
|
method?: Method;
|
|
5
5
|
url?: string;
|
|
6
6
|
onload?: (this: XMLHttpRequest, event: ProgressEvent) => unknown;
|
|
@@ -14,5 +14,4 @@ export declare class CookieSetter {
|
|
|
14
14
|
static onXhrLoad(this: XMLHttpRequest): void;
|
|
15
15
|
static onXhrError(this: XMLHttpRequest): void;
|
|
16
16
|
}
|
|
17
|
-
export {};
|
|
18
17
|
//# sourceMappingURL=Setter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Setter.d.ts","sourceRoot":"","sources":["../../src/client/Setter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Setter.d.ts","sourceRoot":"","sources":["../../src/client/Setter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AAMjD,MAAM,MAAM,OAAO,GAAG;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,aAAa,KAAK,OAAO,CAAC;IACjE,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,aAAa,KAAK,OAAO,CAAC;CAClE,CAAC;AAGF,qBAAa,YAAY;;gBACZ,EAAE,EAAE,eAAe,EAAE,OAAO,GAAE,OAAY;IAkBtD,QAAQ,CAAC,MAAM,SAAC;IAChB,QAAQ,CAAC,GAAG,SAAC;IAkBb,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,cAAc;IAOrC,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,cAAc;CAMtC"}
|
package/dist/client/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
1
|
+
var k=Object.defineProperty;var u=o=>{throw TypeError(o)};var y=(o,t,e)=>t in o?k(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;var p=(o,t,e)=>y(o,typeof t!="symbol"?t+"":t,e),c=(o,t,e)=>t.has(o)||u("Cannot "+e);var i=(o,t,e)=>(c(o,t,"read from private field"),e?e.call(o):t.get(o)),h=(o,t,e)=>t.has(o)?u("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(o):t.set(o,e),l=(o,t,e,n)=>(c(o,t,"write to private field"),n?n.call(o,e):t.set(o,e),e);var m={set:"~setcookie"};var r,s,d,a=class a{constructor(t,e={}){p(this,"method");p(this,"url");h(this,r);h(this,s);h(this,d,t=>{let e=new XMLHttpRequest;e.onload=i(this,r),e.onerror=i(this,s),e.open(this.method,`${this.url}?${t}`,!0),e.send(null)});let{method:n="GET",url:x="/cookie",onload:M=a.onXhrLoad,onerror:S=a.onXhrError}=e;this.method=n,this.url=x,l(this,r,M),l(this,s,S),t.on(`message:${m.set}`,i(this,d))}static onXhrLoad(){this.readyState===4&&this.status!==200&&console.error("Set cookie:",this.statusText)}static onXhrError(){console.error("Set cookie:",this.statusText)}};r=new WeakMap,s=new WeakMap,d=new WeakMap;var X=a;export{X as CookieSetter};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/client/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/common.ts", "../../src/client/Setter.ts"],
|
|
4
|
-
"sourcesContent": ["export const headers = {\n\tset: \"~setcookie\"\n};\n\nexport type Method = \"GET\" | \"POST\";\n", "import {
|
|
5
|
-
"mappings": "2eAAO,IAAMA,EAAU,CACtB,IAAK,YACN,ECFA,IAAAC,EAAAC,EAAAC,
|
|
4
|
+
"sourcesContent": ["export const headers = {\n\tset: \"~setcookie\"\n};\n\nexport type Method = \"GET\" | \"POST\";\n", "import type { InSiteWebSocket } from \"insite-ws/client\";\nimport { headers, type Method } from \"../common\";\n\n\n/* eslint-disable unicorn/prefer-add-event-listener */\n\n\nexport type Options = {\n\tmethod?: Method;\n\turl?: string;\n\tonload?: (this: XMLHttpRequest, event: ProgressEvent) => unknown;\n\tonerror?: (this: XMLHttpRequest, event: ProgressEvent) => unknown;\n};\n\n\nexport class CookieSetter {\n\tconstructor(ws: InSiteWebSocket, options: Options = {}) {\n\t\t\n\t\tconst {\n\t\t\tmethod = \"GET\",\n\t\t\turl = \"/cookie\",\n\t\t\tonload = CookieSetter.onXhrLoad,\n\t\t\tonerror = CookieSetter.onXhrError\n\t\t} = options;\n\t\t\n\t\tthis.method = method;\n\t\tthis.url = url;\n\t\tthis.#onload = onload;\n\t\tthis.#onerror = onerror;\n\t\t\n\t\tws.on(`message:${headers.set}`, this.#handleSet);\n\t\t\n\t}\n\t\n\treadonly method;\n\treadonly url;\n\t#onload;\n\t#onerror;\n\t\n\t#handleSet = (token: string) => {\n\t\t\n\t\tconst xhr = new XMLHttpRequest();\n\t\t\n\t\txhr.onload = this.#onload;\n\t\txhr.onerror = this.#onerror;\n\t\t\n\t\txhr.open(this.method, `${this.url}?${token}`, true);\n\t\t\n\t\txhr.send(null);\n\t\t\n\t};\n\t\n\t\n\tstatic onXhrLoad(this: XMLHttpRequest) {\n\t\t\n\t\tif (this.readyState === 4 && this.status !== 200)\n\t\t\tconsole.error(\"Set cookie:\", this.statusText);\n\t\t\n\t}\n\t\n\tstatic onXhrError(this: XMLHttpRequest) {\n\t\t\n\t\tconsole.error(\"Set cookie:\", this.statusText);\n\t\t\n\t}\n\t\n}\n"],
|
|
5
|
+
"mappings": "2eAAO,IAAMA,EAAU,CACtB,IAAK,YACN,ECFA,IAAAC,EAAAC,EAAAC,EAeaC,EAAN,MAAMA,CAAa,CACzB,YAAYC,EAAqBC,EAAmB,CAAC,EAAG,CAkBxDC,EAAA,KAAS,UACTA,EAAA,KAAS,OACTC,EAAA,KAAAP,GACAO,EAAA,KAAAN,GAEAM,EAAA,KAAAL,EAAcM,GAAkB,CAE/B,IAAMC,EAAM,IAAI,eAEhBA,EAAI,OAASC,EAAA,KAAKV,GAClBS,EAAI,QAAUC,EAAA,KAAKT,GAEnBQ,EAAI,KAAK,KAAK,OAAQ,GAAG,KAAK,GAAG,IAAID,CAAK,GAAI,EAAI,EAElDC,EAAI,KAAK,IAAI,CAEd,GAhCC,GAAM,CACL,OAAAE,EAAS,MACT,IAAAC,EAAM,UACN,OAAAC,EAASV,EAAa,UACtB,QAAAW,EAAUX,EAAa,UACxB,EAAIE,EAEJ,KAAK,OAASM,EACd,KAAK,IAAMC,EACXG,EAAA,KAAKf,EAAUa,GACfE,EAAA,KAAKd,EAAWa,GAEhBV,EAAG,GAAG,WAAWY,EAAQ,GAAG,GAAIN,EAAA,KAAKR,EAAU,CAEhD,CAqBA,OAAO,WAAgC,CAElC,KAAK,aAAe,GAAK,KAAK,SAAW,KAC5C,QAAQ,MAAM,cAAe,KAAK,UAAU,CAE9C,CAEA,OAAO,YAAiC,CAEvC,QAAQ,MAAM,cAAe,KAAK,UAAU,CAE7C,CAED,EA9BCF,EAAA,YACAC,EAAA,YAEAC,EAAA,YAxBM,IAAMe,EAANd",
|
|
6
6
|
"names": ["headers", "_onload", "_onerror", "_handleSet", "_CookieSetter", "ws", "options", "__publicField", "__privateAdd", "token", "xhr", "__privateGet", "method", "url", "onload", "onerror", "__privateSet", "headers", "CookieSetter"]
|
|
7
7
|
}
|
package/dist/server/Setter.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AbilitiesSchema } from "insite-
|
|
1
|
+
import type { AbilitiesSchema } from "insite-common";
|
|
2
2
|
import type { UsersServer, WSSCWithUser } from "insite-users-server-ws";
|
|
3
3
|
import { parseCookie } from "./parse";
|
|
4
4
|
import type { Cookie, CookieOptions } from "./types";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Setter.d.ts","sourceRoot":"","sources":["../../src/server/Setter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Setter.d.ts","sourceRoot":"","sources":["../../src/server/Setter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAExE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAKrD,MAAM,MAAM,OAAO,CAAC,EAAE,SAAS,eAAe,IAAI;IACjD,WAAW,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAGF,qBAAa,YAAY,CAAC,EAAE,SAAS,eAAe;;gBACvC,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,CAAC;IAYxD,WAAW,kBAAC;IACZ,MAAM,qBAAC;IACP,MAAM,SAAC;IAEP,GAAG,CAAC,IAAI,EAAE,YAAY,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa;IAUlE,KAAK,CAAC,IAAI,EAAE,YAAY,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE;IAoC7C,MAAM,CAAC,KAAK,qBAAe;CAE3B"}
|
package/dist/server/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/server/Middleware.ts", "../../src/server/tokenMap.ts", "../../src/server/parse.ts", "../../src/server/Setter.ts", "../../src/common.ts"],
|
|
4
|
-
"sourcesContent": ["import type { IncomingMessage, ServerResponse } from \"node:http\";\nimport { getWithTimeout } from \"@nesvet/n\";\nimport { InSiteServerMiddleware } from \"insite-http\";\nimport { tokenMap } from \"./tokenMap\";\nimport type { Cookie, CookieOptions } from \"./types\";\n\n\ntype Options = {\n\trequestRegExp?: RegExp;\n};\n\nexport type { Options as CookieMiddlewareOptions };\n\ntype MakeArg = {\n\tname: keyof Cookie;\n\tvalue: Cookie[keyof Cookie];\n} & CookieOptions;\n\n\nexport class InSiteCookieMiddleware extends InSiteServerMiddleware {\n\tconstructor(options: Options = {}) {\n\t\tsuper();\n\t\t\n\t\tconst {\n\t\t\trequestRegExp = /^\\/cookie\\/?\\?/\n\t\t} = options;\n\t\t\n\t\tthis.listeners = { GET: [\n\t\t\t[ requestRegExp, this.#handler ]\n\t\t] };\n\t\t\n\t}\n\t\n\t#handler = (request: IncomingMessage, response: ServerResponse) => {\n\t\tconst [ , token ] = request.url!.split(\"?\");\n\t\t\n\t\tif (token && tokenMap.has(token))\n\t\t\treturn response.writeHead(200, {\n\t\t\t\t\"Content-Type\": \"text/plain; charset=utf-8\",\n\t\t\t\t\"Set-Cookie\": InSiteCookieMiddleware.cookify(...getWithTimeout(tokenMap, token)!)\n\t\t\t}).end();\n\t\t\n\t\t\n\t\treturn false;\n\t};\n\t\n\t\n\tstatic make({ name, value, maxAge, expiresAt, domain, path = \"/\", secure = true, httpOnly = true, sameSite = \"Strict\" }: MakeArg) {\n\t\tconst cookie = [ `${name}=${value}` ];\n\t\t\n\t\tif (maxAge !== undefined)\n\t\t\tcookie.push(`Max-Age=${maxAge}`);\n\t\telse if (expiresAt)\n\t\t\tcookie.push(`Max-Age=${Math.round((expiresAt.getTime() - Date.now()) / 1000)}`);\n\t\t\n\t\tif (domain)\n\t\t\tcookie.push(`Domain=${domain}`);\n\t\t\n\t\tif (path)\n\t\t\tcookie.push(`Path=${path}`);\n\t\t\n\t\tif (secure)\n\t\t\tcookie.push(\"Secure\");\n\t\t\n\t\tif (httpOnly)\n\t\t\tcookie.push(\"HttpOnly\");\n\t\t\n\t\tif (sameSite)\n\t\t\tcookie.push(`SameSite=${sameSite}`);\n\t\t\n\t\treturn cookie.join(\"; \");\n\t}\n\t\n\tstatic cookify(cookie: Cookie, options: CookieOptions) {\n\t\treturn Object.entries(cookie).map(([ name, value ]) => this.make({ name, value, ...options }));\n\t}\n\t\n}\n", "import type { Cookie, CookieOptions } from \"./types\";\n\n\nexport const tokenMap = new Map<string, [ cookie: Cookie, options: CookieOptions ]>();\n", "export function parseCookie(cookie: string) {\n\treturn cookie ? cookie.split(/;\\s*/).reduce((object, keyEqValue) => {\n\t\tconst [ key, value ] = keyEqValue.split(/=/);\n\t\t\n\t\ttry {\n\t\t\tobject[key] = JSON.parse(value);\n\t\t} catch {\n\t\t\tobject[key] = value;\n\t\t}\n\t\t\n\t\treturn object;\n\t}, {} as Record<string, unknown>) : {};\n}\n", "import crypto from \"node:crypto\";\nimport type { IncomingMessage } from \"node:http\";\nimport { random, setWithTimeout } from \"@nesvet/n\";\nimport type { AbilitiesSchema } from \"insite-
|
|
4
|
+
"sourcesContent": ["import type { IncomingMessage, ServerResponse } from \"node:http\";\nimport { getWithTimeout } from \"@nesvet/n\";\nimport { InSiteServerMiddleware } from \"insite-http\";\nimport { tokenMap } from \"./tokenMap\";\nimport type { Cookie, CookieOptions } from \"./types\";\n\n\ntype Options = {\n\trequestRegExp?: RegExp;\n};\n\nexport type { Options as CookieMiddlewareOptions };\n\ntype MakeArg = {\n\tname: keyof Cookie;\n\tvalue: Cookie[keyof Cookie];\n} & CookieOptions;\n\n\nexport class InSiteCookieMiddleware extends InSiteServerMiddleware {\n\tconstructor(options: Options = {}) {\n\t\tsuper();\n\t\t\n\t\tconst {\n\t\t\trequestRegExp = /^\\/cookie\\/?\\?/\n\t\t} = options;\n\t\t\n\t\tthis.listeners = { GET: [\n\t\t\t[ requestRegExp, this.#handler ]\n\t\t] };\n\t\t\n\t}\n\t\n\t#handler = (request: IncomingMessage, response: ServerResponse) => {\n\t\tconst [ , token ] = request.url!.split(\"?\");\n\t\t\n\t\tif (token && tokenMap.has(token))\n\t\t\treturn response.writeHead(200, {\n\t\t\t\t\"Content-Type\": \"text/plain; charset=utf-8\",\n\t\t\t\t\"Set-Cookie\": InSiteCookieMiddleware.cookify(...getWithTimeout(tokenMap, token)!)\n\t\t\t}).end();\n\t\t\n\t\t\n\t\treturn false;\n\t};\n\t\n\t\n\tstatic make({ name, value, maxAge, expiresAt, domain, path = \"/\", secure = true, httpOnly = true, sameSite = \"Strict\" }: MakeArg) {\n\t\tconst cookie = [ `${name}=${value}` ];\n\t\t\n\t\tif (maxAge !== undefined)\n\t\t\tcookie.push(`Max-Age=${maxAge}`);\n\t\telse if (expiresAt)\n\t\t\tcookie.push(`Max-Age=${Math.round((expiresAt.getTime() - Date.now()) / 1000)}`);\n\t\t\n\t\tif (domain)\n\t\t\tcookie.push(`Domain=${domain}`);\n\t\t\n\t\tif (path)\n\t\t\tcookie.push(`Path=${path}`);\n\t\t\n\t\tif (secure)\n\t\t\tcookie.push(\"Secure\");\n\t\t\n\t\tif (httpOnly)\n\t\t\tcookie.push(\"HttpOnly\");\n\t\t\n\t\tif (sameSite)\n\t\t\tcookie.push(`SameSite=${sameSite}`);\n\t\t\n\t\treturn cookie.join(\"; \");\n\t}\n\t\n\tstatic cookify(cookie: Cookie, options: CookieOptions) {\n\t\treturn Object.entries(cookie).map(([ name, value ]) => this.make({ name, value, ...options }));\n\t}\n\t\n}\n", "import type { Cookie, CookieOptions } from \"./types\";\n\n\nexport const tokenMap = new Map<string, [ cookie: Cookie, options: CookieOptions ]>();\n", "export function parseCookie(cookie: string) {\n\treturn cookie ? cookie.split(/;\\s*/).reduce((object, keyEqValue) => {\n\t\tconst [ key, value ] = keyEqValue.split(/=/);\n\t\t\n\t\ttry {\n\t\t\tobject[key] = JSON.parse(value);\n\t\t} catch {\n\t\t\tobject[key] = value;\n\t\t}\n\t\t\n\t\treturn object;\n\t}, {} as Record<string, unknown>) : {};\n}\n", "import crypto from \"node:crypto\";\nimport type { IncomingMessage } from \"node:http\";\nimport { random, setWithTimeout } from \"@nesvet/n\";\nimport type { AbilitiesSchema } from \"insite-common\";\nimport type { UsersServer, WSSCWithUser } from \"insite-users-server-ws\";\nimport { headers } from \"../common\";\nimport { parseCookie } from \"./parse\";\nimport { tokenMap } from \"./tokenMap\";\nimport type { Cookie, CookieOptions } from \"./types\";\n\n\nconst cookieTokenTimeout = 2000;\n\nexport type Options<AS extends AbilitiesSchema> = {\n\tusersServer: UsersServer<AS>;\n\tdomain?: string;\n\tmaxAge?: number;\n};\n\n\nexport class CookieSetter<AS extends AbilitiesSchema> {\n\tconstructor({ usersServer, domain, maxAge }: Options<AS>) {\n\t\tthis.usersServer = usersServer;\n\t\tthis.domain = domain ?? process.env.INSITE_HOST;\n\t\tthis.maxAge = maxAge ?? this.usersServer.users.sessions.collection.expireAfterSeconds;\n\t\t\n\t\tthis.usersServer.wss.on(\"client-connect\", this.#handleClientConnect);\n\t\tthis.usersServer.wss.on(\"client-session\", this.#handleClientSession);\n\t\t\n\t}\n\t\n\t#wsSessionIdMap = new WeakMap<WSSCWithUser<AS>, null | string>();\n\t\n\tusersServer;\n\tdomain;\n\tmaxAge;\n\t\n\tset(wssc: WSSCWithUser<AS>, cookie: Cookie, options: CookieOptions) {\n\t\t\n\t\tconst token = `${Math.round(performance.now() * Number.MAX_SAFE_INTEGER).toString(36)}$${crypto.randomBytes(random(4, 8)).toString(\"hex\")}`;\n\t\t\n\t\tsetWithTimeout(tokenMap, token, [ cookie, options ], cookieTokenTimeout);\n\t\t\n\t\twssc.sendMessage(headers.set, token);\n\t\t\n\t}\n\t\n\tunset(wssc: WSSCWithUser<AS>, names: string[]) {\n\t\tthis.set(wssc, names.reduce((cookie, name) => {\n\t\t\tcookie[name] = \"\";\n\t\t\t\n\t\t\treturn cookie;\n\t\t}, {} as Cookie), { maxAge: 0 });\n\t\t\n\t}\n\t\n\t#handleClientConnect = (wssc: WSSCWithUser<AS>, request: IncomingMessage) => {\n\t\tthis.#wsSessionIdMap.set(wssc, null);\n\t\t\n\t\tif (request.headers.cookie) {\n\t\t\tconst { sessionId = null } = parseCookie(request.headers.cookie) as { sessionId: null | string };\n\t\t\t\n\t\t\tthis.#wsSessionIdMap.set(wssc, sessionId);\n\t\t\t\n\t\t\tif (sessionId)\n\t\t\t\tthis.usersServer.setSession(wssc, sessionId, true);\n\t\t}\n\t\t\n\t};\n\t\n\t#handleClientSession = (wssc: WSSCWithUser<AS>) => {\n\t\tif (this.#wsSessionIdMap.get(wssc) !== wssc.session?._id) {\n\t\t\tthis.#wsSessionIdMap.set(wssc, wssc.session?._id ?? null);\n\t\t\t\n\t\t\tif (wssc.isOpen && wssc.session)\n\t\t\t\tthis.set(wssc, { sessionId: wssc.session._id }, { domain: this.domain, maxAge: this.maxAge });\n\t\t\telse\n\t\t\t\tthis.unset(wssc, [ \"sessionId\" ]);\n\t\t}\n\t\t\n\t};\n\t\n\t\n\tstatic parse = parseCookie;\n\t\n}\n", "export const headers = {\n\tset: \"~setcookie\"\n};\n\nexport type Method = \"GET\" | \"POST\";\n"],
|
|
5
5
|
"mappings": "AACA,OAAS,kBAAAA,MAAsB,YAC/B,OAAS,0BAAAC,MAA8B,cCChC,IAAMC,EAAW,IAAI,IDgBrB,IAAMC,EAAN,MAAMC,UAA+BC,CAAuB,CAClE,YAAYC,EAAmB,CAAC,EAAG,CAClC,MAAM,EAEN,GAAM,CACL,cAAAC,EAAgB,gBACjB,EAAID,EAEJ,KAAK,UAAY,CAAE,IAAK,CACvB,CAAEC,EAAe,KAAKC,EAAS,CAChC,CAAE,CAEH,CAEAA,GAAW,C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,OAAQ,CAC3B,GAAM,CAAE,UAAAC,EAAY,IAAK,EAAIC,EAAYF,EAAQ,QAAQ,MAAM,EAE/D,KAAKZ,GAAgB,IAAIC,EAAMY,CAAS,EAEpCA,GACH,KAAK,YAAY,WAAWZ,EAAMY,EAAW,EAAI,CACnD,CAED,EAEAd,GAAwBE,GAA2B,CAC9C,KAAKD,GAAgB,IAAIC,CAAI,IAAMA,EAAK,SAAS,MACpD,KAAKD,GAAgB,IAAIC,EAAMA,EAAK,SAAS,KAAO,IAAI,EAEpDA,EAAK,QAAUA,EAAK,QACvB,KAAK,IAAIA,EAAM,CAAE,UAAWA,EAAK,QAAQ,GAAI,EAAG,CAAE,OAAQ,KAAK,OAAQ,OAAQ,KAAK,MAAO,CAAC,EAE5F,KAAK,MAAMA,EAAM,CAAE,WAAY,CAAC,EAGnC,EAGA,OAAO,MAAQa,CAEhB",
|
|
6
6
|
"names": ["getWithTimeout", "InSiteServerMiddleware", "tokenMap", "InSiteCookieMiddleware", "_InSiteCookieMiddleware", "InSiteServerMiddleware", "options", "requestRegExp", "#handler", "request", "response", "token", "tokenMap", "getWithTimeout", "name", "value", "maxAge", "expiresAt", "domain", "path", "secure", "httpOnly", "sameSite", "cookie", "parseCookie", "cookie", "object", "keyEqValue", "key", "value", "crypto", "random", "setWithTimeout", "headers", "cookieTokenTimeout", "CookieSetter", "usersServer", "domain", "maxAge", "#handleClientConnect", "#handleClientSession", "#wsSessionIdMap", "wssc", "cookie", "options", "token", "crypto", "random", "setWithTimeout", "tokenMap", "headers", "names", "name", "request", "sessionId", "parseCookie"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "insite-cookie",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.13",
|
|
4
4
|
"description": "Cookie support for inSite",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/server.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"./server": "./dist/server/index.js",
|
|
10
10
|
"./client": "./dist/client/index.js"
|
|
11
11
|
},
|
|
12
|
-
"packageManager": "bun@1.1.
|
|
12
|
+
"packageManager": "bun@1.1.26",
|
|
13
13
|
"scripts": {
|
|
14
14
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
15
15
|
"build": "bun .conveyer.js",
|
|
@@ -28,16 +28,16 @@
|
|
|
28
28
|
"author": "Eugene Nesvetaev <dev@nesvet.dev> (https://nesvet.dev/)",
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@nesvet/n": "^1.1.
|
|
31
|
+
"@nesvet/n": "^1.1.7",
|
|
32
32
|
"insite-http": "^2",
|
|
33
33
|
"insite-ws": "^2",
|
|
34
|
-
"insite-
|
|
34
|
+
"insite-common": "^2",
|
|
35
35
|
"insite-users-server-ws": "^2"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@nesvet/conveyer": "^2.2.4",
|
|
39
|
-
"@nesvet/eslint-config": "^2.0.
|
|
40
|
-
"@types/node": "^22.
|
|
39
|
+
"@nesvet/eslint-config": "^2.0.25",
|
|
40
|
+
"@types/node": "^22.5.1",
|
|
41
41
|
"@types/ws": "^8.5.12",
|
|
42
42
|
"typescript": "^5.5.4"
|
|
43
43
|
}
|