@authdog/node-commons 0.0.8 → 0.0.17

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.d.mts CHANGED
@@ -1,7 +1,14 @@
1
1
  interface PublicKeyPayload {
2
2
  environmentId: string;
3
3
  identityHost: string;
4
+ version?: string;
5
+ region?: "EU" | "US";
4
6
  }
5
7
  declare const getPublicKeyPayload: (publicKey: string) => PublicKeyPayload;
6
8
 
7
- export { type PublicKeyPayload, getPublicKeyPayload };
9
+ declare const parseCookies: (cookieHeader: string | null) => {
10
+ name: string;
11
+ value: string;
12
+ }[];
13
+
14
+ export { getPublicKeyPayload, parseCookies };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,14 @@
1
1
  interface PublicKeyPayload {
2
2
  environmentId: string;
3
3
  identityHost: string;
4
+ version?: string;
5
+ region?: "EU" | "US";
4
6
  }
5
7
  declare const getPublicKeyPayload: (publicKey: string) => PublicKeyPayload;
6
8
 
7
- export { type PublicKeyPayload, getPublicKeyPayload };
9
+ declare const parseCookies: (cookieHeader: string | null) => {
10
+ name: string;
11
+ value: string;
12
+ }[];
13
+
14
+ export { getPublicKeyPayload, parseCookies };
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- var o=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var c=(r,e)=>{for(var i in e)o(r,i,{get:e[i],enumerable:!0})},d=(r,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of s(e))!l.call(r,t)&&t!==i&&o(r,t,{get:()=>e[t],enumerable:!(n=a(e,t))||n.enumerable});return r};var y=r=>d(o({},"__esModule",{value:!0}),r);var p={};c(p,{getPublicKeyPayload:()=>f});module.exports=y(p);var f=r=>{if(!r)throw new Error("Public key is not defined");if(!r.startsWith("pk_"))throw new Error("Invalid public key");try{return JSON.parse(Buffer.from(r.replace("pk_",""),"base64").toString("utf-8"))}catch{throw new Error("Failed to parse public key")}};0&&(module.exports={getPublicKeyPayload});
1
+ "use strict";var n=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var c=(r,t)=>{for(var e in t)n(r,e,{get:t[e],enumerable:!0})},f=(r,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of p(t))!u.call(r,o)&&o!==e&&n(r,o,{get:()=>t[o],enumerable:!(i=l(t,o))||i.enumerable});return r};var y=r=>f(n({},"__esModule",{value:!0}),r);var d={};c(d,{getPublicKeyPayload:()=>s,parseCookies:()=>a});module.exports=y(d);var s=r=>{if(!r)throw new Error("Public key is not defined");if(!r.startsWith("pk_"))throw new Error("Invalid public key");try{return JSON.parse(Buffer.from(r.replace("pk_",""),"base64").toString("utf-8"))}catch{throw new Error("Failed to parse public key")}};var a=r=>r?r.split(";").map(t=>{let[e,i]=t.trim().split("=");return{name:e,value:i}}):[];0&&(module.exports={getPublicKeyPayload,parseCookies});
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export interface PublicKeyPayload {\n environmentId: string;\n identityHost: string;\n};\n\nexport const getPublicKeyPayload = (publicKey: string): PublicKeyPayload => {\n if (!publicKey) {\n throw new Error(\"Public key is not defined\");\n }\n \n if (!publicKey.startsWith(\"pk_\")) {\n throw new Error(\"Invalid public key\");\n }\n \n try {\n return JSON.parse(Buffer.from(publicKey.replace(\"pk_\", \"\"), \"base64\").toString(\"utf-8\"));\n } catch (e) {\n throw new Error(\"Failed to parse public key\");\n }\n };\n "],"mappings":"4ZAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,IAAA,eAAAC,EAAAH,GAKO,IAAME,EAAuBE,GAAwC,CACxE,GAAI,CAACA,EACH,MAAM,IAAI,MAAM,2BAA2B,EAG7C,GAAI,CAACA,EAAU,WAAW,KAAK,EAC7B,MAAM,IAAI,MAAM,oBAAoB,EAGtC,GAAI,CACF,OAAO,KAAK,MAAM,OAAO,KAAKA,EAAU,QAAQ,MAAO,EAAE,EAAG,QAAQ,EAAE,SAAS,OAAO,CAAC,CACzF,MAAY,CACV,MAAM,IAAI,MAAM,4BAA4B,CAC9C,CACF","names":["index_exports","__export","getPublicKeyPayload","__toCommonJS","publicKey"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/public-key.ts","../src/cookies.ts"],"sourcesContent":["export { getPublicKeyPayload } from \"./public-key\";\nexport { parseCookies } from \"./cookies\";\n","export interface PublicKeyPayload {\n environmentId: string;\n identityHost: string;\n version?: string;\n region?: \"EU\" | \"US\";\n}\nexport const getPublicKeyPayload = (publicKey: string): PublicKeyPayload => {\n if (!publicKey) {\n throw new Error(\"Public key is not defined\");\n }\n if (!publicKey.startsWith(\"pk_\")) {\n throw new Error(\"Invalid public key\");\n }\n try {\n return JSON.parse(\n Buffer.from(publicKey.replace(\"pk_\", \"\"), \"base64\").toString(\"utf-8\"),\n );\n } catch (e) {\n throw new Error(\"Failed to parse public key\");\n }\n};\n","// Function to parse cookies from request\nexport const parseCookies = (cookieHeader: string | null) => {\n if (!cookieHeader) {\n return [];\n }\n\n return cookieHeader.split(\";\").map((cookie) => {\n const [name, value] = cookie.trim().split(\"=\");\n return { name, value };\n });\n};\n"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,EAAA,iBAAAC,IAAA,eAAAC,EAAAJ,GCMO,IAAMK,EAAuBC,GAAwC,CAC1E,GAAI,CAACA,EACH,MAAM,IAAI,MAAM,2BAA2B,EAE7C,GAAI,CAACA,EAAU,WAAW,KAAK,EAC7B,MAAM,IAAI,MAAM,oBAAoB,EAEtC,GAAI,CACF,OAAO,KAAK,MACV,OAAO,KAAKA,EAAU,QAAQ,MAAO,EAAE,EAAG,QAAQ,EAAE,SAAS,OAAO,CACtE,CACF,MAAY,CACV,MAAM,IAAI,MAAM,4BAA4B,CAC9C,CACF,ECnBO,IAAMC,EAAgBC,GACtBA,EAIEA,EAAa,MAAM,GAAG,EAAE,IAAKC,GAAW,CAC7C,GAAM,CAACC,EAAMC,CAAK,EAAIF,EAAO,KAAK,EAAE,MAAM,GAAG,EAC7C,MAAO,CAAE,KAAAC,EAAM,MAAAC,CAAM,CACvB,CAAC,EANQ,CAAC","names":["index_exports","__export","getPublicKeyPayload","parseCookies","__toCommonJS","getPublicKeyPayload","publicKey","parseCookies","cookieHeader","cookie","name","value"]}
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- var t=r=>{if(!r)throw new Error("Public key is not defined");if(!r.startsWith("pk_"))throw new Error("Invalid public key");try{return JSON.parse(Buffer.from(r.replace("pk_",""),"base64").toString("utf-8"))}catch{throw new Error("Failed to parse public key")}};export{t as getPublicKeyPayload};
1
+ var i=r=>{if(!r)throw new Error("Public key is not defined");if(!r.startsWith("pk_"))throw new Error("Invalid public key");try{return JSON.parse(Buffer.from(r.replace("pk_",""),"base64").toString("utf-8"))}catch{throw new Error("Failed to parse public key")}};var n=r=>r?r.split(";").map(t=>{let[e,o]=t.trim().split("=");return{name:e,value:o}}):[];export{i as getPublicKeyPayload,n as parseCookies};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export interface PublicKeyPayload {\n environmentId: string;\n identityHost: string;\n};\n\nexport const getPublicKeyPayload = (publicKey: string): PublicKeyPayload => {\n if (!publicKey) {\n throw new Error(\"Public key is not defined\");\n }\n \n if (!publicKey.startsWith(\"pk_\")) {\n throw new Error(\"Invalid public key\");\n }\n \n try {\n return JSON.parse(Buffer.from(publicKey.replace(\"pk_\", \"\"), \"base64\").toString(\"utf-8\"));\n } catch (e) {\n throw new Error(\"Failed to parse public key\");\n }\n };\n "],"mappings":"AAKO,IAAMA,EAAuBC,GAAwC,CACxE,GAAI,CAACA,EACH,MAAM,IAAI,MAAM,2BAA2B,EAG7C,GAAI,CAACA,EAAU,WAAW,KAAK,EAC7B,MAAM,IAAI,MAAM,oBAAoB,EAGtC,GAAI,CACF,OAAO,KAAK,MAAM,OAAO,KAAKA,EAAU,QAAQ,MAAO,EAAE,EAAG,QAAQ,EAAE,SAAS,OAAO,CAAC,CACzF,MAAY,CACV,MAAM,IAAI,MAAM,4BAA4B,CAC9C,CACF","names":["getPublicKeyPayload","publicKey"]}
1
+ {"version":3,"sources":["../src/public-key.ts","../src/cookies.ts"],"sourcesContent":["export interface PublicKeyPayload {\n environmentId: string;\n identityHost: string;\n version?: string;\n region?: \"EU\" | \"US\";\n}\nexport const getPublicKeyPayload = (publicKey: string): PublicKeyPayload => {\n if (!publicKey) {\n throw new Error(\"Public key is not defined\");\n }\n if (!publicKey.startsWith(\"pk_\")) {\n throw new Error(\"Invalid public key\");\n }\n try {\n return JSON.parse(\n Buffer.from(publicKey.replace(\"pk_\", \"\"), \"base64\").toString(\"utf-8\"),\n );\n } catch (e) {\n throw new Error(\"Failed to parse public key\");\n }\n};\n","// Function to parse cookies from request\nexport const parseCookies = (cookieHeader: string | null) => {\n if (!cookieHeader) {\n return [];\n }\n\n return cookieHeader.split(\";\").map((cookie) => {\n const [name, value] = cookie.trim().split(\"=\");\n return { name, value };\n });\n};\n"],"mappings":"AAMO,IAAMA,EAAuBC,GAAwC,CAC1E,GAAI,CAACA,EACH,MAAM,IAAI,MAAM,2BAA2B,EAE7C,GAAI,CAACA,EAAU,WAAW,KAAK,EAC7B,MAAM,IAAI,MAAM,oBAAoB,EAEtC,GAAI,CACF,OAAO,KAAK,MACV,OAAO,KAAKA,EAAU,QAAQ,MAAO,EAAE,EAAG,QAAQ,EAAE,SAAS,OAAO,CACtE,CACF,MAAY,CACV,MAAM,IAAI,MAAM,4BAA4B,CAC9C,CACF,ECnBO,IAAMC,EAAgBC,GACtBA,EAIEA,EAAa,MAAM,GAAG,EAAE,IAAKC,GAAW,CAC7C,GAAM,CAACC,EAAMC,CAAK,EAAIF,EAAO,KAAK,EAAE,MAAM,GAAG,EAC7C,MAAO,CAAE,KAAAC,EAAM,MAAAC,CAAM,CACvB,CAAC,EANQ,CAAC","names":["getPublicKeyPayload","publicKey","parseCookies","cookieHeader","cookie","name","value"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authdog/node-commons",
3
- "version": "0.0.8",
3
+ "version": "0.0.17",
4
4
  "description": "Authdog Next.js SDK",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -9,14 +9,7 @@
9
9
  "files": [
10
10
  "dist/"
11
11
  ],
12
- "dependencies": {
13
- "next": "^15.1.0",
14
- "react": "^19.1.0"
15
- },
16
12
  "devDependencies": {
17
- "@types/next": "^9.0.0",
18
- "@types/node": "^22.10.5",
19
- "@types/react": "^19.1.0",
20
13
  "dotenv": "^16.4.7",
21
14
  "prettier": "^3.4.2",
22
15
  "tsup": "^8.3.5",