@settlemint/dalp-sdk 3.1.18-main.33839196085 → 3.1.18-main.33842640001
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 +1 -1
- package/dist/bundler.js +2 -2
- package/dist/{chunk-xn0p8tv1.js → chunk-77rp65xa.js} +1 -1
- package/dist/{chunk-5qbg333z.js → chunk-dxdqzhs0.js} +1 -1
- package/dist/{chunk-mdaqtrdz.js → chunk-tcm75mnh.js} +5 -2
- package/dist/effect.d.ts +3 -0
- package/dist/effect.js +3 -1
- package/dist/errors/api-error.d.ts +4 -0
- package/dist/index.js +3 -3
- package/dist/react-query.js +1 -1
- package/package.json +1 -1
package/dist/auth.js
CHANGED
package/dist/bundler.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createDalpClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-77rp65xa.js";
|
|
4
4
|
import"./chunk-f4t1bm86.js";
|
|
5
|
-
import"./chunk-
|
|
5
|
+
import"./chunk-tcm75mnh.js";
|
|
6
6
|
import"./chunk-fjnq61hj.js";
|
|
7
7
|
import"./chunk-gryttjx0.js";
|
|
8
8
|
import"./chunk-h12fatty.js";
|
|
@@ -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.18-main.
|
|
105
|
+
version: "3.1.18-main.33842640001",
|
|
106
106
|
private: false,
|
|
107
107
|
description: "Fully typed SDK for the DALP tokenization platform API",
|
|
108
108
|
homepage: "https://settlemint.com",
|
|
@@ -55,6 +55,7 @@ class DalpApiError extends Error {
|
|
|
55
55
|
why;
|
|
56
56
|
fix;
|
|
57
57
|
retryAfterSeconds;
|
|
58
|
+
data;
|
|
58
59
|
constructor(options) {
|
|
59
60
|
super(options.message, { cause: options.cause });
|
|
60
61
|
this.name = "DalpApiError";
|
|
@@ -66,6 +67,7 @@ class DalpApiError extends Error {
|
|
|
66
67
|
this.why = options.why;
|
|
67
68
|
this.fix = options.fix;
|
|
68
69
|
this.retryAfterSeconds = options.retryAfterSeconds;
|
|
70
|
+
this.data = options.data;
|
|
69
71
|
}
|
|
70
72
|
static make(options) {
|
|
71
73
|
return new DalpApiError(options);
|
|
@@ -117,7 +119,8 @@ var makeDalpApiError = (error) => {
|
|
|
117
119
|
why: sdkError.why,
|
|
118
120
|
fix: sdkError.fix,
|
|
119
121
|
status: sdkError.status,
|
|
120
|
-
retryAfterSeconds: sdkError.retryAfterSeconds
|
|
122
|
+
retryAfterSeconds: sdkError.retryAfterSeconds,
|
|
123
|
+
data: sdkError.details
|
|
121
124
|
});
|
|
122
125
|
};
|
|
123
126
|
|
|
@@ -673,7 +676,7 @@ function sdkErrorFromEnvelope(payload, response) {
|
|
|
673
676
|
message: readString(envelope, "message") ?? `DALP API responded ${String(response.status)}`,
|
|
674
677
|
why: readString(data, "why") ?? `The platform answered ${String(response.status)}.`,
|
|
675
678
|
fix: readString(data, "fix") ?? "Inspect the response body and the request id before retrying.",
|
|
676
|
-
...
|
|
679
|
+
...Object.keys(data).length === 0 ? {} : { details: data }
|
|
677
680
|
});
|
|
678
681
|
}
|
|
679
682
|
async function readResponse(response) {
|
package/dist/effect.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ import * as Effect from "effect/Effect";
|
|
|
24
24
|
import type { DalpApi, DalpRouteId, DalpRouteTypes } from "./generated/api-types.d.ts";
|
|
25
25
|
import { type CallOptions } from "./proxy/builder.ts";
|
|
26
26
|
import { type CreateDalpClientOptions } from "./proxy/transport.ts";
|
|
27
|
+
import { DalpApiError } from "./errors/api-error.ts";
|
|
27
28
|
/** The failure channel every route call carries. */
|
|
28
29
|
export declare class DalpRequestError extends Error {
|
|
29
30
|
readonly _tag = "DalpRequestError";
|
|
@@ -34,6 +35,8 @@ export declare class DalpRequestError extends Error {
|
|
|
34
35
|
readonly status: number | undefined;
|
|
35
36
|
readonly retryable: boolean;
|
|
36
37
|
readonly routeId: string;
|
|
38
|
+
/** The wire envelope's route-specific `data`, e.g. `requiredRoles` on a role-gated 403. */
|
|
39
|
+
readonly data: DalpApiError["data"];
|
|
37
40
|
constructor(routeId: string, cause: unknown);
|
|
38
41
|
}
|
|
39
42
|
/** The Effect-shaped mirror of `DalpApi`. */
|
package/dist/effect.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
queryKeyFor,
|
|
9
9
|
sendRequest,
|
|
10
10
|
streamRequest
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-tcm75mnh.js";
|
|
12
12
|
import"./chunk-fjnq61hj.js";
|
|
13
13
|
import {
|
|
14
14
|
data
|
|
@@ -25,6 +25,7 @@ class DalpRequestError extends Error {
|
|
|
25
25
|
status;
|
|
26
26
|
retryable;
|
|
27
27
|
routeId;
|
|
28
|
+
data;
|
|
28
29
|
constructor(routeId, cause) {
|
|
29
30
|
const api = cause instanceof DalpApiError ? cause : undefined;
|
|
30
31
|
super(api?.message ?? `DALP request failed for ${routeId}`, { cause });
|
|
@@ -35,6 +36,7 @@ class DalpRequestError extends Error {
|
|
|
35
36
|
this.id = api?.id ?? this.code;
|
|
36
37
|
this.status = api?.status;
|
|
37
38
|
this.retryable = api?.retryable ?? true;
|
|
39
|
+
this.data = api?.data;
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
42
|
function runRoute(transport, route, id, input, options) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { findCurrentError } from "./find-current-error.ts";
|
|
2
|
+
import type { DalpSdkErrorDetails } from "./sdk-error.ts";
|
|
2
3
|
export type DalpApiErrorCategory = "client" | "auth" | "permission" | "domain" | "contract" | "dependency" | "operational" | "config" | "unknown";
|
|
3
4
|
export interface DalpApiErrorOptions {
|
|
4
5
|
readonly message: string;
|
|
@@ -11,6 +12,7 @@ export interface DalpApiErrorOptions {
|
|
|
11
12
|
readonly why: string;
|
|
12
13
|
readonly fix: string;
|
|
13
14
|
readonly retryAfterSeconds?: number;
|
|
15
|
+
readonly data?: DalpSdkErrorDetails;
|
|
14
16
|
}
|
|
15
17
|
export declare class DalpApiError extends Error {
|
|
16
18
|
readonly id?: string;
|
|
@@ -21,6 +23,8 @@ export declare class DalpApiError extends Error {
|
|
|
21
23
|
readonly why: string;
|
|
22
24
|
readonly fix: string;
|
|
23
25
|
readonly retryAfterSeconds?: number;
|
|
26
|
+
/** The wire envelope's route-specific `data`, e.g. `requiredRoles` on a role-gated 403. */
|
|
27
|
+
readonly data?: DalpSdkErrorDetails;
|
|
24
28
|
constructor(options: DalpApiErrorOptions);
|
|
25
29
|
static make(options: DalpApiErrorOptions): DalpApiError;
|
|
26
30
|
}
|
package/dist/index.js
CHANGED
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
SDK_VERSION,
|
|
4
4
|
createCookieStoreFetch,
|
|
5
5
|
makeCookieStore
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-dxdqzhs0.js";
|
|
7
7
|
import {
|
|
8
8
|
createDalpClient
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-77rp65xa.js";
|
|
10
10
|
import"./chunk-f4t1bm86.js";
|
|
11
11
|
import {
|
|
12
12
|
DEFAULT_SETTLEMENT_TIMEOUT_MS,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
findDalpSdkError,
|
|
21
21
|
isDalpApiError,
|
|
22
22
|
makeDalpApiError
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-tcm75mnh.js";
|
|
24
24
|
import"./chunk-fjnq61hj.js";
|
|
25
25
|
import"./chunk-gryttjx0.js";
|
|
26
26
|
import {
|
package/dist/react-query.js
CHANGED
package/package.json
CHANGED