insite-cookie 2.0.11 → 2.0.12

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.
@@ -1,6 +1,6 @@
1
- import { type InSiteWebSocket } from "insite-ws/client";
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,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AAKjD,KAAK,OAAO,GAAG;IACd,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"}
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"}
@@ -1,2 +1,2 @@
1
- var x=Object.defineProperty;var l=o=>{throw TypeError(o)};var y=(o,t,e)=>t in o?x(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)||l("Cannot "+e);var h=(o,t,e)=>(c(o,t,"read from private field"),e?e.call(o):t.get(o)),i=(o,t,e)=>t.has(o)?l("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(o):t.set(o,e),u=(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");i(this,r);i(this,s);i(this,d,t=>{let e=new XMLHttpRequest;e.onload=h(this,r),e.onerror=h(this,s),e.open(this.method,`${this.url}?${t}`,!0),e.send(null)});let{method:n="GET",url:M="/cookie",onload:S=a.onXhrLoad,onerror:k=a.onXhrError}=e;this.method=n,this.url=M,u(this,r,S),u(this,s,k),t.on(`message:${m.set}`,h(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};
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
@@ -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 { type InSiteWebSocket } from \"insite-ws/client\";\nimport { headers, type Method } from \"../common\";\n\n\n/* eslint-disable unicorn/prefer-add-event-listener */\n\ntype 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,EAcaC,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",
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "insite-cookie",
3
- "version": "2.0.11",
3
+ "version": "2.0.12",
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.24",
12
+ "packageManager": "bun@1.1.25",
13
13
  "scripts": {
14
14
  "test": "echo \"Error: no test specified\" && exit 1",
15
15
  "build": "bun .conveyer.js",
@@ -37,7 +37,7 @@
37
37
  "devDependencies": {
38
38
  "@nesvet/conveyer": "^2.2.4",
39
39
  "@nesvet/eslint-config": "^2.0.24",
40
- "@types/node": "^22.3.0",
40
+ "@types/node": "^22.5.0",
41
41
  "@types/ws": "^8.5.12",
42
42
  "typescript": "^5.5.4"
43
43
  }