@zyphe-sdk/core 0.1.5 → 0.1.6
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/.turbo/turbo-build.log +22 -0
- package/dist/index.cjs +112 -85
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1607 -25
- package/dist/index.d.ts +1607 -25
- package/dist/index.js +99 -70
- package/dist/index.js.map +1 -1
- package/dist/openapi.d.ts +959 -0
- package/dist/openapi.json +3094 -0
- package/docs/express.md +45 -0
- package/docs/fastify.md +85 -0
- package/docs/hono.md +32 -0
- package/package.json +17 -38
- package/public/openapi.d.ts +959 -0
- package/public/openapi.json +3094 -0
- package/scripts/generate-openapi.ts +70 -0
- package/src/client.ts +10 -0
- package/src/constants.ts +29 -0
- package/src/index.ts +4 -0
- package/src/types.ts +77 -0
- package/src/verification-session.ts +83 -0
- package/src/webhook.ts +104 -0
- package/tsconfig.json +32 -0
- package/tsup.config.ts +11 -0
package/dist/index.js
CHANGED
|
@@ -1,15 +1,104 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/constants.ts
|
|
2
|
+
var Environments = {
|
|
3
|
+
LOCAL: "local",
|
|
4
|
+
STAGING: "staging",
|
|
5
|
+
PRODUCTION: "production"
|
|
6
|
+
};
|
|
7
|
+
var EnvironmentConfigs = {
|
|
8
|
+
[Environments.LOCAL]: {
|
|
9
|
+
appUrl: "http://localhost:5173",
|
|
10
|
+
apiUrl: "http://localhost:3000"
|
|
11
|
+
},
|
|
12
|
+
[Environments.STAGING]: {
|
|
13
|
+
appUrl: "https://app-dev.zyphe.com",
|
|
14
|
+
apiUrl: "https://api-dev.zyphe.com"
|
|
15
|
+
},
|
|
16
|
+
[Environments.PRODUCTION]: {
|
|
17
|
+
appUrl: "https://verify.zyphe.com",
|
|
18
|
+
apiUrl: "https://api.zyphe.com"
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
var API_KEY_HEADER = "x-api-key";
|
|
22
|
+
|
|
23
|
+
// src/client.ts
|
|
24
|
+
import createClient from "openapi-fetch";
|
|
25
|
+
var zypheApiClient = (opts) => {
|
|
26
|
+
return createClient({
|
|
27
|
+
baseUrl: EnvironmentConfigs[opts.environment].apiUrl
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// src/verification-session.ts
|
|
32
|
+
function createVerificationSession(email, flowId, flowStepId, isSandbox, opts) {
|
|
33
|
+
const client = zypheApiClient(opts);
|
|
34
|
+
return client.POST("/sdk/flow/{flow_id}/vr/create", {
|
|
35
|
+
body: { email, flowStepId },
|
|
36
|
+
headers: {
|
|
37
|
+
[API_KEY_HEADER]: opts.apiKey
|
|
38
|
+
},
|
|
39
|
+
params: {
|
|
40
|
+
path: {
|
|
41
|
+
flow_id: flowId
|
|
42
|
+
},
|
|
43
|
+
query: {
|
|
44
|
+
sandbox: isSandbox
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function getFlowUrlOrigin(environment) {
|
|
50
|
+
switch (environment) {
|
|
51
|
+
case Environments.LOCAL:
|
|
52
|
+
return EnvironmentConfigs[Environments.LOCAL].appUrl;
|
|
53
|
+
case Environments.STAGING:
|
|
54
|
+
return EnvironmentConfigs[Environments.STAGING].appUrl;
|
|
55
|
+
case Environments.PRODUCTION:
|
|
56
|
+
return EnvironmentConfigs[Environments.PRODUCTION].appUrl;
|
|
57
|
+
default:
|
|
58
|
+
throw new Error(`Invalid environment: ${environment}`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function constructVerificationSessionUrl({
|
|
62
|
+
flowParams,
|
|
63
|
+
verificationSession,
|
|
64
|
+
opts
|
|
65
|
+
}) {
|
|
66
|
+
const origin = getFlowUrlOrigin(opts.environment);
|
|
67
|
+
const { isSandbox, product } = flowParams;
|
|
68
|
+
const { handoffBaseUrl, primaryColor, secondaryColor, isFullscreen } = opts;
|
|
69
|
+
if (!verificationSession) {
|
|
70
|
+
throw new Error("Failed to create verification session");
|
|
71
|
+
}
|
|
72
|
+
let baseUrl = `${origin}${isSandbox ? "/sandbox" : ""}/flow/${verificationSession.flowSlug}/${product}/${verificationSession.flowStepSlug}?zypheVr=${encodeURIComponent(verificationSession.verificationRequest.id)}&zypheEmail=${encodeURIComponent(verificationSession.email)}&zypheToken=${encodeURIComponent(verificationSession.zypheToken)}`;
|
|
73
|
+
if (handoffBaseUrl) {
|
|
74
|
+
baseUrl += `&zypheHandoffBaseUrl=${encodeURIComponent(handoffBaseUrl)}`;
|
|
75
|
+
}
|
|
76
|
+
if (primaryColor) {
|
|
77
|
+
baseUrl += `&zyphePrimaryColor=${encodeURIComponent(primaryColor)}`;
|
|
78
|
+
}
|
|
79
|
+
if (secondaryColor) {
|
|
80
|
+
baseUrl += `&zypheSecondaryColor=${encodeURIComponent(secondaryColor)}`;
|
|
81
|
+
}
|
|
82
|
+
if (isFullscreen) {
|
|
83
|
+
baseUrl += `&zypheFullscreen=${encodeURIComponent(isFullscreen)}`;
|
|
84
|
+
}
|
|
85
|
+
return baseUrl;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// src/webhook.ts
|
|
2
89
|
function parseSignatureHeader(signatureHeader) {
|
|
3
90
|
const match = signatureHeader.match(/^t=(\d+),v0=([a-fA-F0-9]+)$/);
|
|
4
91
|
if (!match) {
|
|
5
92
|
throw new Error("Invalid signature header format");
|
|
6
93
|
}
|
|
7
94
|
const [, timestamp, signatureHex] = match;
|
|
95
|
+
if (!timestamp || !signatureHex) {
|
|
96
|
+
throw new Error("Invalid signature header format");
|
|
97
|
+
}
|
|
8
98
|
return { timestamp, signatureHex };
|
|
9
99
|
}
|
|
10
100
|
function hexToBytes(hex) {
|
|
11
|
-
if (hex.length % 2 !== 0)
|
|
12
|
-
throw new Error("Invalid hex string");
|
|
101
|
+
if (hex.length % 2 !== 0) throw new Error("Invalid hex string");
|
|
13
102
|
const bytes = new Uint8Array(hex.length / 2);
|
|
14
103
|
for (let i = 0; i < hex.length; i += 2) {
|
|
15
104
|
bytes[i / 2] = parseInt(hex.slice(i, i + 2), 16);
|
|
@@ -20,8 +109,7 @@ function bufferToHex(buffer) {
|
|
|
20
109
|
return Array.from(new Uint8Array(buffer)).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
21
110
|
}
|
|
22
111
|
function timingSafeEqual(a, b) {
|
|
23
|
-
if (a.length !== b.length)
|
|
24
|
-
return false;
|
|
112
|
+
if (a.length !== b.length) return false;
|
|
25
113
|
let result = 0;
|
|
26
114
|
for (let i = 0; i < a.length; i++) {
|
|
27
115
|
result |= a.charCodeAt(i) ^ b.charCodeAt(i);
|
|
@@ -38,76 +126,17 @@ var WebhookSignatureErrorMessages = {
|
|
|
38
126
|
[WebhookSignatureErrorCodes.INVALID_SIGNATURE_HEADER]: "Invalid signature header",
|
|
39
127
|
[WebhookSignatureErrorCodes.SIGNATURE_MISMATCH]: "Signature mismatch"
|
|
40
128
|
};
|
|
41
|
-
|
|
42
|
-
// src/webhook/browser.ts
|
|
43
|
-
async function verifyWebhookSignatureHeader(secretHex, rawBodyString, signatureHeader) {
|
|
44
|
-
try {
|
|
45
|
-
const { timestamp, signatureHex } = parseSignatureHeader(signatureHeader);
|
|
46
|
-
const signedPayload = `${timestamp}.${rawBodyString}`;
|
|
47
|
-
const secretKeyBytes = hexToBytes(secretHex);
|
|
48
|
-
const cryptoKey = await window.crypto.subtle.importKey(
|
|
49
|
-
"raw",
|
|
50
|
-
secretKeyBytes,
|
|
51
|
-
{ name: "HMAC", hash: "SHA-256" },
|
|
52
|
-
false,
|
|
53
|
-
["sign", "verify"]
|
|
54
|
-
);
|
|
55
|
-
const encoder = new TextEncoder();
|
|
56
|
-
const payloadBytes = encoder.encode(signedPayload);
|
|
57
|
-
const signatureBuffer = await window.crypto.subtle.sign(
|
|
58
|
-
"HMAC",
|
|
59
|
-
cryptoKey,
|
|
60
|
-
payloadBytes
|
|
61
|
-
);
|
|
62
|
-
const computedSignature = bufferToHex(signatureBuffer);
|
|
63
|
-
return timingSafeEqual(computedSignature, signatureHex);
|
|
64
|
-
} catch (error) {
|
|
65
|
-
console.error("Error verifying webhook signature:", error);
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// src/webhook/node.ts
|
|
71
|
-
import { createHmac, timingSafeEqual as cryptoTimingSafeEqual } from "crypto";
|
|
72
|
-
function verifyWebhookSignatureHeader2(secretHex, rawBodyString, signatureHeader) {
|
|
73
|
-
try {
|
|
74
|
-
const { timestamp, signatureHex } = parseSignatureHeader(signatureHeader);
|
|
75
|
-
const signedPayload = `${timestamp}.${rawBodyString}`;
|
|
76
|
-
const hmac = createHmac("sha256", Buffer.from(secretHex, "hex"));
|
|
77
|
-
hmac.update(signedPayload);
|
|
78
|
-
const computedSignature = hmac.digest("hex");
|
|
79
|
-
return cryptoTimingSafeEqual(
|
|
80
|
-
Buffer.from(computedSignature, "hex"),
|
|
81
|
-
Buffer.from(signatureHex, "hex")
|
|
82
|
-
);
|
|
83
|
-
} catch (error) {
|
|
84
|
-
console.error("Error verifying webhook signature:", error);
|
|
85
|
-
return false;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// src/webhook/webhook.ts
|
|
90
|
-
async function verifyWebhookSignature(secretHex, rawBodyString, signatureHeader) {
|
|
91
|
-
var _a, _b;
|
|
92
|
-
if (typeof window !== "undefined" && ((_a = window == null ? void 0 : window.crypto) == null ? void 0 : _a.subtle)) {
|
|
93
|
-
return verifyWebhookSignatureHeader(secretHex, rawBodyString, signatureHeader);
|
|
94
|
-
} else if (typeof process !== "undefined" && ((_b = process == null ? void 0 : process.versions) == null ? void 0 : _b.node)) {
|
|
95
|
-
return verifyWebhookSignatureHeader2(secretHex, rawBodyString, signatureHeader);
|
|
96
|
-
} else {
|
|
97
|
-
throw new Error(
|
|
98
|
-
"Unsupported environment: neither browser Web Crypto API nor Node.js crypto is available"
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
129
|
export {
|
|
130
|
+
API_KEY_HEADER,
|
|
131
|
+
EnvironmentConfigs,
|
|
132
|
+
Environments,
|
|
103
133
|
WebhookSignatureErrorCodes,
|
|
104
134
|
WebhookSignatureErrorMessages,
|
|
105
135
|
bufferToHex,
|
|
136
|
+
constructVerificationSessionUrl,
|
|
137
|
+
createVerificationSession,
|
|
106
138
|
hexToBytes,
|
|
107
139
|
parseSignatureHeader,
|
|
108
|
-
timingSafeEqual
|
|
109
|
-
verifyWebhookSignature,
|
|
110
|
-
verifyWebhookSignatureHeader as verifyWebhookSignatureHeaderBrowser,
|
|
111
|
-
verifyWebhookSignatureHeader2 as verifyWebhookSignatureHeaderNode
|
|
140
|
+
timingSafeEqual
|
|
112
141
|
};
|
|
113
142
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/
|
|
1
|
+
{"version":3,"sources":["../src/constants.ts","../src/client.ts","../src/verification-session.ts","../src/webhook.ts"],"sourcesContent":["export const Environments = {\n LOCAL: \"local\",\n STAGING: \"staging\",\n PRODUCTION: \"production\",\n} as const;\n\nexport type Environment = (typeof Environments)[keyof typeof Environments];\n\ninterface EnvironmentConfig {\n appUrl: string;\n apiUrl: string;\n}\n\nexport const EnvironmentConfigs: Record<Environment, EnvironmentConfig> = {\n [Environments.LOCAL]: {\n appUrl: \"http://localhost:5173\",\n apiUrl: \"http://localhost:3000\",\n },\n [Environments.STAGING]: {\n appUrl: \"https://app-dev.zyphe.com\",\n apiUrl: \"https://api-dev.zyphe.com\",\n },\n [Environments.PRODUCTION]: {\n appUrl: \"https://verify.zyphe.com\",\n apiUrl: \"https://api.zyphe.com\",\n },\n};\n\nexport const API_KEY_HEADER = \"x-api-key\";\n","import createClient from \"openapi-fetch\";\nimport type { paths } from \"@zyphe-sdk/core/openapi\";\nimport { EnvironmentConfigs } from \"./constants\";\nimport type { SDKOptions } from \"./types\";\n\nexport const zypheApiClient = (opts: SDKOptions) => {\n return createClient<paths>({\n baseUrl: EnvironmentConfigs[opts.environment].apiUrl,\n });\n};\n","import { zypheApiClient } from \"./client\";\nimport { API_KEY_HEADER, EnvironmentConfigs, Environments } from \"./constants\";\nimport type {\n InitializeZypheFlowParams,\n SdkCreateVerificationRequestResponse,\n SDKOptions,\n} from \"./types\";\n\nexport function createVerificationSession(\n email: string,\n flowId: string,\n flowStepId: string,\n isSandbox: boolean,\n opts: SDKOptions\n) {\n const client = zypheApiClient(opts);\n\n return client.POST(\"/sdk/flow/{flow_id}/vr/create\", {\n body: { email, flowStepId },\n headers: {\n [API_KEY_HEADER]: opts.apiKey,\n },\n params: {\n path: {\n flow_id: flowId,\n },\n query: {\n sandbox: isSandbox,\n },\n },\n });\n}\n\nfunction getFlowUrlOrigin(environment: SDKOptions[\"environment\"]) {\n switch (environment) {\n case Environments.LOCAL:\n return EnvironmentConfigs[Environments.LOCAL].appUrl;\n case Environments.STAGING:\n return EnvironmentConfigs[Environments.STAGING].appUrl;\n case Environments.PRODUCTION:\n return EnvironmentConfigs[Environments.PRODUCTION].appUrl;\n default:\n throw new Error(`Invalid environment: ${environment}`);\n }\n}\n\nexport function constructVerificationSessionUrl({\n flowParams,\n verificationSession,\n opts,\n}: {\n flowParams: InitializeZypheFlowParams;\n verificationSession: SdkCreateVerificationRequestResponse;\n opts: SDKOptions;\n}) {\n const origin = getFlowUrlOrigin(opts.environment);\n const { isSandbox, product } = flowParams;\n const { handoffBaseUrl, primaryColor, secondaryColor, isFullscreen } = opts;\n\n if (!verificationSession) {\n throw new Error(\"Failed to create verification session\");\n }\n\n let baseUrl = `${origin}${isSandbox ? \"/sandbox\" : \"\"}/flow/${verificationSession.flowSlug}/${product}/${verificationSession.flowStepSlug}?zypheVr=${encodeURIComponent(verificationSession.verificationRequest.id)}&zypheEmail=${encodeURIComponent(verificationSession.email)}&zypheToken=${encodeURIComponent(verificationSession.zypheToken)}`;\n\n if (handoffBaseUrl) {\n baseUrl += `&zypheHandoffBaseUrl=${encodeURIComponent(handoffBaseUrl)}`;\n }\n\n if (primaryColor) {\n baseUrl += `&zyphePrimaryColor=${encodeURIComponent(primaryColor)}`;\n }\n\n if (secondaryColor) {\n baseUrl += `&zypheSecondaryColor=${encodeURIComponent(secondaryColor)}`;\n }\n\n if (isFullscreen) {\n baseUrl += `&zypheFullscreen=${encodeURIComponent(isFullscreen)}`;\n }\n\n return baseUrl;\n}\n","export interface SignatureComponents {\n timestamp: string;\n signatureHex: string;\n}\n\n/**\n * Parses a webhook signature header of the form \"t=<timestamp>,v0=<signature>\"\n * @param signatureHeader - The header string, e.g. \"t=1234567890,v0=abcdef...\"\n * @returns The parsed timestamp and signature hex\n */\nexport function parseSignatureHeader(\n signatureHeader: string\n): SignatureComponents {\n const match = signatureHeader.match(/^t=(\\d+),v0=([a-fA-F0-9]+)$/);\n if (!match) {\n throw new Error(\"Invalid signature header format\");\n }\n const [, timestamp, signatureHex] = match;\n\n if (!timestamp || !signatureHex) {\n throw new Error(\"Invalid signature header format\");\n }\n\n return { timestamp, signatureHex };\n}\n\n/**\n * Converts a hex string to a Uint8Array\n * @param hex - The hex string to convert\n * @returns The resulting Uint8Array\n */\nexport function hexToBytes(hex: string): Uint8Array {\n if (hex.length % 2 !== 0) throw new Error(\"Invalid hex string\");\n const bytes = new Uint8Array(hex.length / 2);\n for (let i = 0; i < hex.length; i += 2) {\n bytes[i / 2] = parseInt(hex.slice(i, i + 2), 16);\n }\n return bytes;\n}\n\n/**\n * Converts an ArrayBuffer to a hex string\n * @param buffer - The buffer to convert\n * @returns The hex string representation\n */\nexport function bufferToHex(buffer: ArrayBuffer): string {\n return Array.from(new Uint8Array(buffer))\n .map((b) => b.toString(16).padStart(2, \"0\"))\n .join(\"\");\n}\n\n/**\n * Compares two strings in constant time to prevent timing attacks\n * @param a - First string\n * @param b - Second string\n * @returns True if strings are equal, false otherwise\n */\nexport function timingSafeEqual(a: string, b: string): boolean {\n if (a.length !== b.length) return false;\n let result = 0;\n for (let i = 0; i < a.length; i++) {\n result |= a.charCodeAt(i) ^ b.charCodeAt(i);\n }\n return result === 0;\n}\n\nexport const WebhookSignatureErrorCodes = {\n MISSING_SIGNATURE_HEADER: 1,\n INVALID_SIGNATURE_HEADER: 2,\n SIGNATURE_MISMATCH: 3,\n} as const;\n\nexport const WebhookSignatureErrorMessages = {\n [WebhookSignatureErrorCodes.MISSING_SIGNATURE_HEADER]:\n \"Missing signature header\",\n [WebhookSignatureErrorCodes.INVALID_SIGNATURE_HEADER]:\n \"Invalid signature header\",\n [WebhookSignatureErrorCodes.SIGNATURE_MISMATCH]: \"Signature mismatch\",\n} as const;\n\nexport interface WebhookVerifierOptions<T extends Function> {\n /**\n * The hex-encoded secret key used to verify the signature\n */\n secretHex: string;\n\n /**\n * The name of the header containing the signature\n * @default \"x-signature\"\n */\n signatureHeader?: string;\n\n /**\n * Optional function to handle unauthorized requests\n * @default Returns 401 Unauthorized with JSON error\n */\n onUnauthorized?: T;\n\n /**\n * Whether to make the raw body available on req.rawBody\n * @default true\n */\n exposeRawBody?: boolean;\n}\n"],"mappings":";AAAO,IAAM,eAAe;AAAA,EAC1B,OAAO;AAAA,EACP,SAAS;AAAA,EACT,YAAY;AACd;AASO,IAAM,qBAA6D;AAAA,EACxE,CAAC,aAAa,KAAK,GAAG;AAAA,IACpB,QAAQ;AAAA,IACR,QAAQ;AAAA,EACV;AAAA,EACA,CAAC,aAAa,OAAO,GAAG;AAAA,IACtB,QAAQ;AAAA,IACR,QAAQ;AAAA,EACV;AAAA,EACA,CAAC,aAAa,UAAU,GAAG;AAAA,IACzB,QAAQ;AAAA,IACR,QAAQ;AAAA,EACV;AACF;AAEO,IAAM,iBAAiB;;;AC5B9B,OAAO,kBAAkB;AAKlB,IAAM,iBAAiB,CAAC,SAAqB;AAClD,SAAO,aAAoB;AAAA,IACzB,SAAS,mBAAmB,KAAK,WAAW,EAAE;AAAA,EAChD,CAAC;AACH;;;ACDO,S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