@settlemint/dalp-sdk 3.1.19-main.35674213996 → 3.1.19-main.35680085175

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 (47) hide show
  1. package/dist/auth/client.d.ts +0 -17
  2. package/dist/auth/live.d.ts +0 -22
  3. package/dist/auth/permissions.d.ts +0 -7
  4. package/dist/auth/wallet-plugins.d.ts +0 -2
  5. package/dist/auth.d.ts +1 -18
  6. package/dist/auth.js +1 -1
  7. package/dist/bundler.d.ts +0 -9
  8. package/dist/{chunk-k8n65b9r.js → chunk-x911g40a.js} +1 -1
  9. package/dist/client/conditional-request.d.ts +0 -22
  10. package/dist/client/factory.d.ts +0 -10
  11. package/dist/client/query-serializer.d.ts +0 -1
  12. package/dist/client/request-compression.d.ts +0 -35
  13. package/dist/client/ssr-fetch.d.ts +0 -2
  14. package/dist/effect.d.ts +0 -44
  15. package/dist/errors/api-error.d.ts +0 -1
  16. package/dist/errors/find-current-error.d.ts +0 -6
  17. package/dist/errors/sdk-error.d.ts +0 -4
  18. package/dist/index.d.ts +0 -14
  19. package/dist/index.js +1 -1
  20. package/dist/proxy/builder.d.ts +0 -30
  21. package/dist/proxy/client-core.d.ts +0 -23
  22. package/dist/proxy/client.d.ts +0 -14
  23. package/dist/proxy/fetch-executor.d.ts +0 -25
  24. package/dist/proxy/flat-args.d.ts +0 -39
  25. package/dist/proxy/sse.d.ts +0 -68
  26. package/dist/proxy/tanstack.d.ts +0 -21
  27. package/dist/proxy/transport.d.ts +0 -27
  28. package/dist/react-query.d.ts +0 -14
  29. package/dist/readonly-deep.d.ts +0 -9
  30. package/dist/reads-as-funding-paused.d.ts +0 -26
  31. package/dist/reads-as-indexer-rebuild.d.ts +0 -21
  32. package/dist/routes/console.d.ts +0 -13
  33. package/dist/routes/index.d.ts +0 -16
  34. package/dist/routes/types.d.ts +0 -31
  35. package/dist/runtime-exports.d.ts +0 -16
  36. package/dist/scalars/big-decimal.d.ts +0 -12
  37. package/dist/scalars/ethereum-address.d.ts +0 -15
  38. package/dist/scalars/exchange-rates.d.ts +0 -14
  39. package/dist/scalars/index.d.ts +0 -10
  40. package/dist/scalars/organization-id.d.ts +0 -15
  41. package/dist/secret.d.ts +0 -2
  42. package/dist/sign-webhook-receipt.d.ts +0 -60
  43. package/dist/transport/sse-lifecycle.d.ts +0 -20
  44. package/dist/types.d.ts +0 -42
  45. package/dist/version.d.ts +0 -2
  46. package/dist/wait-for-transaction.d.ts +0 -35
  47. package/package.json +1 -1
@@ -4,15 +4,6 @@ import { Secret } from "../secret.ts";
4
4
  import type { CookieStoreShape } from "../transport/cookie-store.ts";
5
5
  export interface DalpAuthClientConfig {
6
6
  readonly url: string;
7
- /**
8
- * API key sent as `x-api-key`. The `/api/auth` routes admit a key on 8 read
9
- * routes only: `GET /get-session`, `GET /organization/list`,
10
- * `GET /organization/get-full-organization`, `GET /organization/list-members`,
11
- * `POST /organization/has-permission`, `GET /api-key/list`, `GET /api-key/get`,
12
- * and `GET /passkey/list-user-passkeys`. Every other auth route answers a key
13
- * with HTTP 403 and code `API_KEY_NOT_SUPPORTED_ON_ROUTE`; use a session
14
- * cookie for those.
15
- */
16
7
  readonly apiKey?: string;
17
8
  readonly cookie?: string;
18
9
  readonly cookieStore?: CookieStoreShape;
@@ -58,7 +49,6 @@ export interface DalpOrganizationMembersQuery {
58
49
  readonly organizationId?: string;
59
50
  readonly organizationSlug?: string;
60
51
  }
61
- /** Invitation row from Better Auth `listInvitations` / `listUserInvitations`. */
62
52
  export interface DalpOrganizationInvitation {
63
53
  readonly id: string;
64
54
  readonly organizationId: string;
@@ -70,13 +60,6 @@ export interface DalpOrganizationInvitation {
70
60
  export interface DalpOrganizationInvitationsQuery {
71
61
  readonly organizationId?: string;
72
62
  }
73
- /**
74
- * Stable Better Auth operation types composed into `DalpAuthClient`.
75
- *
76
- * This is not a separate runtime client — `createDalpAuthClient` returns
77
- * `DalpAuthClient`, which also includes wallet plugins. Keep this interface as
78
- * the typed non-wallet surface so inference stays explicit; do not construct it.
79
- */
80
63
  export interface DalpCliAuthClient {
81
64
  readonly getSession: DalpNoInputAuthOperation<GetSessionResponse>;
82
65
  readonly listSessions: DalpNoInputAuthOperation<ListUserSessionsResponse>;
@@ -4,7 +4,6 @@ import { type AuthClient, type BetterAuthClientOptions } from "better-auth/clien
4
4
  import { adminClient, customSessionClient, deviceAuthorizationClient, inferAdditionalFields, organizationClient, twoFactorClient } from "better-auth/client/plugins";
5
5
  import { type DalpAuthClientConfig, type DalpCliAuthClient } from "./client.ts";
6
6
  import { type DalpWalletAuthClient, walletPincodeClient, walletSecretCodesClient, walletTwoFactorClient } from "./wallet-plugins.ts";
7
- /** The platform permission catalog and role set the admin plugin checks against. */
8
7
  declare const adminPluginOptions: {
9
8
  ac: import("better-auth/client").AccessControl;
10
9
  roles: {
@@ -13,7 +12,6 @@ declare const adminPluginOptions: {
13
12
  member: import("better-auth/client").Role;
14
13
  };
15
14
  };
16
- /** The same catalog, narrowed to the two roles an organization has. */
17
15
  declare const organizationPluginOptions: {
18
16
  ac: import("better-auth/client").AccessControl;
19
17
  roles: {
@@ -21,18 +19,6 @@ declare const organizationPluginOptions: {
21
19
  member: import("better-auth/client").Role;
22
20
  };
23
21
  };
24
- /**
25
- * The plugin tuple a DALP client is configured with, element by element.
26
- *
27
- * Every element names the factory's own return type rather than the anonymous
28
- * type the array literal infers. That anonymous type reaches `SchemaCheck` in
29
- * `@better-auth/core/db/internal`, which this browser-safe package cannot
30
- * import, so a named form is what keeps the published declaration portable
31
- * (TS2883). The two options objects are named for the same reason:
32
- * `adminClient` and `organizationClient` fold their arguments into their own
33
- * generics, and the client's endpoint inference reads those back, so the
34
- * arguments have to be nameable too.
35
- */
36
22
  type ConfiguredBetterAuthPluginTuple = [
37
23
  ReturnType<typeof customSessionClient>,
38
24
  ReturnType<typeof inferAdditionalFields>,
@@ -50,19 +36,11 @@ type ConfiguredBetterAuthClientOptions = Omit<BetterAuthClientOptions, "plugins"
50
36
  plugins: ConfiguredBetterAuthPluginTuple;
51
37
  };
52
38
  export type InferredBetterAuthClient = AuthClient<ConfiguredBetterAuthClientOptions>;
53
- /**
54
- * Better Auth members whose routes the mount does not serve, or that are a
55
- * browser page's step rather than an integrator call. Device approve and deny
56
- * belong to the verification page, so a CLI keeps only the code and token
57
- * exchange. Account deletion stays mounted for the signed-in user's
58
- * email-gated flow, which an SDK caller never starts.
59
- */
60
39
  type UnservedAuthClientMembers = "deleteUser" | "revokeSessions" | "sendVerificationEmail";
61
40
  interface DalpDeviceAuthClient {
62
41
  readonly device: Omit<InferredBetterAuthClient["device"], "approve" | "deny">;
63
42
  readonly passkey: Omit<InferredBetterAuthClient["passkey"], "updatePasskey">;
64
43
  }
65
- /** Better Auth client with the exact DALP plugin surface and stable operation types. */
66
44
  export type DalpAuthClient = Omit<InferredBetterAuthClient, keyof DalpCliAuthClient | keyof DalpWalletAuthClient | keyof DalpDeviceAuthClient | UnservedAuthClientMembers> & DalpDeviceAuthClient & DalpCliAuthClient & DalpWalletAuthClient;
67
45
  export declare function createDalpAuthClient(input: DalpAuthClientConfig): Promise<DalpAuthClient>;
68
46
  export declare const makeDalpAuthClient: typeof createDalpAuthClient;
@@ -1,10 +1,3 @@
1
- /**
2
- * Client-side Better Auth access-control metadata for DALP auth clients.
3
- *
4
- * Related: packages/dapi/auth/src/utils/permissions.ts, kit/sdk/src/auth/live.ts
5
- *
6
- * @module
7
- */
8
1
  import { type AccessControl, type Role } from "better-auth/plugins/access";
9
2
  export declare const accessControl: AccessControl;
10
3
  export declare const adminRole: Role;
@@ -1,6 +1,5 @@
1
1
  import type { DalpAuthResult } from "./client.ts";
2
2
  export type WalletAuthOperation<TInput, TData> = (input: TInput, options?: unknown) => Promise<DalpAuthResult<TData>>;
3
- /** Typed client actions supplied by the three DALP wallet-auth plugins. */
4
3
  export interface DalpWalletAuthClient {
5
4
  readonly wallet: {
6
5
  readonly pincode: {
@@ -146,5 +145,4 @@ export declare const walletSecretCodesClient: () => {
146
145
  };
147
146
  export type StripLeadingSlash<T extends string> = T extends `/${infer Rest}` ? Rest : never;
148
147
  export type WalletPluginPathMethodKeys = keyof ReturnType<typeof walletPincodeClient>["pathMethods"] | keyof ReturnType<typeof walletTwoFactorClient>["pathMethods"] | keyof ReturnType<typeof walletSecretCodesClient>["pathMethods"];
149
- /** CLI coverage keys for DALP wallet Better Auth plugin endpoints (no leading slash). */
150
148
  export type WalletAuthEndpointPath = StripLeadingSlash<WalletPluginPathMethodKeys>;
package/dist/auth.d.ts CHANGED
@@ -1,22 +1,5 @@
1
- /**
2
- * The DALP Better Auth client, on its own subpath.
3
- *
4
- * The generated SDK already exposes every auth REST operation, so nothing here
5
- * exists to reach an endpoint. This surface exists for the parts a REST call
6
- * cannot express: the session and cookie state machine, the plugin actions that
7
- * run in the browser rather than over HTTP — `passkeyClient` drives the WebAuthn
8
- * ceremony through `navigator.credentials` — and the access-control model that
9
- * evaluates a permission locally instead of round-tripping `has-permission`.
10
- *
11
- * It is held off the package root because it costs roughly 70 KiB of Better
12
- * Auth that a consumer who only calls operations should never pay.
13
- *
14
- * @module
15
- */
16
1
  export { createDalpAuthClient, makeDalpAuthClient } from "./auth/live.ts";
17
2
  export type { DalpAuthClient } from "./auth/live.ts";
18
3
  export { decodeDalpAuthClientConfig } from "./auth/client.ts";
19
- export type { DalpAuthClientConfig,
20
- /** @deprecated Prefer `DalpAuthClient` — this is the typed operation surface, not a separate client. */
21
- DalpCliAuthClient, DalpAuthError, DalpAuthOperation, DalpAuthResult, DalpOrganizationInvitation, DalpOrganizationInvitationsQuery, DalpOrganizationMember, DalpOrganizationMembersQuery, DecodedDalpAuthClientConfig, } from "./auth/client.ts";
4
+ export type { DalpAuthClientConfig, DalpCliAuthClient, DalpAuthError, DalpAuthOperation, DalpAuthResult, DalpOrganizationInvitation, DalpOrganizationInvitationsQuery, DalpOrganizationMember, DalpOrganizationMembersQuery, DecodedDalpAuthClientConfig, } from "./auth/client.ts";
22
5
  export type { WalletAuthEndpointPath } from "./auth/wallet-plugins.ts";
package/dist/auth.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  makeCookieStore2,
11
11
  createCookieStoreFetch2,
12
12
  SDK_USER_AGENT2
13
- } from "./chunk-k8n65b9r.js";
13
+ } from "./chunk-x911g40a.js";
14
14
 
15
15
  // src/auth/live.ts
16
16
  import { apiKeyClient } from "@better-auth/api-key/client";
package/dist/bundler.d.ts CHANGED
@@ -4,15 +4,6 @@ import type { DalpFetch } from "./client/ssr-fetch.ts";
4
4
  import type { ReadonlyDeep } from "./readonly-deep.ts";
5
5
  export type DalpEstimateUserOperationGasReturnType = RpcEstimateUserOperationGasReturnType<"0.9">;
6
6
  export type DalpUserOperation = RpcUserOperation<"0.9">;
7
- /**
8
- * A user operation the bundler routes will act on.
9
- *
10
- * viem marks `sender`, `nonce` and `callData` optional on a request, because a
11
- * paymaster client fills a request in over several passes. The DAPI routes
12
- * require all three: an operation with no sender names no account, and one with
13
- * no call data asks for nothing. Re-requiring them here refuses the incomplete
14
- * operation at the call site rather than at the server.
15
- */
16
7
  export type DalpUserOperationRequest = RpcUserOperationRequest<"0.9"> & Pick<DalpUserOperation, "sender" | "nonce" | "callData">;
17
8
  export interface DalpBundlerClientConfig {
18
9
  readonly url: string;
@@ -102,7 +102,7 @@ function createCookieStoreFetch2(cookieStore, fetchImpl = globalThis.fetch) {
102
102
  // package.json
103
103
  var package_default = {
104
104
  name: "@settlemint/dalp-sdk",
105
- version: "3.1.19-main.35674213996",
105
+ version: "3.1.19-main.35680085175",
106
106
  private: false,
107
107
  description: "Fully typed SDK for the DALP tokenization platform API",
108
108
  homepage: "https://settlemint.com",
@@ -1,29 +1,7 @@
1
- /**
2
- * Conditional GET, as a fetch decorator.
3
- *
4
- * The policy is unchanged from the interceptor pair this replaces: hold the
5
- * ETag and body of a successful GET, send `If-None-Match` on the next one, and
6
- * serve the held body on a 304. Only the attachment point moved, from a
7
- * generated client's interceptor list to the fetch the transport already wraps
8
- * for compression and SSR.
9
- */
10
1
  import type { DalpFetch } from "./ssr-fetch.ts";
11
- /** Handle a caller holds so it can clear the store on sign-out or org switch. */
12
2
  export interface ConditionalRequestStore {
13
3
  readonly clear: () => void;
14
4
  }
15
- /**
16
- * Wrap `fetch` with the If-None-Match / 304 rewrite pair for conditional GET.
17
- *
18
- * Server ETags must be strong content digests computed after authorization
19
- * inside the requester's partition. The dapi response cache guarantees this:
20
- * `encodeResponseCacheEntry` sets `etag` to the SHA-256 of the serialized
21
- * body after the request-context middleware has authenticated the session.
22
- * Version-stamp ETags (generation counters, watermarks, table versions) are
23
- * forbidden for conditional-request adopters: a stamp can collide across
24
- * tenants or lag a body change and would let this store serve another
25
- * partition's bytes as a 200.
26
- */
27
5
  export declare function withConditionalRequests(base: DalpFetch): {
28
6
  fetch: DalpFetch;
29
7
  store: ConditionalRequestStore;
@@ -1,13 +1,3 @@
1
- /**
2
- * The client factory.
3
- *
4
- * The transport policy this used to assemble around the generated client now
5
- * lives in `../proxy/transport.ts`, which both interpreters share. This module
6
- * stays as the published entry point's seam so a consumer's import path did not
7
- * move with the internals.
8
- *
9
- * @module
10
- */
11
1
  export { createDalpClient, type DalpClient } from "../proxy/client.ts";
12
2
  export { createDalpContextHeaders } from "../proxy/transport.ts";
13
3
  export type { CreateDalpClientOptions, DalpClientContext, DalpSsrOptions, Transport } from "../proxy/transport.ts";
@@ -1,2 +1 @@
1
- /** Serialize generated SDK query objects with recursive OpenAPI deepObject keys. */
2
1
  export declare function serializeDalpQuery(query: unknown): string;
@@ -1,47 +1,12 @@
1
1
  import type { DalpFetch } from "./ssr-fetch.ts";
2
- /**
3
- * Request-body compression for DALP server/CLI clients.
4
- *
5
- * Bun 1.4 added a `compress` fetch option: it compresses a buffered body
6
- * before sending and sets `Content-Encoding` on the wire. This wrapper opts
7
- * eligible outgoing bodies into gzip so big JSON payloads shrink in transit;
8
- * the receiving DAPI host decodes them at its boundary
9
- * (`@wire/http/request-body-decoding`), so callers need no per-route work.
10
- *
11
- * Eligibility mirrors what the transport can actually do:
12
- *
13
- * - Only body-bearing methods (`GET`/`HEAD` never).
14
- * - Bodies already carrying `Content-Encoding`, or an explicit caller
15
- * `compress`, pass through untouched.
16
- * - With `(url, init)` the body must be one of Bun's buffered types
17
- * (string, ArrayBuffer, TypedArray/DataView, Blob) and fall inside the
18
- * size window — gzip framing dominates tiny payloads, and huge explicitly
19
- * sized bodies stay uncompressed (the DAPI decode cap mirrors this bound).
20
- * - Streams, `FormData`, and `URLSearchParams` pass through: the transport
21
- * forwards streaming bodies unchanged.
22
- * - A `Request` instance is measured through a bounded clone before compression.
23
- */
24
- /** Bodies smaller than this stay uncompressed; gzip framing dominates tiny JSON. */
25
2
  export declare const DALP_SDK_REQUEST_COMPRESSION_MIN_BODY_BYTES = 1024;
26
- /** Explicitly-sized bodies larger than this are sent uncompressed. */
27
3
  export declare const DALP_SDK_REQUEST_COMPRESSION_MAX_BODY_BYTES = 16777216;
28
- /**
29
- * Bun's `compress` fetch option. bun-types still types `RequestInit`
30
- * from lib.dom without it, so the field is declared here and set through one
31
- * narrow cast at the transport seam.
32
- */
33
4
  export type FetchRequestCompression = true | "gzip" | "deflate" | "br" | "zstd";
34
5
  export interface CompressionRequestInit extends RequestInit {
35
6
  readonly compress?: FetchRequestCompression;
36
7
  }
37
8
  export interface RequestBodyCompressionOptions {
38
- /** Test seam overriding DALP_SDK_REQUEST_COMPRESSION_MIN_BODY_BYTES. */
39
9
  readonly minBodyBytes?: number;
40
- /** Test seam overriding DALP_SDK_REQUEST_COMPRESSION_MAX_BODY_BYTES. */
41
10
  readonly maxBodyBytes?: number;
42
11
  }
43
- /**
44
- * Wrap a fetch seam so eligible request bodies travel gzip-compressed.
45
- * Ineligible calls forward the original arguments untouched.
46
- */
47
12
  export declare function withRequestBodyCompression(fetchImpl: DalpFetch, options?: RequestBodyCompressionOptions): DalpFetch;
@@ -1,4 +1,3 @@
1
- /** Minimal fetch shape — Bun's `typeof fetch` also requires `preconnect`. */
2
1
  export type DalpFetch = ((input: RequestInfo | URL, init?: RequestInit) => Promise<Response>) & {
3
2
  readonly preconnect?: typeof fetch.preconnect;
4
3
  };
@@ -8,5 +7,4 @@ export interface CreateSsrFetchOptions {
8
7
  readonly fetch: DalpFetch;
9
8
  readonly requestHeaders: HeadersInit;
10
9
  }
11
- /** Direct destinations must be approved; unapproved redirects lose all caller credentials and context. */
12
10
  export declare function createSsrFetch(options: CreateSsrFetchOptions): DalpFetch;
package/dist/effect.d.ts CHANGED
@@ -1,77 +1,33 @@
1
- /**
2
- * The Effect call surface.
3
- *
4
- * The same namespaced tree as the root entry, returning `Effect` values instead
5
- * of promises. It exists because the CLI and other code under our control want
6
- * Effect, and hiding it behind promises there would mean unwrapping and
7
- * rewrapping at every boundary.
8
- *
9
- * This is the only SDK export that exposes Effect values. The root export
10
- * remains Promise-based.
11
- *
12
- * Errors are tagged from the wire envelope rather than decoded from per-route
13
- * schemas. The envelope is identical across every route (`code`, `status`,
14
- * `message`, and a `data` carrying the stable DALP id), so one reader covers
15
- * 759 routes, and no runtime schema ships.
16
- *
17
- * @module
18
- */
19
1
  import * as Effect from "effect/Effect";
20
2
  import type { DalpApi, DalpRouteId, DalpRouteTypes } from "./generated/api-types.d.ts";
21
3
  import { type CallOptions } from "./proxy/builder.ts";
22
4
  import { type CreateDalpClientOptions } from "./proxy/transport.ts";
23
5
  import { DalpApiError } from "./errors/api-error.ts";
24
- /** The failure channel every route call carries. */
25
6
  export declare class DalpRequestError extends Error {
26
7
  readonly _tag = "DalpRequestError";
27
- /** Stable DALP error id when the platform supplied one, else the SDK code. */
28
8
  readonly id: string;
29
- /** The DALP error code, mirroring `DalpApiError.code`. */
30
9
  readonly code: string;
31
10
  readonly status: number | undefined;
32
11
  readonly retryable: boolean;
33
- /**
34
- * The server's requested delay before a retry, when it sent `Retry-After`.
35
- *
36
- * A retryable failure without this is a caller guessing at a backoff the
37
- * server already named, so it travels with `retryable` rather than staying
38
- * behind on the promise client's `DalpApiError`.
39
- */
40
12
  readonly retryAfterSeconds: number | undefined;
41
13
  readonly routeId: string;
42
- /** The wire envelope's route-specific `data`, e.g. `requiredRoles` on a role-gated 403. */
43
14
  readonly data: DalpApiError["data"];
44
15
  constructor(routeId: string, cause: unknown);
45
16
  }
46
- /** The Effect-shaped mirror of `DalpApi`. */
47
17
  export type DalpEffectApi = DalpEffectApiNode<DalpApi>;
48
- /**
49
- * A stream leaf answers with its frame sequence rather than one body, so it is
50
- * matched before the promise leaf: its call signature returns an `AsyncIterable`
51
- * and would otherwise fall through to the recursive branch, which maps a call
52
- * signature to an object with no keys and leaves the route uncallable.
53
- */
54
18
  type DalpEffectApiNode<T> = {
55
19
  readonly [K in keyof T]: T[K] extends (...args: infer Args) => AsyncIterable<infer Frame> ? (...args: Args) => Effect.Effect<AsyncIterable<Frame>, DalpRequestError> : T[K] extends (...args: infer Args) => Promise<infer A> ? (...args: Args) => Effect.Effect<A, DalpRequestError> : DalpEffectApiNode<T[K]>;
56
20
  };
57
- /** The routes that answer with `text/event-stream`, named by the route table. */
58
21
  export type DalpStreamingRouteId = {
59
22
  [Id in DalpRouteId]: DalpRouteTypes[Id]["streaming"] extends true ? Id : never;
60
23
  }[DalpRouteId];
61
24
  export interface DalpEffectClient {
62
25
  readonly api: DalpEffectApi;
63
- /**
64
- * Two signatures rather than one conditional return type. A caller generic over
65
- * the streaming routes has to resolve the frame sequence from its own
66
- * constraint, and a conditional keyed on `Id` stays unresolved until `Id` is a
67
- * single route, which is what pushed every such caller into an assertion.
68
- */
69
26
  readonly execute: {
70
27
  <Id extends DalpStreamingRouteId>(routeId: Id, input?: DalpRouteTypes[Id]["request"], options?: CallOptions): Effect.Effect<AsyncIterable<DalpRouteTypes[Id]["response"]>, DalpRequestError>;
71
28
  <Id extends DalpRouteId>(routeId: Id, input?: DalpRouteTypes[Id]["request"], options?: CallOptions): Effect.Effect<DalpRouteTypes[Id]["response"], DalpRequestError>;
72
29
  };
73
30
  }
74
- /** Create the Effect client. Same routes, same transport, different channel. */
75
31
  export declare function createDalpEffectClient(options: CreateDalpClientOptions): DalpEffectClient;
76
32
  export type { CallOptions } from "./proxy/builder.ts";
77
33
  export type { CreateDalpClientOptions } from "./proxy/transport.ts";
@@ -23,7 +23,6 @@ export declare class DalpApiError extends Error {
23
23
  readonly why: string;
24
24
  readonly fix: string;
25
25
  readonly retryAfterSeconds?: number;
26
- /** The wire envelope's route-specific `data`, e.g. `requiredRoles` on a role-gated 403. */
27
26
  readonly data?: DalpSdkErrorDetails;
28
27
  constructor(options: DalpApiErrorOptions);
29
28
  static make(options: DalpApiErrorOptions): DalpApiError;
@@ -1,8 +1,2 @@
1
1
  import { DalpSdkError } from "./sdk-error.ts";
2
- /**
3
- * Walk a nested SDK error graph and return the first DalpSdkError.
4
- *
5
- * Follows `cause` and `reasons[].error` / `reasons[].defect`. Stops after
6
- * `maxNodes` so a cyclic wrapper cannot loop forever.
7
- */
8
2
  export declare const findCurrentError: (error: unknown, maxNodes?: number) => DalpSdkError | undefined;
@@ -10,9 +10,7 @@ export interface DalpSdkErrorOptions {
10
10
  readonly retryAfterSeconds?: number;
11
11
  readonly cause?: unknown;
12
12
  }
13
- /** JSON-compatible value attached to a serialized SDK error. */
14
13
  export type DalpSdkJsonValue = null | boolean | number | string | ReadonlyArray<DalpSdkJsonValue> | DalpSdkJsonObject;
15
- /** JSON object attached to a serialized SDK error. */
16
14
  export interface DalpSdkJsonObject {
17
15
  readonly [key: string]: DalpSdkJsonValue;
18
16
  }
@@ -35,7 +33,6 @@ export interface DalpSdkErrorJson {
35
33
  readonly details?: DalpSdkErrorDetails;
36
34
  readonly retryAfterSeconds?: number;
37
35
  }
38
- /** SDK-owned configuration or auxiliary-adapter failure. API calls expose route errors directly. */
39
36
  export declare class DalpSdkError extends Error {
40
37
  readonly code: string;
41
38
  readonly category: string;
@@ -48,5 +45,4 @@ export declare class DalpSdkError extends Error {
48
45
  constructor(options: Readonly<DalpSdkErrorOptions>);
49
46
  toJSON(): DalpSdkErrorJson;
50
47
  }
51
- /** Build the one SDK-owned error used for invalid client construction. */
52
48
  export declare function createDalpSdkConfigurationError(input: Readonly<DalpSdkConfigurationErrorInput>): DalpSdkError;
package/dist/index.d.ts CHANGED
@@ -1,17 +1,3 @@
1
- /**
2
- * Effect-free DALP SDK public entry.
3
- *
4
- * This entry carries only what every consumer needs: the client factory, its
5
- * config and errors, and the transport policy around it. Everything that costs
6
- * real weight sits on its own subpath, so the cost is something a consumer opts
7
- * into rather than something the root hands them — `./bundler` (viem, ~385 KiB),
8
- * `./auth` (the Better Auth client family, ~69 KiB), `./verify-webhook` and
9
- * `./sign-webhook-receipt` (`standardwebhooks`; the latter is Node-only), and
10
- * `./wait-for-transaction`, which calls a generated operation and therefore
11
- * inherits the generated validator module's full weight.
12
- *
13
- * @module
14
- */
15
1
  export { createDalpClient, createDalpContextHeaders } from "./client/factory.ts";
16
2
  export type { DalpClient } from "./client/factory.ts";
17
3
  export type { CompressionRequestInit } from "./client/request-compression.ts";
package/dist/index.js CHANGED
@@ -25,7 +25,7 @@ import {
25
25
  createCookieStoreFetch2,
26
26
  SDK_VERSION2,
27
27
  SDK_USER_AGENT2
28
- } from "./chunk-k8n65b9r.js";
28
+ } from "./chunk-x911g40a.js";
29
29
  import {
30
30
  readsAsIndexerRebuild2
31
31
  } from "./chunk-5qkmb0bq.js";
@@ -1,47 +1,17 @@
1
- /**
2
- * Build the namespaced call surface from the route table.
3
- *
4
- * The tree is not emitted as 759 functions. It is a `Proxy` that resolves a
5
- * node on first access and caches it, so the runtime cost is one closure per
6
- * route a caller actually touches, and the module stays a few hundred lines
7
- * regardless of how many routes the platform grows.
8
- *
9
- * This module is executor-agnostic on purpose: it imports neither `fetch` nor
10
- * `effect`. The promise entry and the Effect entry pass their own executor and
11
- * get the same tree, which is what keeps route behavior from diverging between
12
- * the two surfaces.
13
- *
14
- * @module
15
- */
16
1
  import type { RouteRow, RouteTable } from "../routes/types.ts";
17
- /** Per-call overrides a caller may pass alongside the request. */
18
2
  export interface CallOptions {
19
3
  readonly signal?: AbortSignal;
20
- /** How long the platform holds this write before it answers 202. Ignored on an immediate route. */
21
4
  readonly settlementTimeoutMs?: number;
22
- /**
23
- * Extra headers for this call. A function is evaluated per request, which is
24
- * what a retryable write needs: `Idempotency-Key` must be fresh per attempt,
25
- * and a TanStack mutation binds its options once but fires many times.
26
- */
27
5
  readonly headers?: Readonly<Record<string, string>> | (() => Readonly<Record<string, string>>);
28
6
  }
29
- /** What an interpreter supplies: how to turn a resolved route call into a result. */
30
7
  export type Executor = (route: RouteRow, id: string, input: unknown, options: CallOptions | undefined) => unknown;
31
- /**
32
- * Members attached to every leaf beside the call itself. A route segment may
33
- * never take one of these names; the emitter refuses such a declaration.
34
- */
35
8
  export interface LeafExtras {
36
9
  readonly queryOptions: (input?: unknown, options?: CallOptions) => unknown;
37
10
  readonly mutationOptions: (options?: CallOptions) => unknown;
38
11
  }
39
- /** How an interpreter builds the TanStack factories for one route. */
40
12
  export interface LeafFactories {
41
13
  readonly queryOptions: (route: RouteRow, id: string, input: unknown, options: CallOptions | undefined) => unknown;
42
14
  readonly mutationOptions: (route: RouteRow, id: string, options: CallOptions | undefined) => unknown;
43
15
  }
44
- /** Build the call surface for one executor. */
45
16
  export declare function buildProxy(table: RouteTable, executor: Executor, factories: LeafFactories): unknown;
46
- /** Look one route up by id, for a caller that builds its own command surface. */
47
17
  export declare function findRoute(table: RouteTable, id: string): RouteRow | undefined;
@@ -1,39 +1,16 @@
1
- /**
2
- * The table-agnostic client builder.
3
- *
4
- * Each entry pairs it with exactly one generated route table, so a consumer
5
- * loads and parses only the table it calls: the root entry loads the published
6
- * table, `./routes/console` loads the Console table.
7
- *
8
- * @module
9
- */
10
1
  import type { DalpApi, DalpRouteTypes } from "../generated/api-types.d.ts";
11
2
  import type { RouteTable } from "../routes/types.ts";
12
3
  import { type CallOptions } from "./builder.ts";
13
4
  import { type CreateDalpClientOptions } from "./transport.ts";
14
- /** Request and response types for one route, as a route-type registry carries them. */
15
5
  export interface DalpRouteTypeEntry {
16
6
  readonly request: unknown;
17
7
  readonly response: unknown;
18
8
  }
19
- /** Execute a route by its id, for a caller that builds its own command surface. */
20
9
  export interface DalpClient<Api = DalpApi, RouteTypes extends Record<keyof RouteTypes, DalpRouteTypeEntry> = DalpRouteTypes> {
21
10
  readonly api: Api;
22
- /** Held conditional-GET bodies. Clear on sign-out and organization switch. */
23
11
  readonly conditionalRequests: {
24
12
  readonly clear: () => void;
25
13
  };
26
- /**
27
- * Dispatch by route id. Resolves the decoded body, or, for a
28
- * `text/event-stream` route, the frame sequence the proxy leaf also returns.
29
- *
30
- * Typed against the id, so a command surface built from route ids keeps the
31
- * request and response types the namespaced tree gives a call site.
32
- */
33
14
  readonly execute: <Id extends keyof RouteTypes>(routeId: Id, input?: RouteTypes[Id]["request"], options?: CallOptions) => Promise<RouteTypes[Id]["response"]>;
34
15
  }
35
- /**
36
- * Build a client over one route table. The caller names the types that
37
- * describe that table; the generated table and its types are emitted together.
38
- */
39
16
  export declare function buildDalpClient<Api, RouteTypes extends Record<keyof RouteTypes, DalpRouteTypeEntry>>(options: CreateDalpClientOptions, table: RouteTable): DalpClient<Api, RouteTypes>;
@@ -1,18 +1,4 @@
1
- /**
2
- * The promise call surface.
3
- *
4
- * @module
5
- */
6
1
  import { type DalpClient } from "./client-core.ts";
7
2
  import type { CreateDalpClientOptions } from "./transport.ts";
8
3
  export type { DalpClient, DalpRouteTypeEntry } from "./client-core.ts";
9
- /**
10
- * Create the namespaced client over the published route table.
11
- *
12
- * `api` is the proxy tree. `execute` is the same dispatch reached by route id,
13
- * which is what `kit/cli` uses: its command tree is kubectl-shaped, derived
14
- * from URL segments, so it never wants the JavaScript namespace tree. The
15
- * Console builds its client with `createDalpConsoleClient` from
16
- * `@settlemint/dalp-sdk/routes/console` instead.
17
- */
18
4
  export declare function createDalpClient(options: CreateDalpClientOptions): DalpClient;
@@ -1,30 +1,5 @@
1
- /**
2
- * The promise interpreter's executor.
3
- *
4
- * Sends the prepared request and resolves the decoded body. A 202 handle is
5
- * the declared response, so it is handed back rather than followed: its status
6
- * URL reports lifecycle state, not the route-specific 200 resource, and a
7
- * caller that swaps one for the other has lost the durable identifier its
8
- * write is addressed by. How long the platform holds the response before it
9
- * answers 202 is the caller's to set, through `settlementTimeoutMs`.
10
- *
11
- * No response validation. The emitted declarations describe the response and
12
- * the platform validated it on the way out, so re-checking it here would ship
13
- * a second copy of every schema to every consumer for no added guarantee.
14
- *
15
- * @module
16
- */
17
1
  import type { CallOptions, Executor } from "./builder.ts";
18
2
  import { type Transport } from "./transport.ts";
19
3
  import type { RouteRow } from "../routes/types.ts";
20
- /** Send one prepared request. */
21
4
  export declare function sendRequest(transport: Transport, route: RouteRow, input: unknown, options: CallOptions | undefined): Promise<unknown>;
22
- /**
23
- * Build the executor the proxy calls for every leaf.
24
- *
25
- * An SSE route returns its async iterable directly rather than a promise of
26
- * one, so `for await (const frame of dalp.transaction.statusStream(input))`
27
- * reads without an intervening await. Awaiting it first is also valid, because
28
- * awaiting a non-promise is a no-op.
29
- */
30
5
  export declare function createFetchExecutor(transport: Transport): Executor;
@@ -1,52 +1,13 @@
1
- /**
2
- * Split one flat argument object into the parts an HTTP request needs.
3
- *
4
- * The call site names what it means and nothing else:
5
- *
6
- * dalp.api.token.transfer({ tokenAddress, transfers })
7
- *
8
- * rather than restating the transport at every site as
9
- * `{ client, path: { tokenAddress }, body: { to, amount } }`. The route table
10
- * carries the path template's parameter names, so the split is a lookup, and
11
- * the build refuses any route whose path parameter would collide with a body or
12
- * query key, which is what makes merging them safe.
13
- *
14
- * @module
15
- */
16
1
  import type { RouteRow } from "../routes/types.ts";
17
- /**
18
- * One flat call argument, before the route table says which key goes where.
19
- * Named rather than `Record<string, unknown>` so the unstructured boundary is
20
- * explicit: this is caller input, not a decoded domain shape.
21
- */
22
- /** A JSON value a caller may pass in a flat call argument. */
23
2
  export type FlatCallValue = null | boolean | number | string | ReadonlyArray<FlatCallValue> | FlatCallObject;
24
- /** A nested object inside a flat call argument. */
25
3
  export interface FlatCallObject {
26
4
  readonly [key: string]: FlatCallValue;
27
5
  }
28
- /**
29
- * One flat call argument, before the route table says which key goes where.
30
- * Named rather than left as a bare record so the unstructured boundary is
31
- * explicit: this is caller input, not a decoded domain shape.
32
- */
33
6
  export type FlatCallInput = FlatCallObject;
34
- /** The request parts, ready for a URL and a body. */
35
7
  export interface SplitArgs {
36
8
  readonly path: FlatCallInput;
37
9
  readonly query: FlatCallInput;
38
10
  readonly body: FlatCallInput | undefined;
39
11
  }
40
- /**
41
- * Divide `input` into path, query and body according to `route`.
42
- *
43
- * A key named in the path template goes to the path. When the declaration
44
- * carries a payload, a key the route declares as a query parameter goes to the
45
- * query string and the remaining keys form the JSON body; without a payload
46
- * every remaining key is a query parameter. The method is not the signal: a
47
- * DELETE that declares a payload reads it from the body exactly as a POST does,
48
- * and a GET never declares one.
49
- */
50
12
  export declare function splitFlatArgs(route: RouteRow, input: unknown): SplitArgs;
51
- /** Substitute path parameters into the route's template. */
52
13
  export declare function buildPath(route: RouteRow, path: FlatCallInput): string;