@settlemint/dalp-sdk 3.1.6 → 3.1.7-main.32759251718

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 (109) hide show
  1. package/README.md +111 -177
  2. package/dist/auth/client.d.ts +99 -0
  3. package/dist/auth/live.d.ts +4366 -0
  4. package/dist/{auth-permissions.d.ts → auth/permissions.d.ts} +1 -2
  5. package/dist/{auth-wallet-plugins.d.ts → auth/wallet-plugins.d.ts} +69 -5
  6. package/dist/auth.d.ts +22 -115
  7. package/dist/auth.js +248 -0
  8. package/dist/bundler.d.ts +17 -207
  9. package/dist/bundler.js +111 -0
  10. package/dist/chunk-6zx7kn5t.js +40273 -0
  11. package/dist/chunk-9gjdpxrh.js +249 -0
  12. package/dist/chunk-cy9b59s6.js +503 -0
  13. package/dist/chunk-h12fatty.js +63 -0
  14. package/dist/chunk-r0vsftj4.js +102 -0
  15. package/dist/chunk-w21k7p99.js +843 -0
  16. package/dist/chunk-wx236z2x.js +12300 -0
  17. package/dist/chunk-y0d2c7kp.js +54 -0
  18. package/dist/client/conditional-request.d.ts +16 -0
  19. package/dist/client/factory.d.ts +39 -0
  20. package/dist/client/query-serializer.d.ts +2 -0
  21. package/dist/client/request-compression.d.ts +47 -0
  22. package/dist/client/ssr-fetch.d.ts +12 -0
  23. package/dist/errors/api-error.d.ts +29 -0
  24. package/dist/errors/find-current-error.d.ts +8 -0
  25. package/dist/errors/sdk-error.d.ts +47 -0
  26. package/dist/errors/sdk-error.js +8 -0
  27. package/dist/generated/@tanstack/react-query.gen.d.ts +18693 -0
  28. package/dist/generated/client/client.gen.d.ts +2 -0
  29. package/dist/generated/client/index.d.ts +10 -0
  30. package/dist/generated/client/types.gen.d.ts +120 -0
  31. package/dist/generated/client/utils.gen.d.ts +37 -0
  32. package/dist/generated/client.gen.d.ts +12 -0
  33. package/dist/generated/core/auth.gen.d.ts +25 -0
  34. package/dist/generated/core/bodySerializer.gen.d.ts +25 -0
  35. package/dist/generated/core/params.gen.d.ts +43 -0
  36. package/dist/generated/core/pathSerializer.gen.d.ts +33 -0
  37. package/dist/generated/core/queryKeySerializer.gen.d.ts +18 -0
  38. package/dist/generated/core/serverSentEvents.gen.d.ts +71 -0
  39. package/dist/generated/core/types.gen.d.ts +83 -0
  40. package/dist/generated/core/utils.gen.d.ts +19 -0
  41. package/dist/generated/index.d.ts +2 -0
  42. package/dist/generated/sdk.gen.d.ts +4883 -0
  43. package/dist/generated/transformers.gen.d.ts +40 -0
  44. package/dist/generated/types.gen.d.ts +121889 -0
  45. package/dist/generated/zod.gen.d.ts +163107 -0
  46. package/dist/index.d.ts +23 -40
  47. package/dist/index.js +208 -96013
  48. package/dist/operations.d.ts +12 -0
  49. package/dist/operations.js +1635 -0
  50. package/dist/react-query.d.ts +11 -0
  51. package/dist/react-query.js +15315 -0
  52. package/dist/readonly-deep.d.ts +12 -0
  53. package/dist/runtime-exports.d.ts +20 -0
  54. package/dist/runtime-exports.js +16 -0
  55. package/dist/scalars/big-decimal.d.ts +12 -0
  56. package/dist/scalars/ethereum-address.d.ts +8 -0
  57. package/dist/scalars/exchange-rates.d.ts +36 -0
  58. package/dist/scalars/index.d.ts +15 -0
  59. package/dist/scalars/index.js +35 -0
  60. package/dist/scalars/organization-id.d.ts +8 -0
  61. package/dist/schemas.d.ts +10 -0
  62. package/dist/schemas.js +11070 -0
  63. package/dist/secret.d.ts +14 -0
  64. package/dist/sign-webhook-receipt.d.ts +76 -0
  65. package/dist/sign-webhook-receipt.js +26 -0
  66. package/dist/transport/cookie-store.d.ts +9 -0
  67. package/dist/transport/sse-lifecycle.d.ts +44 -0
  68. package/dist/types.d.ts +57 -104
  69. package/dist/url.d.ts +0 -1
  70. package/dist/verify-webhook.d.ts +17 -28
  71. package/dist/verify-webhook.js +8 -0
  72. package/dist/version.d.ts +0 -1
  73. package/dist/wait-for-transaction.d.ts +37 -86
  74. package/dist/wait-for-transaction.js +112 -0
  75. package/dist/webhook-events.d.ts +43 -26
  76. package/package.json +91 -29
  77. package/dist/auth-permissions.d.ts.map +0 -1
  78. package/dist/auth-wallet-plugins.d.ts.map +0 -1
  79. package/dist/auth.d.ts.map +0 -1
  80. package/dist/bundler.d.ts.map +0 -1
  81. package/dist/chunk-xm8h1dzh.js +0 -33
  82. package/dist/client.d.ts +0 -19
  83. package/dist/client.d.ts.map +0 -1
  84. package/dist/contract-errors.d.ts +0 -4156
  85. package/dist/contract-errors.d.ts.map +0 -1
  86. package/dist/contract.d.ts +0 -17
  87. package/dist/contract.d.ts.map +0 -1
  88. package/dist/cookie-store.d.ts +0 -10
  89. package/dist/cookie-store.d.ts.map +0 -1
  90. package/dist/dapi-errors.d.ts +0 -650
  91. package/dist/dapi-errors.d.ts.map +0 -1
  92. package/dist/errors.d.ts +0 -633
  93. package/dist/errors.d.ts.map +0 -1
  94. package/dist/index.d.ts.map +0 -1
  95. package/dist/platform.d.ts +0 -41
  96. package/dist/platform.d.ts.map +0 -1
  97. package/dist/plugins/index.d.ts +0 -13
  98. package/dist/plugins/index.d.ts.map +0 -1
  99. package/dist/plugins/index.js +0 -10
  100. package/dist/sdk-error.d.ts +0 -74
  101. package/dist/sdk-error.d.ts.map +0 -1
  102. package/dist/serializers.d.ts +0 -41
  103. package/dist/serializers.d.ts.map +0 -1
  104. package/dist/types.d.ts.map +0 -1
  105. package/dist/url.d.ts.map +0 -1
  106. package/dist/verify-webhook.d.ts.map +0 -1
  107. package/dist/version.d.ts.map +0 -1
  108. package/dist/wait-for-transaction.d.ts.map +0 -1
  109. package/dist/webhook-events.d.ts.map +0 -1
@@ -0,0 +1,249 @@
1
+ // src/transport/cookie-store.ts
2
+ var parseCookieHeader = (header) => {
3
+ const cookies = new Map;
4
+ for (const part of header.split(";")) {
5
+ const pair = part.trim();
6
+ const separator = pair.indexOf("=");
7
+ if (separator > 0) {
8
+ cookies.set(pair.slice(0, separator), pair);
9
+ }
10
+ }
11
+ return cookies;
12
+ };
13
+ var isCookieDeletion = (setCookie, now = Date.now()) => {
14
+ if (/\bmax-age\s*=\s*-?0+\b/iu.test(setCookie) || /\bmax-age\s*=\s*-\d+\b/iu.test(setCookie)) {
15
+ return true;
16
+ }
17
+ const expires = /\bexpires\s*=\s*([^;]+)/iu.exec(setCookie)?.[1];
18
+ if (expires === undefined) {
19
+ return false;
20
+ }
21
+ const parsed = Date.parse(expires.trim());
22
+ return !Number.isNaN(parsed) && parsed <= now;
23
+ };
24
+ function makeCookieStore(initialHeader = "") {
25
+ const cookies = parseCookieHeader(initialHeader);
26
+ return {
27
+ header: () => [...cookies.values()].join("; "),
28
+ isEmpty: () => cookies.size === 0,
29
+ setCookieHeader: (header) => {
30
+ cookies.clear();
31
+ for (const [name, pair] of parseCookieHeader(header)) {
32
+ cookies.set(name, pair);
33
+ }
34
+ },
35
+ storeSetCookieHeaders: (headers) => {
36
+ for (const setCookie of headers) {
37
+ const pair = setCookie.split(";", 1)[0]?.trim() ?? "";
38
+ const separator = pair.indexOf("=");
39
+ if (separator <= 0) {
40
+ continue;
41
+ }
42
+ const name = pair.slice(0, separator);
43
+ if (isCookieDeletion(setCookie)) {
44
+ cookies.delete(name);
45
+ } else {
46
+ cookies.set(name, pair);
47
+ }
48
+ }
49
+ }
50
+ };
51
+ }
52
+ var getSetCookieHeaders = (headers) => {
53
+ const { getSetCookie } = headers;
54
+ if (getSetCookie !== undefined) {
55
+ return getSetCookie.call(headers);
56
+ }
57
+ const value = headers.get("set-cookie");
58
+ return value === null ? [] : splitCombinedSetCookie(value);
59
+ };
60
+ var splitCombinedSetCookie = (value) => {
61
+ const cookies = [];
62
+ const lowered = value.toLowerCase();
63
+ let start = 0;
64
+ let inExpires = false;
65
+ for (let index = 0;index < value.length; index += 1) {
66
+ if (lowered.startsWith("expires=", index)) {
67
+ inExpires = true;
68
+ }
69
+ const character = value[index];
70
+ if (character === ";") {
71
+ inExpires = false;
72
+ }
73
+ if (character !== "," || inExpires) {
74
+ continue;
75
+ }
76
+ const next = value.slice(index + 1);
77
+ if (!/^\s*[\w!#$%&'*+\-.^`|~]+=/u.test(next)) {
78
+ continue;
79
+ }
80
+ cookies.push(value.slice(start, index).trim());
81
+ start = index + 1;
82
+ }
83
+ const finalCookie = value.slice(start).trim();
84
+ if (finalCookie.length > 0) {
85
+ cookies.push(finalCookie);
86
+ }
87
+ return cookies;
88
+ };
89
+ function createCookieStoreFetch(cookieStore, fetchImpl = globalThis.fetch) {
90
+ return async (input, init) => {
91
+ const headers = new Headers(init?.headers ?? (input instanceof Request ? input.headers : undefined));
92
+ if (!cookieStore.isEmpty() && !headers.has("cookie")) {
93
+ headers.set("cookie", cookieStore.header());
94
+ }
95
+ const response = await fetchImpl(input, { ...init, headers });
96
+ if (response.status < 500) {
97
+ cookieStore.storeSetCookieHeaders(getSetCookieHeaders(response.headers));
98
+ }
99
+ return response;
100
+ };
101
+ }
102
+ // package.json
103
+ var package_default = {
104
+ name: "@settlemint/dalp-sdk",
105
+ version: "3.1.7-main.32759251718",
106
+ private: false,
107
+ description: "Fully typed SDK for the DALP tokenization platform API",
108
+ homepage: "https://settlemint.com",
109
+ bugs: {
110
+ email: "support@settlemint.com"
111
+ },
112
+ license: "SEE LICENSE IN LICENSE",
113
+ author: {
114
+ name: "SettleMint",
115
+ email: "support@settlemint.com",
116
+ url: "https://settlemint.com"
117
+ },
118
+ files: [
119
+ "dist",
120
+ "README.md",
121
+ "LICENSE"
122
+ ],
123
+ type: "module",
124
+ sideEffects: [
125
+ "./src/**"
126
+ ],
127
+ exports: {
128
+ "./package.json": "./package.json",
129
+ "./runtime-exports": {
130
+ types: "./dist/runtime-exports.d.ts",
131
+ import: "./dist/runtime-exports.js",
132
+ default: "./dist/runtime-exports.js"
133
+ },
134
+ ".": {
135
+ types: "./dist/index.d.ts",
136
+ import: "./dist/index.js",
137
+ default: "./dist/index.js"
138
+ },
139
+ "./operations": {
140
+ types: "./dist/operations.d.ts",
141
+ import: "./dist/operations.js",
142
+ default: "./dist/operations.js"
143
+ },
144
+ "./types": {
145
+ types: "./dist/types.d.ts",
146
+ import: "./dist/types.js",
147
+ default: "./dist/types.js"
148
+ },
149
+ "./schemas": {
150
+ types: "./dist/schemas.d.ts",
151
+ import: "./dist/schemas.js",
152
+ default: "./dist/schemas.js"
153
+ },
154
+ "./scalars": {
155
+ types: "./dist/scalars/index.d.ts",
156
+ import: "./dist/scalars/index.js",
157
+ default: "./dist/scalars/index.js"
158
+ },
159
+ "./react-query": {
160
+ types: "./dist/react-query.d.ts",
161
+ import: "./dist/react-query.js",
162
+ default: "./dist/react-query.js"
163
+ },
164
+ "./auth": {
165
+ types: "./dist/auth.d.ts",
166
+ import: "./dist/auth.js",
167
+ default: "./dist/auth.js"
168
+ },
169
+ "./bundler": {
170
+ types: "./dist/bundler.d.ts",
171
+ import: "./dist/bundler.js",
172
+ default: "./dist/bundler.js"
173
+ },
174
+ "./verify-webhook": {
175
+ types: "./dist/verify-webhook.d.ts",
176
+ import: "./dist/verify-webhook.js",
177
+ default: "./dist/verify-webhook.js"
178
+ },
179
+ "./wait-for-transaction": {
180
+ types: "./dist/wait-for-transaction.d.ts",
181
+ import: "./dist/wait-for-transaction.js",
182
+ default: "./dist/wait-for-transaction.js"
183
+ },
184
+ "./sdk-error": {
185
+ types: "./dist/errors/sdk-error.d.ts",
186
+ import: "./dist/errors/sdk-error.js",
187
+ default: "./dist/errors/sdk-error.js"
188
+ },
189
+ "./sign-webhook-receipt": {
190
+ types: "./dist/sign-webhook-receipt.d.ts",
191
+ import: "./dist/sign-webhook-receipt.js",
192
+ default: "./dist/sign-webhook-receipt.js"
193
+ }
194
+ },
195
+ publishConfig: {
196
+ access: "public"
197
+ },
198
+ scripts: {
199
+ build: "rm -rf dist && dalp sdk:build && tsc -p tsconfig.build.json && dalp sdk:check-dts-portability && dalp sdk:ensure-dist --check",
200
+ "ensure-dist": "dalp sdk:ensure-dist",
201
+ codegen: "dalp sdk:codegen",
202
+ publint: "publint run --strict --pack bun",
203
+ attw: 'archive=$(bun pm pack --destination "$PWD" --quiet | tail -n 1) && attw "$archive" --profile esm-only; code=$?; rm -f "$archive"; exit $code',
204
+ publish: "cp ../../LICENSE . && bun publish --tolerate-republish --ignore-scripts --tag ${TAG:-latest} --access public",
205
+ prepack: "cp ../../LICENSE .",
206
+ test: "bun test --timeout 30000 tests/unit",
207
+ "test:coverage": "bun test --timeout 30000 --coverage --coverage-reporter=lcov --coverage-reporter=text tests/unit",
208
+ lint: "oxfmt --check . && ast-grep scan .",
209
+ typecheck: "oxlint --deny-warnings ."
210
+ },
211
+ dependencies: {
212
+ "@better-auth/api-key": "1.7.1",
213
+ "@better-auth/passkey": "1.7.1",
214
+ "better-auth": "1.7.1",
215
+ "better-call": "1.4.0",
216
+ dnum: "2.17.0",
217
+ standardwebhooks: "1.0.0",
218
+ viem: "2.55.19"
219
+ },
220
+ devDependencies: {
221
+ "@arethetypeswrong/cli": "0.18.5",
222
+ "@hey-api/openapi-ts": "0.0.0-next-20260819153534",
223
+ "@tanstack/react-query": "5.101.4",
224
+ "@tools/scripts": "workspace:*",
225
+ "@tools/typescript-config": "workspace:*",
226
+ "@types/bun": "catalog:toolchain",
227
+ publint: "0.3.24",
228
+ typescript: "7.0.2",
229
+ zod: "4.4.3"
230
+ },
231
+ peerDependencies: {
232
+ "@tanstack/react-query": "^5.101.4",
233
+ zod: "^4.4.3"
234
+ },
235
+ peerDependenciesMeta: {
236
+ "@tanstack/react-query": {
237
+ optional: true
238
+ }
239
+ },
240
+ engines: {
241
+ node: ">=20"
242
+ }
243
+ };
244
+
245
+ // src/version.ts
246
+ var SDK_VERSION = package_default.version;
247
+ var SDK_USER_AGENT = `DALP SDK v${SDK_VERSION}`;
248
+
249
+ export { makeCookieStore, createCookieStoreFetch, SDK_VERSION, SDK_USER_AGENT };