@arcblock/did-connect-js 1.29.27 → 1.30.0
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/esm/authenticator/base.mjs +1 -1
- package/esm/authenticator/wallet.mjs +5 -5
- package/esm/{package.mjs → did/did-connect/package.mjs} +1 -1
- package/esm/handlers/util.mjs +1 -1
- package/esm/handlers/wallet.mjs +1 -1
- package/esm/node_modules/valibot/dist/index.mjs +736 -0
- package/esm/schema/claims.d.mts +11 -13
- package/esm/schema/claims.mjs +194 -132
- package/esm/schema/index.d.mts +24 -4
- package/esm/schema/index.mjs +68 -42
- package/lib/authenticator/base.cjs +1 -1
- package/lib/authenticator/wallet.cjs +5 -4
- package/lib/{package.cjs → did/did-connect/package.cjs} +1 -1
- package/lib/handlers/util.cjs +1 -1
- package/lib/handlers/wallet.cjs +1 -1
- package/lib/node_modules/valibot/dist/index.cjs +756 -0
- package/lib/schema/claims.cjs +193 -131
- package/lib/schema/claims.d.cts +11 -13
- package/lib/schema/index.cjs +68 -41
- package/lib/schema/index.d.cts +24 -4
- package/package.json +9 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __require } from "../_virtual/rolldown_runtime.mjs";
|
|
2
|
-
import { require_package } from "../package.mjs";
|
|
2
|
+
import { require_package } from "../did/did-connect/package.mjs";
|
|
3
3
|
import { fromJSON, isValid } from "@ocap/wallet";
|
|
4
4
|
import * as Jwt from "@arcblock/jwt";
|
|
5
5
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __require } from "../_virtual/rolldown_runtime.mjs";
|
|
2
|
-
import { require_package } from "../package.mjs";
|
|
2
|
+
import { require_package } from "../did/did-connect/package.mjs";
|
|
3
3
|
import base_default, { DEFAULT_CHAIN_INFO } from "./base.mjs";
|
|
4
|
-
import { appInfo, chainInfo, claims } from "../schema/index.mjs";
|
|
4
|
+
import { appInfo, chainInfo, claims, vValidate } from "../schema/index.mjs";
|
|
5
5
|
import qs from "node:querystring";
|
|
6
6
|
import { toAddress } from "@arcblock/did";
|
|
7
7
|
import Client from "@ocap/client";
|
|
@@ -361,7 +361,7 @@ var WalletAuthenticator = class WalletAuthenticator extends base_default {
|
|
|
361
361
|
}
|
|
362
362
|
result.mfaCode = shuffle(result.mfaCode);
|
|
363
363
|
}
|
|
364
|
-
const { value, error } = claims[name]
|
|
364
|
+
const { value, error } = vValidate(claims[name], result);
|
|
365
365
|
if (error) throw new Error(`Invalid ${name} claim: ${error.message}`);
|
|
366
366
|
return value;
|
|
367
367
|
}));
|
|
@@ -520,12 +520,12 @@ var WalletAuthenticator = class WalletAuthenticator extends base_default {
|
|
|
520
520
|
if (allowEmpty === false) throw new Error("Wallet authenticator can not work with invalid appInfo: empty");
|
|
521
521
|
return null;
|
|
522
522
|
}
|
|
523
|
-
const { value, error } = appInfo
|
|
523
|
+
const { value, error } = vValidate(appInfo, info);
|
|
524
524
|
if (error) throw new Error(`Wallet authenticator can not work with invalid appInfo: ${error.message}`);
|
|
525
525
|
return value;
|
|
526
526
|
}
|
|
527
527
|
_isValidChainInfo(x) {
|
|
528
|
-
const { error } = chainInfo
|
|
528
|
+
const { error } = vValidate(chainInfo, x);
|
|
529
529
|
return !error;
|
|
530
530
|
}
|
|
531
531
|
tryWithTimeout(asyncFn, label = "") {
|
package/esm/handlers/util.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __require } from "../_virtual/rolldown_runtime.mjs";
|
|
2
|
-
import { require_package } from "../package.mjs";
|
|
2
|
+
import { require_package } from "../did/did-connect/package.mjs";
|
|
3
3
|
import { PROTECTED_KEYS, SESSION_STATUS, decrypt, encrypt } from "../protocol.mjs";
|
|
4
4
|
import { isValid } from "@arcblock/did";
|
|
5
5
|
import { fromBase64, stripHexPrefix, toBase64 } from "@ocap/util";
|
package/esm/handlers/wallet.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __require } from "../_virtual/rolldown_runtime.mjs";
|
|
2
|
-
import { require_package } from "../package.mjs";
|
|
2
|
+
import { require_package } from "../did/did-connect/package.mjs";
|
|
3
3
|
import { isHonoApp } from "../adapters/detect.mjs";
|
|
4
4
|
import { attachExpress } from "../adapters/express.mjs";
|
|
5
5
|
import { attachHono } from "../adapters/hono.mjs";
|