@sylphx/sdk 0.19.1 → 0.19.3
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 +63 -3
- package/dist/index.d.ts +78 -6
- package/dist/index.mjs +47 -3
- package/dist/index.mjs.map +1 -1
- package/dist/nextjs/index.mjs +11 -2
- package/dist/nextjs/index.mjs.map +1 -1
- package/dist/react/index.d.ts +6 -5
- package/dist/react/index.mjs +0 -37
- package/dist/react/index.mjs.map +1 -1
- package/dist/server/index.d.ts +78 -6
- package/dist/server/index.mjs +11 -2
- package/dist/server/index.mjs.map +1 -1
- package/dist/web-analytics.mjs.map +1 -1
- package/package.json +2 -2
package/dist/react/index.d.ts
CHANGED
|
@@ -9978,9 +9978,10 @@ declare function sanitizeUrl$1(url: string): string | null;
|
|
|
9978
9978
|
* 4. No silent fixes - Transparency over convenience (but warn + continue)
|
|
9979
9979
|
* 5. Single Source of Truth - All key logic in one place
|
|
9980
9980
|
*
|
|
9981
|
-
* Key Formats (ADR-
|
|
9982
|
-
* - Publishable key: pk_(dev|stg|prod|prev)_{
|
|
9983
|
-
* - Secret Key: sk_(dev|stg|prod|prev)_{
|
|
9981
|
+
* Key Formats (ADR-055):
|
|
9982
|
+
* - Publishable key: pk_(dev|stg|prod|prev)_{32hex} — client-safe
|
|
9983
|
+
* - Secret Key: sk_(dev|stg|prod|prev)_{64hex} — server-side only
|
|
9984
|
+
* - Legacy compatibility accepts embedded-ref keys from the superseded ADR-021 path.
|
|
9984
9985
|
*
|
|
9985
9986
|
* Legacy Key Formats (backward-compat):
|
|
9986
9987
|
* - App ID (old): app_(dev|stg|prod|prev)_[identifier] — Public identifier
|
|
@@ -10012,7 +10013,7 @@ interface KeyValidationResult {
|
|
|
10012
10013
|
/**
|
|
10013
10014
|
* Validate a legacy App ID (app_*) and return detailed results.
|
|
10014
10015
|
*
|
|
10015
|
-
* @deprecated Use validatePublicKey() for
|
|
10016
|
+
* @deprecated Use validatePublicKey() for ADR-055 pk_* keys.
|
|
10016
10017
|
*
|
|
10017
10018
|
* @example
|
|
10018
10019
|
* ```typescript
|
|
@@ -10029,7 +10030,7 @@ declare function validateAppId(key: string | undefined | null): KeyValidationRes
|
|
|
10029
10030
|
/**
|
|
10030
10031
|
* Validate and sanitize App ID, logging warnings.
|
|
10031
10032
|
*
|
|
10032
|
-
* @deprecated Use validateAndSanitizePublicKey() for
|
|
10033
|
+
* @deprecated Use validateAndSanitizePublicKey() for ADR-055 pk_* keys.
|
|
10033
10034
|
* @throws Error if the key is invalid and cannot be sanitized
|
|
10034
10035
|
* @returns The sanitized App ID
|
|
10035
10036
|
*/
|
package/dist/react/index.mjs
CHANGED
|
@@ -121,12 +121,10 @@ var init_constants = __esm({
|
|
|
121
121
|
// src/lib/pkce.ts
|
|
122
122
|
var pkce_exports = {};
|
|
123
123
|
__export(pkce_exports, {
|
|
124
|
-
clearAllPKCEVerifiers: () => clearAllPKCEVerifiers,
|
|
125
124
|
clearPKCEVerifier: () => clearPKCEVerifier,
|
|
126
125
|
generateCodeChallenge: () => generateCodeChallenge,
|
|
127
126
|
generateCodeVerifier: () => generateCodeVerifier,
|
|
128
127
|
generatePKCE: () => generatePKCE,
|
|
129
|
-
retrievePKCEVerifier: () => retrievePKCEVerifier,
|
|
130
128
|
storePKCEVerifier: () => storePKCEVerifier,
|
|
131
129
|
verifyPKCE: () => verifyPKCE
|
|
132
130
|
});
|
|
@@ -231,46 +229,11 @@ function storePKCEVerifier(verifier, appId, nonce) {
|
|
|
231
229
|
createdAt: Date.now()
|
|
232
230
|
});
|
|
233
231
|
}
|
|
234
|
-
function retrievePKCEVerifier(appId, nonce) {
|
|
235
|
-
if (typeof window === "undefined") return null;
|
|
236
|
-
const key = buildKey(appId, nonce);
|
|
237
|
-
const entry = getEntry(key);
|
|
238
|
-
if (!entry) {
|
|
239
|
-
return null;
|
|
240
|
-
}
|
|
241
|
-
deleteEntry(key);
|
|
242
|
-
if (Date.now() - entry.createdAt > PKCE_TTL_MS) {
|
|
243
|
-
return null;
|
|
244
|
-
}
|
|
245
|
-
return entry.verifier;
|
|
246
|
-
}
|
|
247
232
|
function clearPKCEVerifier(appId, nonce) {
|
|
248
233
|
if (typeof window === "undefined") return;
|
|
249
234
|
const key = buildKey(appId, nonce);
|
|
250
235
|
deleteEntry(key);
|
|
251
236
|
}
|
|
252
|
-
function clearAllPKCEVerifiers(appId) {
|
|
253
|
-
if (typeof window === "undefined") return;
|
|
254
|
-
const prefix = PKCE_STORAGE_PREFIX + appId;
|
|
255
|
-
if (isSessionStorageAvailable()) {
|
|
256
|
-
const keysToRemove = [];
|
|
257
|
-
for (let i2 = 0; i2 < sessionStorage.length; i2++) {
|
|
258
|
-
const key = sessionStorage.key(i2);
|
|
259
|
-
if (key?.startsWith(prefix)) {
|
|
260
|
-
keysToRemove.push(key);
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
for (const key of keysToRemove) {
|
|
264
|
-
sessionStorage.removeItem(key);
|
|
265
|
-
}
|
|
266
|
-
} else {
|
|
267
|
-
for (const key of pkceMemoryFallback.keys()) {
|
|
268
|
-
if (key.startsWith(prefix)) {
|
|
269
|
-
pkceMemoryFallback.delete(key);
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
237
|
function timingSafeEqual(a2, b2) {
|
|
275
238
|
if (a2.length !== b2.length) {
|
|
276
239
|
let _result = 1;
|