@authdog/node-commons 0.0.8 → 0.0.16
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 +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -7
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
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 {
|
|
9
|
+
export { getPublicKeyPayload };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
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 {
|
|
9
|
+
export { getPublicKeyPayload };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var o=Object.defineProperty;var
|
|
1
|
+
"use strict";var o=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var y=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 l(e))!y.call(r,t)&&t!==i&&o(r,t,{get:()=>e[t],enumerable:!(n=s(e,t))||n.enumerable});return r};var f=r=>d(o({},"__esModule",{value:!0}),r);var P={};c(P,{getPublicKeyPayload:()=>a});module.exports=f(P);var a=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
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
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/platform-public-key/index.ts"],"sourcesContent":["export {\n getPublicKeyPayload\n} from \"./platform-public-key\";","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"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,IAAA,eAAAC,EAAAH,GCMO,IAAMI,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","names":["index_exports","__export","getPublicKeyPayload","__toCommonJS","getPublicKeyPayload","publicKey"]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
1
|
+
var e=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{e as getPublicKeyPayload};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export interface PublicKeyPayload {\n
|
|
1
|
+
{"version":3,"sources":["../src/platform-public-key/index.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"],"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","names":["getPublicKeyPayload","publicKey"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@authdog/node-commons",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
4
4
|
"description": "Authdog Next.js SDK",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -9,13 +9,8 @@
|
|
|
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/
|
|
18
|
-
"@types/node": "^22.10.5",
|
|
13
|
+
"@types/node": "^22.10.7",
|
|
19
14
|
"@types/react": "^19.1.0",
|
|
20
15
|
"dotenv": "^16.4.7",
|
|
21
16
|
"prettier": "^3.4.2",
|