@authdog/node-commons 0.0.8
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 +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +37 -0
package/dist/index.d.mts
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +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});
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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"]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +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};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +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"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@authdog/node-commons",
|
|
3
|
+
"version": "0.0.8",
|
|
4
|
+
"description": "Authdog Next.js SDK",
|
|
5
|
+
"source": "src/index.ts",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"module": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist/"
|
|
11
|
+
],
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"next": "^15.1.0",
|
|
14
|
+
"react": "^19.1.0"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@types/next": "^9.0.0",
|
|
18
|
+
"@types/node": "^22.10.5",
|
|
19
|
+
"@types/react": "^19.1.0",
|
|
20
|
+
"dotenv": "^16.4.7",
|
|
21
|
+
"prettier": "^3.4.2",
|
|
22
|
+
"tsup": "^8.3.5",
|
|
23
|
+
"typescript": "^5.7.2",
|
|
24
|
+
"vitest": "^2.1.8"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"registry": "https://registry.npmjs.org/",
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"format": "prettier --config .prettierrc.json --write \"**/*.{ts,md}\"",
|
|
32
|
+
"type-check": "tsc",
|
|
33
|
+
"clean": "rm -rf dist",
|
|
34
|
+
"build": "pnpm clean && tsup",
|
|
35
|
+
"ship": "pnpm build && pnpm publish --access public --no-git-checks"
|
|
36
|
+
}
|
|
37
|
+
}
|