@capxul/sdk 4.20.0-beta.4 → 4.20.0-beta.40

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.
@@ -1,14 +1,24 @@
1
- import { h as CapxulResult } from "../OAuthBearerAuthClient-C-ip-z8M.mjs";
2
- import { er as TelemetryEvent, f as CapxulClient, i as ObservationAdapter, n as ProductionSignerControls, nr as TelemetryIdentifyInput, pr as IdentityTransition, t as CapxulClientInput, tr as TelemetryGroupInput } from "../production-CJwxgI8u.mjs";
1
+ import { Aa as CapxulSigner, Bo as TelemetryIdentifyInput, Ho as TelemetryPortEvent, J as CapxulClient, Vo as TelemetryEvent, Zo as ObservationAdapter, f as CapxulClientInput, ht as IdentityTransition, j as OpenfortBrowserSignerOptions, os as CapxulResult, po as OrganizationSetup, zo as TelemetryGroupInput } from "../index-DTc8HIBm.mjs";
3
2
  import { Effect, Layer } from "effect";
3
+ //#region src/platform/production-client.d.ts
4
+ /** Per-client signing controls; only the testing entry exposes these to consumers. */
5
+ interface ProductionSignerControls {
6
+ /** Final signing call. Address, readiness and session lifecycle retain their real owner. */
7
+ readonly signUserOpHash?: (hash: Parameters<CapxulSigner["signUserOpHash"]>[0], signer: CapxulSigner & {
8
+ readonly resetSession?: () => void;
9
+ }) => ReturnType<CapxulSigner["signUserOpHash"]>;
10
+ /** Embedded signing calls, including the existing recovery owner's single retry. */
11
+ readonly signEmbeddedUserOpHash?: OpenfortBrowserSignerOptions["signUserOpHash"];
12
+ }
13
+ //#endregion
4
14
  //#region src/testing/production-client.d.ts
5
15
  /** Create the one production client with per-client controls at its signing boundaries. */
6
- declare function createCapxulProductionTestClient(input: CapxulClientInput, controls: ProductionSignerControls): Promise<CapxulResult<CapxulClient>>;
16
+ export declare function createCapxulProductionTestClient(input: CapxulClientInput, controls: ProductionSignerControls): Promise<CapxulResult<CapxulClient>>;
7
17
  //#endregion
8
18
  //#region src/testing/signer-faults.d.ts
9
19
  /**
10
20
  * Which provider refusal to inject. The codes are the ones the SDK's own
11
- * classifiers decode (`src/signer.ts`), so a fault reaches the public error
21
+ * classifiers decode (`src/signing/signer.ts`), so a fault reaches the public error
12
22
  * contract through the real decode path rather than a shortcut.
13
23
  *
14
24
  * - `missing-signer` — Openfort's typed not-ready code. `openfortSignerNotReadyCode`
@@ -20,14 +30,14 @@ declare function createCapxulProductionTestClient(input: CapxulClientInput, cont
20
30
  */
21
31
  type SignerFaultKind = "missing-signer" | "user-rejected" | "unexpected";
22
32
  /** The value a controlled fault throws. Named so a test can assert its origin. */
23
- declare class ControlledSignerFault extends Error {
33
+ export declare class ControlledSignerFault extends Error {
24
34
  readonly kind: SignerFaultKind;
25
35
  /** Provider code the SDK classifiers read; absent for `unexpected`. */
26
36
  readonly code: string | number | undefined;
27
37
  constructor(kind: SignerFaultKind);
28
38
  }
29
39
  /** Build one fault value without the harness, for a caller that writes its own control. */
30
- declare function signerFaultCause(kind: SignerFaultKind): ControlledSignerFault;
40
+ export declare function signerFaultCause(kind: SignerFaultKind): ControlledSignerFault;
31
41
  interface SignerFaultPlan {
32
42
  /**
33
43
  * Fault the next embedded signature ONCE, beneath the production recovery
@@ -78,12 +88,16 @@ interface ArmedSignerSeam {
78
88
  *
79
89
  * An empty plan installs no controls, which composes the ordinary client.
80
90
  */
81
- declare function armSignerFaults(plan?: SignerFaultPlan): ArmedSignerSeam;
91
+ export declare function armSignerFaults(plan?: SignerFaultPlan): ArmedSignerSeam;
92
+ //#endregion
93
+ //#region src/testing/organization-setup.d.ts
94
+ /** Exact backend setup shape for SDK tests. */
95
+ export declare function organizationSetupFixture(orgId: string, status?: OrganizationSetup["status"], overrides?: Partial<OrganizationSetup>): OrganizationSetup;
82
96
  //#endregion
83
97
  //#region src/testing/telemetry/RecordingTelemetryAdapter.d.ts
84
98
  type RecordingTelemetryOperation = {
85
99
  readonly type: "emit";
86
- readonly event: TelemetryEvent;
100
+ readonly event: TelemetryPortEvent;
87
101
  } | {
88
102
  readonly type: "identify";
89
103
  readonly input: TelemetryIdentifyInput;
@@ -95,18 +109,18 @@ type RecordingTelemetryOperation = {
95
109
  };
96
110
  //#endregion
97
111
  //#region src/testing/index.d.ts
98
- interface CreateCapxulTestClientOptions {
112
+ export interface CreateCapxulTestClientOptions {
99
113
  readonly requirement?: "none" | "counterfactual" | "deployed";
100
114
  /** Optional Core SDK failure adapter for packed consumer proofs. */
101
115
  readonly failureObservation?: ObservationAdapter;
102
116
  }
103
- interface SeedTestIdentityInput {
117
+ export interface SeedTestIdentityInput {
104
118
  readonly authUserId: string;
105
119
  readonly email: string;
106
120
  readonly displayName?: string;
107
121
  readonly country?: string;
108
122
  }
109
- interface CapxulTestClient {
123
+ export interface CapxulTestClient {
110
124
  readonly client: CapxulClient;
111
125
  readonly clock: CapxulTestClock;
112
126
  readonly observation: CapxulTestObservation;
@@ -114,12 +128,15 @@ interface CapxulTestClient {
114
128
  readonly observations: readonly RecordingTelemetryOperation[];
115
129
  readonly peekOtp: (email: string) => string | undefined;
116
130
  readonly seedIdentity: (input: SeedTestIdentityInput) => Promise<void>;
131
+ readonly organizationSetup: {
132
+ readonly set: (setup: OrganizationSetup) => void;
133
+ };
117
134
  readonly close: () => Promise<void>;
118
135
  }
119
- interface CapxulTestClock {
136
+ export interface CapxulTestClock {
120
137
  readonly advance: (ms: number) => Promise<void>;
121
138
  }
122
- interface CapxulTestObservation {
139
+ export interface CapxulTestObservation {
123
140
  readonly emit: (event: TelemetryEvent) => Promise<void>;
124
141
  readonly identify: (input: TelemetryIdentifyInput) => Promise<void>;
125
142
  readonly group: (input: TelemetryGroupInput) => Promise<void>;
@@ -129,6 +146,6 @@ interface CapxulTestObservation {
129
146
  * Assemble the real public client over deterministic in-memory ports.
130
147
  * Unconfigured backend calls fail locally; no adapter owns a network exit.
131
148
  */
132
- declare function createCapxulTestClient(options?: CreateCapxulTestClientOptions): CapxulTestClient;
149
+ export declare function createCapxulTestClient(options?: CreateCapxulTestClientOptions): CapxulTestClient;
133
150
  //#endregion
134
- export { type ArmedSignerSeam, CapxulTestClient, CapxulTestClock, CapxulTestObservation, ControlledSignerFault, CreateCapxulTestClientOptions, type ProductionSignerControls, SeedTestIdentityInput, type SignerFaultKind, type SignerFaultPlan, type SignerSeamRecord, armSignerFaults, createCapxulProductionTestClient, createCapxulTestClient, signerFaultCause };
151
+ export type { ArmedSignerSeam, ProductionSignerControls, SignerFaultKind, SignerFaultPlan, SignerSeamRecord };