insite-cookie 1.0.38 → 1.0.41

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
@@ -9,5 +9,5 @@ $ npm install insite-cookie
9
9
  Or
10
10
 
11
11
  ```sh
12
- $ yarn add insite-cookie
12
+ $ bun add insite-cookie
13
13
  ```
package/bun.lockb ADDED
Binary file
package/dist/client.js CHANGED
@@ -1,2 +1,2 @@
1
- var u=(e,o,t)=>{if(!o.has(e))throw TypeError("Cannot "+t)};var h=(e,o,t)=>(u(e,o,"read from private field"),t?t.call(e):o.get(e)),i=(e,o,t)=>{if(o.has(e))throw TypeError("Cannot add the same private member more than once");o instanceof WeakSet?o.add(e):o.set(e,t)};var a={set:"~setcookie"};var r,l=class{constructor(o,t={}){i(this,r,o=>{let t=new XMLHttpRequest;t.onload=this.onload,t.onerror=this.onerror,t.open(this.method,`${this.url}?${o}`,!0),t.send(null)});let{method:d="GET",url:c="/cookie",onload:s,onerror:n}=t;this.method=d,this.url=c,s&&(this.onload=s),n&&(this.onerror=n),o.on(`message:${a.set}`,h(this,r))}onload(){this.readyState===4&&this.status!==200&&console.error("Set cookie:",this.statusText)}onerror(){console.error("Set cookie:",this.statusText)}};r=new WeakMap;export{l as CookieSetter};
1
+ var h=e=>{throw TypeError(e)};var m=(e,o,t)=>o.has(e)||h("Cannot "+t);var i=(e,o,t)=>(m(e,o,"read from private field"),t?t.call(e):o.get(e)),a=(e,o,t)=>o.has(e)?h("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(e):o.set(e,t);var l={set:"~setcookie"};var r,d=class{constructor(o,t={}){a(this,r,o=>{let t=new XMLHttpRequest;t.onload=this.onload,t.onerror=this.onerror,t.open(this.method,`${this.url}?${o}`,!0),t.send(null)});let{method:c="GET",url:u="/cookie",onload:s,onerror:n}=t;this.method=c,this.url=u,s&&(this.onload=s),n&&(this.onerror=n),o.on(`message:${l.set}`,i(this,r))}onload(){this.readyState===4&&this.status!==200&&console.error("Set cookie:",this.statusText)}onerror(){console.error("Set cookie:",this.statusText)}};r=new WeakMap;export{d as CookieSetter};
2
2
  //# sourceMappingURL=client.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/common.js", "../src/client/Setter.js"],
4
4
  "sourcesContent": ["export const headers = {\n\tset: \"~setcookie\"\n};\n", "import { headers } from \"../common\";\n\n\nexport class CookieSetter {\n\tconstructor(ws, options = {}) {\n\t\t\n\t\tconst {\n\t\t\tmethod = \"GET\",\n\t\t\turl = \"/cookie\",\n\t\t\tonload,\n\t\t\tonerror\n\t\t} = options;\n\t\t\n\t\tthis.method = method;\n\t\tthis.url = url;\n\t\t\n\t\tif (onload)\n\t\t\tthis.onload = onload;\n\t\t\n\t\tif (onerror)\n\t\t\tthis.onerror = onerror;\n\t\t\n\t\tws.on(`message:${headers.set}`, this.#handleSet);\n\t\t\n\t}\n\t\n\t#handleSet = token => {\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\tonload() {\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\tonerror() {\n\t\t\n\t\tconsole.error(\"Set cookie:\", this.statusText);\n\t\t\n\t}\n\t\n}\n"],
5
- "mappings": "yQAAO,IAAMA,EAAU,CACtB,IAAK,YACN,ECFA,IAAAC,EAGaC,EAAN,KAAmB,CACzB,YAAYC,EAAIC,EAAU,CAAC,EAAG,CAsB9BC,EAAA,KAAAJ,EAAaK,GAAS,CACrB,IAAMC,EAAM,IAAI,eAEhBA,EAAI,OAAS,KAAK,OAClBA,EAAI,QAAU,KAAK,QAEnBA,EAAI,KAAK,KAAK,OAAQ,GAAG,KAAK,GAAG,IAAID,CAAK,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": ["headers", "_handleSet", "CookieSetter", "ws", "options", "__privateAdd", "token", "xhr", "method", "url", "onload", "onerror", "headers", "__privateGet"]
7
7
  }
package/package.json CHANGED
@@ -1,36 +1,36 @@
1
1
  {
2
- "name": "insite-cookie",
3
- "version": "1.0.38",
4
- "description": "Cookie support for inSite",
5
- "type": "module",
6
- "main": "./dist/server.js",
7
- "module": "./dist/server.js",
8
- "exports": {
9
- "./server": "./dist/server.js",
10
- "./client": "./dist/client.js"
11
- },
12
- "packageManager": "yarn@1.22.22",
13
- "scripts": {
14
- "test": "echo \"Error: no test specified\" && exit 1",
15
- "build": "node .conveyer"
16
- },
17
- "repository": {
18
- "type": "git",
19
- "url": "git+https://github.com/nesvet/insite-cookie.git"
20
- },
21
- "keywords": [
22
- "insite",
23
- "cookie",
24
- "client",
25
- "server"
26
- ],
27
- "author": "Eugene Nesvetaev <dev@nesvet.dev> (https://nesvet.dev/)",
28
- "license": "MIT",
29
- "dependencies": {
30
- "insite-ws": "^1"
31
- },
32
- "devDependencies": {
33
- "@nesvet/conveyer": "^1",
34
- "@nesvet/eslint-config": "^1"
35
- }
2
+ "name": "insite-cookie",
3
+ "version": "1.0.41",
4
+ "description": "Cookie support for inSite",
5
+ "type": "module",
6
+ "main": "./dist/server.js",
7
+ "module": "./dist/server.js",
8
+ "exports": {
9
+ "./server": "./dist/server.js",
10
+ "./client": "./dist/client.js"
11
+ },
12
+ "packageManager": "bun@1.1.9",
13
+ "scripts": {
14
+ "test": "echo \"Error: no test specified\" && exit 1",
15
+ "build": "bun .conveyer.js"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/nesvet/insite-cookie.git"
20
+ },
21
+ "keywords": [
22
+ "insite",
23
+ "cookie",
24
+ "client",
25
+ "server"
26
+ ],
27
+ "author": "Eugene Nesvetaev <dev@nesvet.dev> (https://nesvet.dev/)",
28
+ "license": "MIT",
29
+ "dependencies": {
30
+ "insite-ws": "^1"
31
+ },
32
+ "devDependencies": {
33
+ "@nesvet/conveyer": "^2",
34
+ "@nesvet/eslint-config": "^1"
35
+ }
36
36
  }