@seams/wallet-server 0.9.2 → 0.9.4

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.
Files changed (38) hide show
  1. package/THIRD_PARTY_NOTICES.md +33 -1
  2. package/artifact-manifest.json +34 -29
  3. package/cloudflare-router-ab/build/deriver-a/build-stamp.json +1 -1
  4. package/cloudflare-router-ab/build/deriver-a/index_bg.wasm +0 -0
  5. package/cloudflare-router-ab/build/deriver-b/build-stamp.json +1 -1
  6. package/cloudflare-router-ab/build/deriver-b/index_bg.wasm +0 -0
  7. package/cloudflare-router-ab/build/local-tools/darwin-arm64/router_ab_local_init +0 -0
  8. package/cloudflare-router-ab/build/local-tools/darwin-x64/router_ab_local_init +0 -0
  9. package/cloudflare-router-ab/build/local-tools/linux-x64/router_ab_local_init +0 -0
  10. package/cloudflare-router-ab/build/router/build-stamp.json +1 -1
  11. package/cloudflare-router-ab/build/router/index.js +1 -1
  12. package/cloudflare-router-ab/build/router/index_bg.wasm +0 -0
  13. package/cloudflare-router-ab/build/signing-worker/build-stamp.json +1 -1
  14. package/cloudflare-router-ab/build/signing-worker/index.js +1 -1
  15. package/cloudflare-router-ab/build/signing-worker/index_bg.wasm +0 -0
  16. package/cloudflare-router-ab/build/tenant-root-control-plane/build-stamp.json +1 -1
  17. package/cloudflare-router-ab/build/tenant-root-control-plane/index.js +1 -1
  18. package/cloudflare-router-ab/build/tenant-root-control-plane/index_bg.wasm +0 -0
  19. package/dist/esm/router/cloudflare/d1/auth/d1RouterApiAuthService.js +1 -1
  20. package/dist/esm/router/cloudflare/d1/registration/d1RegistrationCeremonyStore.js +11 -4
  21. package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationCommitStore.js +46 -2
  22. package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationRead.js +7 -4
  23. package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationService.js +25 -9
  24. package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationSetupExecution.js +2 -1
  25. package/dist/esm/router/cloudflare.js +1 -1
  26. package/dist/esm/router/domains/walletRegistration/walletRegistrationRoutes.js +1 -1
  27. package/dist/esm/router/express.js +1 -1
  28. package/dist/esm/router/framework/registrationSetupDispatch.js +28 -2
  29. package/dist/esm/storage/d1Retry.js +38 -0
  30. package/dist/esm/wasm/shamir3pass_runtime/pkg/shamir3pass_runtime_bg.wasm +0 -0
  31. package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1RegistrationCeremonyStore.d.ts +7 -1
  32. package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletRegistrationCommitStore.d.ts +34 -2
  33. package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletRegistrationRead.d.ts +4 -1
  34. package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletRegistrationService.d.ts +1 -1
  35. package/dist/types/wallet-server/src/router/framework/authServicePort.d.ts +1 -1
  36. package/dist/types/wallet-server/src/storage/d1Retry.d.ts +10 -0
  37. package/migrations/d1-signer/0078_registration_passkey_claims.sql +20 -0
  38. package/package.json +1 -1
@@ -3,6 +3,7 @@ import type { WalletRegistrationHomeAuthority } from '../../../domains/walletReg
3
3
  import type { CloudflareD1RegistrationCeremonyIntentStore } from './d1RegistrationCeremonyStore';
4
4
  import type { D1WalletExecutionAuthority } from './d1WalletExecutionAuthority';
5
5
  import type { D1WalletOperationStore } from './d1WalletOperationStore';
6
+ import type { D1WalletRegistrationCommitStore } from './d1WalletRegistrationCommitStore';
6
7
  import type { D1WalletRegistrationNearProvisioningSideEffectRecord } from './d1WalletRegistrationService';
7
8
  import type { CloudflareD1Ed25519YaoLifecycleDecisionStoreV1 } from '../ed25519Yao/d1Ed25519YaoLifecycleDecisionStore';
8
9
  /** Read admission and immutable finalization state from one D1 snapshot. */
@@ -12,7 +13,8 @@ export declare class D1WalletRegistrationRead {
12
13
  readonly operations: D1WalletOperationStore<D1WalletRegistrationNearProvisioningSideEffectRecord>;
13
14
  private readonly getCeremonies;
14
15
  private readonly decisions;
15
- constructor(database: D1DatabaseLike, authority: D1WalletExecutionAuthority | null, operations: D1WalletOperationStore<D1WalletRegistrationNearProvisioningSideEffectRecord>, getCeremonies: () => CloudflareD1RegistrationCeremonyIntentStore, decisions: CloudflareD1Ed25519YaoLifecycleDecisionStoreV1);
16
+ private readonly passkeyClaims;
17
+ constructor(database: D1DatabaseLike, authority: D1WalletExecutionAuthority | null, operations: D1WalletOperationStore<D1WalletRegistrationNearProvisioningSideEffectRecord>, getCeremonies: () => CloudflareD1RegistrationCeremonyIntentStore, decisions: CloudflareD1Ed25519YaoLifecycleDecisionStoreV1, passkeyClaims: Pick<D1WalletRegistrationCommitStore, 'prepareHeldPasskeyClaimRead' | 'parseHeldPasskeyClaimRead'>);
16
18
  readRespond(home: Parameters<WalletRegistrationHomeAuthority['admitHome']>[0]): Promise<{
17
19
  readonly ok: false;
18
20
  readonly code: string;
@@ -37,6 +39,7 @@ export declare class D1WalletRegistrationRead {
37
39
  ok: true;
38
40
  operation: import("../../../cloudflare-adaptor").VersionedJsonRecordReadResult<D1WalletRegistrationNearProvisioningSideEffectRecord>;
39
41
  decision: import("../../../domains/ed25519Yao/capabilityLifecycle/routerAbEd25519YaoLifecycleDecision").RouterAbEd25519YaoLifecycleDecisionV1 | null;
42
+ heldPasskeyClaim: import("./d1WalletRegistrationCommitStore").HeldRegistrationPasskeyClaim | null;
40
43
  readCeremony: () => Promise<import("../../../../core/RegistrationCeremonyStore").StoredWalletRegistrationCeremony | null>;
41
44
  }>;
42
45
  }
@@ -260,7 +260,7 @@ export declare class CloudflareD1WalletRegistrationService {
260
260
  provisionEd25519YaoWalletSession(request: RouterAbEd25519YaoVerifiedWalletUnlockRequestV1): Promise<RouterAbEd25519YaoVerifiedWalletUnlockResponseV1>;
261
261
  setupWalletRegistration(input: WalletRegistrationSetupInput): Promise<WalletRegistrationSetupResponseV2>;
262
262
  authorizeWalletRegistrationNearAdmission(input: WalletRegistrationNearAdmissionInput): Promise<WalletRegistrationNearAdmissionResponseV2>;
263
- respondWalletRegistration(input: WalletRegistrationRespondInput, traceContext?: RouterAbTraceContextV1, timingSink?: Array<readonly [string, number]>): Promise<WalletRegistrationRespondResponseV2>;
263
+ respondWalletRegistration(input: WalletRegistrationRespondInput, traceContext?: RouterAbTraceContextV1, timingSink?: Array<readonly [string, number]>, waitUntil?: (promise: Promise<unknown>) => void): Promise<WalletRegistrationRespondResponseV2>;
264
264
  /** For callers that must read the context before finalize tombstones it. */
265
265
  private registrationOwnerProofWithContext;
266
266
  authorizeNearRegistrationContinuation(input: {
@@ -1031,7 +1031,7 @@ export interface RouterApiWalletRegistrationService {
1031
1031
  listWalletEcdsaKeyFactsInventory(input: RouterApiMethodTypes['listWalletEcdsaKeyFactsInventory']['input']): Promise<RouterApiMethodTypes['listWalletEcdsaKeyFactsInventory']['result']>;
1032
1032
  readActiveEmailOtpEnrollment(input: RouterApiMethodTypes['readActiveEmailOtpEnrollment']['input']): Promise<RouterApiMethodTypes['readActiveEmailOtpEnrollment']['result']>;
1033
1033
  setupWalletRegistration(input: WalletRegistrationSetupInput): Promise<RouteResponse>;
1034
- respondWalletRegistration(input: WalletRegistrationRespondInput, traceContext?: RouterAbTraceContextV1, serverTiming?: Array<readonly [string, number]>): Promise<WalletRegistrationRespondResponseV2>;
1034
+ respondWalletRegistration(input: WalletRegistrationRespondInput, traceContext?: RouterAbTraceContextV1, serverTiming?: Array<readonly [string, number]>, waitUntil?: (promise: Promise<unknown>) => void): Promise<WalletRegistrationRespondResponseV2>;
1035
1035
  authorizeWalletRegistrationNearAdmission(input: WalletRegistrationNearAdmissionInput): Promise<WalletRegistrationNearAdmissionResponseV2>;
1036
1036
  activateWalletRegistration(input: WalletRegistrationActivateInput, traceContext?: RouterAbTraceContextV1, serverTiming?: Array<readonly [string, number]>): Promise<WalletRegistrationActivateResponseV2>;
1037
1037
  completeWalletRegistrationNearProvisioning(input: WalletRegistrationNearProvisioningInput, serverTiming?: Array<readonly [string, number]>, waitUntil?: (promise: Promise<unknown>) => void): Promise<WalletRegistrationNearProvisioningResponseV2>;
@@ -0,0 +1,10 @@
1
+ export declare function isTransientD1Error(error: unknown): boolean;
2
+ /**
3
+ * Runs `operation` again after a transient D1 fault. Such a fault does not say
4
+ * whether a write committed, so `operation` must give the same result when it
5
+ * runs after its own earlier commit: reads, `INSERT OR IGNORE`, and conditional
6
+ * writes that accept their own outcome. It must build its statements on each
7
+ * run. Every other error, and the last transient one, reaches the caller.
8
+ */
9
+ export declare function retryTransientD1<T>(operation: () => Promise<T>): Promise<T>;
10
+ //# sourceMappingURL=d1Retry.d.ts.map
@@ -0,0 +1,20 @@
1
+ -- A passkey ownership claim that shared authority granted for one registration
2
+ -- ceremony before its finalization. Finalization reads the row and skips its
3
+ -- own claim request. A missing row means only that finalization claims again.
4
+ CREATE TABLE registration_passkey_claims (
5
+ namespace TEXT NOT NULL,
6
+ org_id TEXT NOT NULL,
7
+ project_id TEXT NOT NULL,
8
+ env_id TEXT NOT NULL,
9
+ registration_ceremony_id TEXT NOT NULL,
10
+ wallet_id TEXT NOT NULL,
11
+ rp_id TEXT NOT NULL,
12
+ credential_id_b64u TEXT NOT NULL,
13
+ claimed_at_ms INTEGER NOT NULL,
14
+ PRIMARY KEY (namespace, org_id, project_id, env_id, registration_ceremony_id)
15
+ );
16
+
17
+ -- Shared authority never reassigns a claim, so a recorded claim never changes.
18
+ CREATE TRIGGER registration_passkey_claims_immutable
19
+ BEFORE UPDATE ON registration_passkey_claims
20
+ BEGIN SELECT RAISE(ABORT, 'registration_passkey_claims_immutable'); END;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seams/wallet-server",
3
- "version": "0.9.2",
3
+ "version": "0.9.4",
4
4
  "type": "module",
5
5
  "description": "Seams server TypeScript SDK for NEAR and EVM-family wallets",
6
6
  "main": "./dist/esm/index.js",