@settlemint/dalp-sdk 3.1.26-main.37150284587 → 3.1.26-main.37154707747
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 +7 -3
- package/dist/{chunk-5f3vcf8j.js → chunk-06nb3sx9.js} +8 -3
- package/dist/{chunk-bnmpjm3n.js → chunk-bswka7ta.js} +6 -2
- package/dist/{chunk-yc0yb9w4.js → chunk-e0zn3kpq.js} +1 -1
- package/dist/chunk-h9e65x5z.js +28 -0
- package/dist/{chunk-4f4kjtt0.js → chunk-hcpk89xj.js} +16 -24
- package/dist/effect.js +3 -2
- package/dist/index.js +5 -4
- package/dist/react-query.js +3 -2
- package/dist/routes/console.js +4 -3
- package/dist/runtime.d.ts +2 -0
- package/dist/server-proxy.d.ts +33 -0
- package/dist/server-proxy.js +173 -0
- package/package.json +7 -2
package/dist/auth.js
CHANGED
|
@@ -5,19 +5,22 @@ import {
|
|
|
5
5
|
DALP_AUTH_SURFACE_HEADER2,
|
|
6
6
|
secret2,
|
|
7
7
|
unwrapSecret,
|
|
8
|
-
normalizeDalpBaseUrl,
|
|
9
8
|
detectDalpRuntime,
|
|
9
|
+
refuseCrossOriginBrowserSession,
|
|
10
10
|
refuseBundledApiKey,
|
|
11
11
|
STEP_UP_CHALLENGE_HEADER,
|
|
12
12
|
STEP_UP_CHALLENGE_PATH,
|
|
13
13
|
carriesWalletProof,
|
|
14
14
|
stepUpChallengeRequest
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-hcpk89xj.js";
|
|
16
16
|
import {
|
|
17
17
|
makeCookieStore2,
|
|
18
18
|
createCookieStoreFetch2,
|
|
19
19
|
SDK_USER_AGENT2
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-06nb3sx9.js";
|
|
21
|
+
import {
|
|
22
|
+
normalizeDalpBaseUrl
|
|
23
|
+
} from "./chunk-h9e65x5z.js";
|
|
21
24
|
|
|
22
25
|
// src/auth/live.ts
|
|
23
26
|
import { apiKeyClient } from "@better-auth/api-key/client";
|
|
@@ -488,6 +491,7 @@ function createConfiguredBetterAuthClient(config, cookieStore) {
|
|
|
488
491
|
];
|
|
489
492
|
const baseUrl = normalizeDalpBaseUrl(config.url);
|
|
490
493
|
const runtime = config.runtime ?? detectDalpRuntime();
|
|
494
|
+
refuseCrossOriginBrowserSession(runtime, baseUrl, config.apiKey !== undefined);
|
|
491
495
|
if (config.apiKey !== undefined) {
|
|
492
496
|
refuseBundledApiKey(runtime);
|
|
493
497
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
keepBufferingMarker
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-hcpk89xj.js";
|
|
4
4
|
|
|
5
5
|
// src/transport/cookie-store.ts
|
|
6
6
|
var parseCookieHeader = (header) => {
|
|
@@ -107,7 +107,7 @@ function createCookieStoreFetch2(cookieStore, fetchImpl = globalThis.fetch) {
|
|
|
107
107
|
// package.json
|
|
108
108
|
var package_default = {
|
|
109
109
|
name: "@settlemint/dalp-sdk",
|
|
110
|
-
version: "3.1.26-main.
|
|
110
|
+
version: "3.1.26-main.37154707747",
|
|
111
111
|
private: false,
|
|
112
112
|
description: "Fully typed SDK for the DALP tokenization platform API",
|
|
113
113
|
homepage: "https://settlemint.com",
|
|
@@ -131,6 +131,11 @@ var package_default = {
|
|
|
131
131
|
],
|
|
132
132
|
exports: {
|
|
133
133
|
"./package.json": "./package.json",
|
|
134
|
+
"./server-proxy": {
|
|
135
|
+
types: "./dist/server-proxy.d.ts",
|
|
136
|
+
import: "./dist/server-proxy.js",
|
|
137
|
+
default: "./dist/server-proxy.js"
|
|
138
|
+
},
|
|
134
139
|
"./runtime-exports": {
|
|
135
140
|
types: "./dist/runtime-exports.d.ts",
|
|
136
141
|
import: "./dist/runtime-exports.js",
|
|
@@ -220,7 +225,7 @@ var package_default = {
|
|
|
220
225
|
"@better-auth/passkey": "1.7.7",
|
|
221
226
|
"@domains/webhooks-contract": "workspace:*",
|
|
222
227
|
"better-auth": "1.7.7",
|
|
223
|
-
"better-call": "1.4.
|
|
228
|
+
"better-call": "1.4.1",
|
|
224
229
|
dnum: "2.17.0",
|
|
225
230
|
standardwebhooks: "1.1.1",
|
|
226
231
|
viem: "2.57.2"
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
Secret2,
|
|
7
7
|
secret2,
|
|
8
8
|
unwrapSecret,
|
|
9
|
-
normalizeDalpBaseUrl,
|
|
10
9
|
detectDalpRuntime,
|
|
11
10
|
runtimeCredentials,
|
|
11
|
+
refuseCrossOriginBrowserSession,
|
|
12
12
|
isBufferingFetch,
|
|
13
13
|
refuseBundledApiKey,
|
|
14
14
|
STEP_UP_CHALLENGE_HEADER,
|
|
@@ -16,7 +16,10 @@ import {
|
|
|
16
16
|
STEP_UP_CHALLENGE_PATH,
|
|
17
17
|
carriesWalletProof,
|
|
18
18
|
stepUpChallengeRequest
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-hcpk89xj.js";
|
|
20
|
+
import {
|
|
21
|
+
normalizeDalpBaseUrl
|
|
22
|
+
} from "./chunk-h9e65x5z.js";
|
|
20
23
|
|
|
21
24
|
// src/errors/find-current-error.ts
|
|
22
25
|
var readProperty = (target, key) => Reflect.get(target, key);
|
|
@@ -720,6 +723,7 @@ function createTransport(options) {
|
|
|
720
723
|
} else {
|
|
721
724
|
apiKey = secret2(apiKeyOption.trim());
|
|
722
725
|
}
|
|
726
|
+
refuseCrossOriginBrowserSession(runtime, baseUrl, apiKey !== undefined);
|
|
723
727
|
if (apiKey !== undefined) {
|
|
724
728
|
refuseBundledApiKey(runtime);
|
|
725
729
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createDalpSdkConfigurationError2
|
|
3
|
+
} from "./chunk-k3ntysxx.js";
|
|
4
|
+
|
|
5
|
+
// src/url.ts
|
|
6
|
+
function normalizeDalpBaseUrl(url) {
|
|
7
|
+
let parsed;
|
|
8
|
+
try {
|
|
9
|
+
parsed = new URL(url);
|
|
10
|
+
} catch (error) {
|
|
11
|
+
throw createDalpSdkConfigurationError2({
|
|
12
|
+
message: `DALP SDK: invalid url "${url}". Provide a full URL including the protocol (e.g., "https://dalp.example.com").`,
|
|
13
|
+
why: "The SDK could not parse the configured DALP API URL.",
|
|
14
|
+
fix: 'Provide a full http:// or https:// URL, for example "https://dalp.example.com".',
|
|
15
|
+
cause: error
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
if (parsed.protocol !== "https:" && parsed.protocol !== "http:") {
|
|
19
|
+
throw createDalpSdkConfigurationError2({
|
|
20
|
+
message: `DALP SDK: url must use https:// or http:// protocol, got "${parsed.protocol}".`,
|
|
21
|
+
why: `The SDK received a URL with the unsupported "${parsed.protocol}" protocol.`,
|
|
22
|
+
fix: 'Use a DALP API base URL that starts with "https://" or "http://".'
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return `${parsed.origin}${parsed.pathname.replace(/\/+$/, "")}`;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { normalizeDalpBaseUrl };
|
|
@@ -40,29 +40,6 @@ var unwrapSecret = (value) => {
|
|
|
40
40
|
return raw;
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
// src/url.ts
|
|
44
|
-
function normalizeDalpBaseUrl(url) {
|
|
45
|
-
let parsed;
|
|
46
|
-
try {
|
|
47
|
-
parsed = new URL(url);
|
|
48
|
-
} catch (error) {
|
|
49
|
-
throw createDalpSdkConfigurationError2({
|
|
50
|
-
message: `DALP SDK: invalid url "${url}". Provide a full URL including the protocol (e.g., "https://dalp.example.com").`,
|
|
51
|
-
why: "The SDK could not parse the configured DALP API URL.",
|
|
52
|
-
fix: 'Provide a full http:// or https:// URL, for example "https://dalp.example.com".',
|
|
53
|
-
cause: error
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
if (parsed.protocol !== "https:" && parsed.protocol !== "http:") {
|
|
57
|
-
throw createDalpSdkConfigurationError2({
|
|
58
|
-
message: `DALP SDK: url must use https:// or http:// protocol, got "${parsed.protocol}".`,
|
|
59
|
-
why: `The SDK received a URL with the unsupported "${parsed.protocol}" protocol.`,
|
|
60
|
-
fix: 'Use a DALP API base URL that starts with "https://" or "http://".'
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
return `${parsed.origin}${parsed.pathname.replace(/\/+$/, "")}`;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
43
|
// src/runtime.ts
|
|
67
44
|
var REACT_NATIVE_NAVIGATOR_PRODUCT = "ReactNative";
|
|
68
45
|
function detectDalpRuntime() {
|
|
@@ -74,6 +51,21 @@ function detectDalpRuntime() {
|
|
|
74
51
|
function runtimeCredentials(runtime) {
|
|
75
52
|
return runtime === "browser" ? "include" : "omit";
|
|
76
53
|
}
|
|
54
|
+
function refuseCrossOriginBrowserSession(runtime, baseUrl, usesApiKey) {
|
|
55
|
+
if (runtime !== "browser" || usesApiKey) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const browserOrigin = globalThis.window?.location?.origin;
|
|
59
|
+
const targetOrigin = new URL(baseUrl).origin;
|
|
60
|
+
if (browserOrigin === undefined || browserOrigin === targetOrigin) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
throw createDalpSdkConfigurationError2({
|
|
64
|
+
message: "DALP SDK: browser cookie sessions must use the application origin; mount createDalpProxy at /api.",
|
|
65
|
+
why: `The browser page is ${browserOrigin}, but the client targets ${targetOrigin}; host-only session cookies do not cross origins.`,
|
|
66
|
+
fix: "Set the browser client baseUrl to window.location.origin and mount createDalpProxy at /api on that origin."
|
|
67
|
+
});
|
|
68
|
+
}
|
|
77
69
|
var WHATWG_FETCH_POLYFILL_FLAG = "polyfill";
|
|
78
70
|
function isBufferingFetch(fetchImpl) {
|
|
79
71
|
return typeof fetchImpl === "function" && Reflect.get(fetchImpl, WHATWG_FETCH_POLYFILL_FLAG) === true;
|
|
@@ -146,4 +138,4 @@ async function stepUpChallengeRequest(operation, target, body) {
|
|
|
146
138
|
return { operation, target, payloadDigest };
|
|
147
139
|
}
|
|
148
140
|
|
|
149
|
-
export { DALP_AUTH_SURFACE_HEADER2, SECRET_REDACTION_MARKER2, Secret2, secret2, unwrapSecret,
|
|
141
|
+
export { DALP_AUTH_SURFACE_HEADER2, SECRET_REDACTION_MARKER2, Secret2, secret2, unwrapSecret, detectDalpRuntime, runtimeCredentials, refuseCrossOriginBrowserSession, isBufferingFetch, keepBufferingMarker, refuseBundledApiKey, STEP_UP_CHALLENGE_HEADER, WALLET_VERIFICATION_HEADER, STEP_UP_CHALLENGE_PATH, carriesWalletProof, stepUpChallengeRequest };
|
package/dist/effect.js
CHANGED
|
@@ -8,12 +8,13 @@ import {
|
|
|
8
8
|
streamRequest,
|
|
9
9
|
sendRequest,
|
|
10
10
|
queryKeyFor2
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import"./chunk-
|
|
11
|
+
} from "./chunk-bswka7ta.js";
|
|
12
|
+
import"./chunk-hcpk89xj.js";
|
|
13
13
|
import {
|
|
14
14
|
buildProxy,
|
|
15
15
|
findRoute
|
|
16
16
|
} from "./chunk-b03ycwb7.js";
|
|
17
|
+
import"./chunk-h9e65x5z.js";
|
|
17
18
|
|
|
18
19
|
// src/effect.ts
|
|
19
20
|
import * as Effect from "effect/Effect";
|
package/dist/index.js
CHANGED
|
@@ -22,22 +22,23 @@ import {
|
|
|
22
22
|
STREAM_FAILED_ERROR_CODE2,
|
|
23
23
|
STREAM_UNREADABLE_BODY_ERROR_CODE2,
|
|
24
24
|
decodeEventStream2
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-bswka7ta.js";
|
|
26
26
|
import {
|
|
27
27
|
DALP_AUTH_SURFACE_HEADER2,
|
|
28
28
|
SECRET_REDACTION_MARKER2,
|
|
29
29
|
Secret2,
|
|
30
30
|
secret2
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-hcpk89xj.js";
|
|
32
32
|
import {
|
|
33
33
|
makeCookieStore2,
|
|
34
34
|
createCookieStoreFetch2,
|
|
35
35
|
SDK_VERSION2,
|
|
36
36
|
SDK_USER_AGENT2
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-06nb3sx9.js";
|
|
38
38
|
import {
|
|
39
39
|
buildDalpClient
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-e0zn3kpq.js";
|
|
41
|
+
import"./chunk-h9e65x5z.js";
|
|
41
42
|
|
|
42
43
|
// src/proxy/client.ts
|
|
43
44
|
function createDalpClient(options) {
|
package/dist/react-query.js
CHANGED
|
@@ -3,8 +3,9 @@ import {
|
|
|
3
3
|
canonicalize2,
|
|
4
4
|
queryKeyFor2,
|
|
5
5
|
UI_SETTLEMENT_TIMEOUT_MS2
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import"./chunk-
|
|
6
|
+
} from "./chunk-bswka7ta.js";
|
|
7
|
+
import"./chunk-hcpk89xj.js";
|
|
8
|
+
import"./chunk-h9e65x5z.js";
|
|
8
9
|
export {
|
|
9
10
|
UI_SETTLEMENT_TIMEOUT_MS2 as UI_SETTLEMENT_TIMEOUT_MS,
|
|
10
11
|
canonicalize2 as canonicalize,
|