@settlemint/dalp-sdk 3.1.11-main.33693224830 → 3.1.11-main.33695493387

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/dist/auth.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  SDK_USER_AGENT,
3
3
  createCookieStoreFetch,
4
4
  makeCookieStore
5
- } from "./chunk-g91238gw.js";
5
+ } from "./chunk-g3mjm0z7.js";
6
6
  import {
7
7
  normalizeDalpBaseUrl,
8
8
  secret,
@@ -102,7 +102,7 @@ function createCookieStoreFetch(cookieStore, fetchImpl = globalThis.fetch) {
102
102
  // package.json
103
103
  var package_default = {
104
104
  name: "@settlemint/dalp-sdk",
105
- version: "3.1.11-main.33693224830",
105
+ version: "3.1.11-main.33695493387",
106
106
  private: false,
107
107
  description: "Fully typed SDK for the DALP tokenization platform API",
108
108
  homepage: "https://settlemint.com",
package/dist/effect.d.ts CHANGED
@@ -35,15 +35,32 @@ export declare class DalpRequestError extends Error {
35
35
  constructor(routeId: string, cause: unknown);
36
36
  }
37
37
  /** The Effect-shaped mirror of `DalpApi`. */
38
- export type DalpEffectApi = {
39
- readonly [K in keyof DalpApi]: DalpApi[K] extends (request: infer Request, options?: infer Options) => Promise<infer A> ? (request: Request, options?: Options) => Effect.Effect<A, DalpRequestError> : DalpEffectApiNode<DalpApi[K]>;
40
- };
38
+ export type DalpEffectApi = DalpEffectApiNode<DalpApi>;
39
+ /**
40
+ * A stream leaf answers with its frame sequence rather than one body, so it is
41
+ * matched before the promise leaf: its call signature returns an `AsyncIterable`
42
+ * and would otherwise fall through to the recursive branch, which maps a call
43
+ * signature to an object with no keys and leaves the route uncallable.
44
+ */
41
45
  type DalpEffectApiNode<T> = {
42
- readonly [K in keyof T]: T[K] extends (request: infer Request, options?: infer Options) => Promise<infer A> ? (request: Request, options?: Options) => Effect.Effect<A, DalpRequestError> : DalpEffectApiNode<T[K]>;
46
+ 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]>;
43
47
  };
48
+ /** The routes that answer with `text/event-stream`, named by the route table. */
49
+ export type DalpStreamingRouteId = {
50
+ [Id in DalpRouteId]: DalpRouteTypes[Id]["streaming"] extends true ? Id : never;
51
+ }[DalpRouteId];
44
52
  export interface DalpEffectClient {
45
53
  readonly api: DalpEffectApi;
46
- readonly execute: <Id extends DalpRouteId>(routeId: Id, input?: DalpRouteTypes[Id]["request"], options?: CallOptions) => Effect.Effect<DalpRouteTypes[Id]["response"], DalpRequestError>;
54
+ /**
55
+ * Two signatures rather than one conditional return type. A caller generic over
56
+ * the streaming routes has to resolve the frame sequence from its own
57
+ * constraint, and a conditional keyed on `Id` stays unresolved until `Id` is a
58
+ * single route, which is what pushed every such caller into an assertion.
59
+ */
60
+ readonly execute: {
61
+ <Id extends DalpStreamingRouteId>(routeId: Id, input?: DalpRouteTypes[Id]["request"], options?: CallOptions): Effect.Effect<AsyncIterable<DalpRouteTypes[Id]["response"]>, DalpRequestError>;
62
+ <Id extends DalpRouteId>(routeId: Id, input?: DalpRouteTypes[Id]["request"], options?: CallOptions): Effect.Effect<DalpRouteTypes[Id]["response"], DalpRequestError>;
63
+ };
47
64
  }
48
65
  /** Create the Effect client. Same routes, same transport, different channel. */
49
66
  export declare function createDalpEffectClient(options: CreateDalpClientOptions): DalpEffectClient;
package/dist/effect.js CHANGED
@@ -6,7 +6,8 @@ import {
6
6
  DalpApiError,
7
7
  createTransport,
8
8
  queryKeyFor,
9
- sendRequest
9
+ sendRequest,
10
+ streamRequest
10
11
  } from "./chunk-mrfkqrht.js";
11
12
  import {
12
13
  data
@@ -39,7 +40,7 @@ function runRoute(transport, route, id, input, options) {
39
40
  const signal = options?.signal ?? controller.signal;
40
41
  const run = async () => {
41
42
  try {
42
- resume(Effect.succeed(await sendRequest(transport, route, input, { ...options, signal })));
43
+ resume(Effect.succeed(route.serializer === "sse" ? streamRequest(transport, route, input, { ...options, signal }) : await sendRequest(transport, route, input, { ...options, signal })));
43
44
  } catch (error) {
44
45
  resume(Effect.fail(new DalpRequestError(id, error)));
45
46
  }
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  SDK_VERSION,
4
4
  createCookieStoreFetch,
5
5
  makeCookieStore
6
- } from "./chunk-g91238gw.js";
6
+ } from "./chunk-g3mjm0z7.js";
7
7
  import {
8
8
  createDalpClient
9
9
  } from "./chunk-wk8e0p9d.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@settlemint/dalp-sdk",
3
- "version": "3.1.11-main.33693224830",
3
+ "version": "3.1.11-main.33695493387",
4
4
  "private": false,
5
5
  "description": "Fully typed SDK for the DALP tokenization platform API",
6
6
  "homepage": "https://settlemint.com",