@settlemint/dalp-sdk 2.1.7-main.22817809759 → 2.1.7-main.22820545676
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/README.md +1 -1
- package/dist/contract.d.ts +5 -1
- package/dist/index.js +254 -72
- package/dist/types.d.ts +7 -2
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -66,7 +66,7 @@ const dalp = createDalpClient({
|
|
|
66
66
|
organizationId: "org_...", // multi-org scoping
|
|
67
67
|
headers: { "User-Agent": "MyApp" }, // override default headers
|
|
68
68
|
idempotencyKey: "req_abc123", // ⚠️ sent on EVERY request — use only for single-mutation clients
|
|
69
|
-
requestValidation:
|
|
69
|
+
requestValidation: false, // validate requests client-side (default: false)
|
|
70
70
|
responseValidation: false, // validate responses client-side (default: false)
|
|
71
71
|
fetch: customFetch, // custom fetch implementation
|
|
72
72
|
});
|
package/dist/contract.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Re-exports the DALP v2
|
|
2
|
+
* Re-exports the DALP v2 contract.
|
|
3
3
|
*
|
|
4
4
|
* At build time, `bun build` bundles the contract definition (including all
|
|
5
5
|
* Zod schemas from workspace packages) into the SDK's `dist/` output.
|
|
6
6
|
* Consumers never need to install workspace-only packages.
|
|
7
7
|
*
|
|
8
|
+
* The SDK uses this contract with OpenAPILink to call the REST endpoint
|
|
9
|
+
* (/api/v2), where route definitions (method + path) drive proper HTTP
|
|
10
|
+
* method selection (GET for reads, POST for writes).
|
|
11
|
+
*
|
|
8
12
|
* Related: packages/dalp/dapi/contract/src/contract.ts
|
|
9
13
|
*
|
|
10
14
|
* @module
|
package/dist/index.js
CHANGED
|
@@ -1,71 +1,9 @@
|
|
|
1
1
|
// src/client.ts
|
|
2
2
|
import { createORPCClient } from "@orpc/client";
|
|
3
|
-
import { RPCLink } from "@orpc/client/fetch";
|
|
4
3
|
import { RequestValidationPlugin, ResponseValidationPlugin } from "@orpc/contract/plugins";
|
|
5
4
|
|
|
6
|
-
// ../../
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
// ../../packages/core/validation/src/verification-type.ts
|
|
10
|
-
import { z } from "zod";
|
|
11
|
-
var verificationTypes = ["OTP", "PINCODE", "SECRET_CODES", "PASSKEY"];
|
|
12
|
-
var walletVerificationTypes = ["OTP", "PINCODE", "SECRET_CODES", "PASSKEY"];
|
|
13
|
-
var verificationType = z.enum(verificationTypes).meta({ description: "Type of verification", examples: ["OTP", "PINCODE", "SECRET_CODES"] });
|
|
14
|
-
var walletVerificationType = z.enum(walletVerificationTypes).describe("Type of verification for wallet transactions");
|
|
15
|
-
|
|
16
|
-
// ../../packages/dalp/dapi/contract/src/routes/common/schemas/user-verification.schema.ts
|
|
17
|
-
import { z as z2 } from "zod";
|
|
18
|
-
var UserVerificationSchema = z2.object({
|
|
19
|
-
secretVerificationCode: z2.string(),
|
|
20
|
-
verificationType: walletVerificationType.default("PINCODE")
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
// ../../packages/dalp/dapi/contract/src/routes/common/schemas/mutation.schema.ts
|
|
24
|
-
var MutationInputSchema = z3.object({
|
|
25
|
-
walletVerification: UserVerificationSchema.optional()
|
|
26
|
-
});
|
|
27
|
-
// ../../packages/dalp/dapi/contract/src/routes/common/schemas/mutation-output.schema.ts
|
|
28
|
-
import { z as z4 } from "zod";
|
|
29
|
-
var BaseMutationOutputSchema = z4.object({
|
|
30
|
-
txHash: z4.string().meta({
|
|
31
|
-
description: "The transaction hash",
|
|
32
|
-
examples: ["0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"]
|
|
33
|
-
})
|
|
34
|
-
});
|
|
35
|
-
// ../../packages/dalp/dapi/contract/src/routes/common/schemas/paginated-list.schema.ts
|
|
36
|
-
import { z as z6 } from "zod";
|
|
37
|
-
|
|
38
|
-
// ../../packages/dalp/dapi/contract/src/routes/common/schemas/sortable-list.schema.ts
|
|
39
|
-
import { z as z5 } from "zod";
|
|
40
|
-
var SortableListSchema = z5.object({
|
|
41
|
-
orderDirection: z5.enum(["asc", "desc"]).default("asc"),
|
|
42
|
-
orderBy: z5.string().default("id")
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
// ../../packages/dalp/dapi/contract/src/routes/common/schemas/paginated-list.schema.ts
|
|
46
|
-
var PaginatedListSchema = SortableListSchema.extend({
|
|
47
|
-
offset: z6.number().int().nonnegative().default(0),
|
|
48
|
-
limit: z6.number().int().positive().max(200).default(25)
|
|
49
|
-
});
|
|
50
|
-
// ../../packages/core/validation/src/role-requirement.ts
|
|
51
|
-
import { z as z7 } from "zod";
|
|
52
|
-
var RoleRequirementSchema = z7.lazy(() => z7.union([
|
|
53
|
-
z7.string(),
|
|
54
|
-
z7.object({
|
|
55
|
-
any: z7.array(RoleRequirementSchema)
|
|
56
|
-
}),
|
|
57
|
-
z7.object({
|
|
58
|
-
all: z7.array(RoleRequirementSchema)
|
|
59
|
-
})
|
|
60
|
-
]));
|
|
61
|
-
|
|
62
|
-
// ../../packages/dalp/dapi/contract/src/errors.ts
|
|
63
|
-
import { oc } from "@orpc/contract";
|
|
64
|
-
|
|
65
|
-
// ../../node_modules/.bun/@orpc+openapi@1.13.6+50160a4e9ae07948/node_modules/@orpc/openapi/dist/shared/openapi.CoREqFh3.mjs
|
|
66
|
-
import { isORPCErrorStatus as isORPCErrorStatus2, fallbackORPCErrorStatus, fallbackORPCErrorMessage } from "@orpc/client";
|
|
67
|
-
import { toHttpPath as toHttpPath2 } from "@orpc/client/standard";
|
|
68
|
-
import { fallbackContractConfig as fallbackContractConfig3, getEventIteratorSchemaDetails } from "@orpc/contract";
|
|
5
|
+
// ../../node_modules/.bun/@orpc+openapi-client@1.13.6+460773ef8ff1e07c/node_modules/@orpc/openapi-client/dist/adapters/fetch/index.mjs
|
|
6
|
+
import { LinkFetchClient } from "@orpc/client/fetch";
|
|
69
7
|
|
|
70
8
|
// ../../node_modules/.bun/@orpc+shared@1.13.6+460773ef8ff1e07c/node_modules/@orpc/shared/dist/index.mjs
|
|
71
9
|
function resolveMaybeOptionalOptions(rest) {
|
|
@@ -403,6 +341,12 @@ function get(object, path) {
|
|
|
403
341
|
}
|
|
404
342
|
return current;
|
|
405
343
|
}
|
|
344
|
+
var NullProtoObj = /* @__PURE__ */ (() => {
|
|
345
|
+
const e = function() {};
|
|
346
|
+
e.prototype = /* @__PURE__ */ Object.create(null);
|
|
347
|
+
Object.freeze(e.prototype);
|
|
348
|
+
return e;
|
|
349
|
+
})();
|
|
406
350
|
function value(value2, ...args) {
|
|
407
351
|
if (typeof value2 === "function") {
|
|
408
352
|
return value2(...args);
|
|
@@ -422,10 +366,157 @@ function overlayProxy(target, partial) {
|
|
|
422
366
|
});
|
|
423
367
|
return proxy;
|
|
424
368
|
}
|
|
425
|
-
|
|
426
|
-
|
|
369
|
+
|
|
370
|
+
// ../../node_modules/.bun/@orpc+openapi-client@1.13.6+460773ef8ff1e07c/node_modules/@orpc/openapi-client/dist/adapters/fetch/index.mjs
|
|
371
|
+
import"@orpc/contract";
|
|
372
|
+
|
|
427
373
|
// ../../node_modules/.bun/@orpc+openapi-client@1.13.6+460773ef8ff1e07c/node_modules/@orpc/openapi-client/dist/shared/openapi-client.B2Q9qU5m.mjs
|
|
428
374
|
import { toStandardHeaders, toHttpPath, getMalformedResponseErrorCode, StandardLink } from "@orpc/client/standard";
|
|
375
|
+
|
|
376
|
+
// ../../node_modules/.bun/@orpc+openapi-client@1.13.6+460773ef8ff1e07c/node_modules/@orpc/openapi-client/dist/shared/openapi-client.t9fCAe3x.mjs
|
|
377
|
+
class StandardBracketNotationSerializer {
|
|
378
|
+
maxArrayIndex;
|
|
379
|
+
constructor(options = {}) {
|
|
380
|
+
this.maxArrayIndex = options.maxBracketNotationArrayIndex ?? 9999;
|
|
381
|
+
}
|
|
382
|
+
serialize(data, segments = [], result = []) {
|
|
383
|
+
if (Array.isArray(data)) {
|
|
384
|
+
data.forEach((item, i) => {
|
|
385
|
+
this.serialize(item, [...segments, i], result);
|
|
386
|
+
});
|
|
387
|
+
} else if (isObject(data)) {
|
|
388
|
+
for (const key in data) {
|
|
389
|
+
this.serialize(data[key], [...segments, key], result);
|
|
390
|
+
}
|
|
391
|
+
} else {
|
|
392
|
+
result.push([this.stringifyPath(segments), data]);
|
|
393
|
+
}
|
|
394
|
+
return result;
|
|
395
|
+
}
|
|
396
|
+
deserialize(serialized) {
|
|
397
|
+
if (serialized.length === 0) {
|
|
398
|
+
return {};
|
|
399
|
+
}
|
|
400
|
+
const arrayPushStyles = /* @__PURE__ */ new WeakSet;
|
|
401
|
+
const ref = { value: [] };
|
|
402
|
+
for (const [path, value2] of serialized) {
|
|
403
|
+
const segments = this.parsePath(path);
|
|
404
|
+
let currentRef = ref;
|
|
405
|
+
let nextSegment = "value";
|
|
406
|
+
segments.forEach((segment, i) => {
|
|
407
|
+
if (!Array.isArray(currentRef[nextSegment]) && !isObject(currentRef[nextSegment])) {
|
|
408
|
+
currentRef[nextSegment] = [];
|
|
409
|
+
}
|
|
410
|
+
if (i !== segments.length - 1) {
|
|
411
|
+
if (Array.isArray(currentRef[nextSegment]) && !isValidArrayIndex(segment, this.maxArrayIndex)) {
|
|
412
|
+
if (arrayPushStyles.has(currentRef[nextSegment])) {
|
|
413
|
+
arrayPushStyles.delete(currentRef[nextSegment]);
|
|
414
|
+
currentRef[nextSegment] = pushStyleArrayToObject(currentRef[nextSegment]);
|
|
415
|
+
} else {
|
|
416
|
+
currentRef[nextSegment] = arrayToObject(currentRef[nextSegment]);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
} else {
|
|
420
|
+
if (Array.isArray(currentRef[nextSegment])) {
|
|
421
|
+
if (segment === "") {
|
|
422
|
+
if (currentRef[nextSegment].length && !arrayPushStyles.has(currentRef[nextSegment])) {
|
|
423
|
+
currentRef[nextSegment] = arrayToObject(currentRef[nextSegment]);
|
|
424
|
+
}
|
|
425
|
+
} else {
|
|
426
|
+
if (arrayPushStyles.has(currentRef[nextSegment])) {
|
|
427
|
+
arrayPushStyles.delete(currentRef[nextSegment]);
|
|
428
|
+
currentRef[nextSegment] = pushStyleArrayToObject(currentRef[nextSegment]);
|
|
429
|
+
} else if (!isValidArrayIndex(segment, this.maxArrayIndex)) {
|
|
430
|
+
currentRef[nextSegment] = arrayToObject(currentRef[nextSegment]);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
currentRef = currentRef[nextSegment];
|
|
436
|
+
nextSegment = segment;
|
|
437
|
+
});
|
|
438
|
+
if (Array.isArray(currentRef) && nextSegment === "") {
|
|
439
|
+
arrayPushStyles.add(currentRef);
|
|
440
|
+
currentRef.push(value2);
|
|
441
|
+
} else if (nextSegment in currentRef) {
|
|
442
|
+
if (Array.isArray(currentRef[nextSegment])) {
|
|
443
|
+
currentRef[nextSegment].push(value2);
|
|
444
|
+
} else {
|
|
445
|
+
currentRef[nextSegment] = [currentRef[nextSegment], value2];
|
|
446
|
+
}
|
|
447
|
+
} else {
|
|
448
|
+
currentRef[nextSegment] = value2;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
return ref.value;
|
|
452
|
+
}
|
|
453
|
+
stringifyPath(segments) {
|
|
454
|
+
return segments.map((segment) => {
|
|
455
|
+
return segment.toString().replace(/[\\[\]]/g, (match) => {
|
|
456
|
+
switch (match) {
|
|
457
|
+
case "\\":
|
|
458
|
+
return "\\\\";
|
|
459
|
+
case "[":
|
|
460
|
+
return "\\[";
|
|
461
|
+
case "]":
|
|
462
|
+
return "\\]";
|
|
463
|
+
default:
|
|
464
|
+
return match;
|
|
465
|
+
}
|
|
466
|
+
});
|
|
467
|
+
}).reduce((result, segment, i) => {
|
|
468
|
+
if (i === 0) {
|
|
469
|
+
return segment;
|
|
470
|
+
}
|
|
471
|
+
return `${result}[${segment}]`;
|
|
472
|
+
}, "");
|
|
473
|
+
}
|
|
474
|
+
parsePath(path) {
|
|
475
|
+
const segments = [];
|
|
476
|
+
let inBrackets = false;
|
|
477
|
+
let currentSegment = "";
|
|
478
|
+
let backslashCount = 0;
|
|
479
|
+
for (let i = 0;i < path.length; i++) {
|
|
480
|
+
const char = path[i];
|
|
481
|
+
const nextChar = path[i + 1];
|
|
482
|
+
if (inBrackets && char === "]" && (nextChar === undefined || nextChar === "[") && backslashCount % 2 === 0) {
|
|
483
|
+
if (nextChar === undefined) {
|
|
484
|
+
inBrackets = false;
|
|
485
|
+
}
|
|
486
|
+
segments.push(currentSegment);
|
|
487
|
+
currentSegment = "";
|
|
488
|
+
i++;
|
|
489
|
+
} else if (segments.length === 0 && char === "[" && backslashCount % 2 === 0) {
|
|
490
|
+
inBrackets = true;
|
|
491
|
+
segments.push(currentSegment);
|
|
492
|
+
currentSegment = "";
|
|
493
|
+
} else if (char === "\\") {
|
|
494
|
+
backslashCount++;
|
|
495
|
+
} else {
|
|
496
|
+
currentSegment += "\\".repeat(backslashCount / 2) + char;
|
|
497
|
+
backslashCount = 0;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
return inBrackets || segments.length === 0 ? [path] : segments;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
function isValidArrayIndex(value2, maxIndex) {
|
|
504
|
+
return /^0$|^[1-9]\d*$/.test(value2) && Number(value2) <= maxIndex;
|
|
505
|
+
}
|
|
506
|
+
function arrayToObject(array) {
|
|
507
|
+
const obj = new NullProtoObj;
|
|
508
|
+
array.forEach((item, i) => {
|
|
509
|
+
obj[i] = item;
|
|
510
|
+
});
|
|
511
|
+
return obj;
|
|
512
|
+
}
|
|
513
|
+
function pushStyleArrayToObject(array) {
|
|
514
|
+
const obj = new NullProtoObj;
|
|
515
|
+
obj[""] = array.length === 1 ? array[0] : array;
|
|
516
|
+
return obj;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
// ../../node_modules/.bun/@orpc+openapi-client@1.13.6+460773ef8ff1e07c/node_modules/@orpc/openapi-client/dist/shared/openapi-client.B2Q9qU5m.mjs
|
|
429
520
|
import { isORPCErrorStatus, isORPCErrorJson, createORPCErrorFromJson, mapEventIterator, toORPCError } from "@orpc/client";
|
|
430
521
|
import { isContractProcedure, fallbackContractConfig, ORPCError } from "@orpc/contract";
|
|
431
522
|
|
|
@@ -840,6 +931,92 @@ class StandardOpenAPISerializer {
|
|
|
840
931
|
return data;
|
|
841
932
|
}
|
|
842
933
|
}
|
|
934
|
+
|
|
935
|
+
class StandardOpenAPILink extends StandardLink {
|
|
936
|
+
constructor(contract, linkClient, options) {
|
|
937
|
+
const jsonSerializer = new StandardOpenAPIJsonSerializer(options);
|
|
938
|
+
const bracketNotationSerializer = new StandardBracketNotationSerializer({ maxBracketNotationArrayIndex: 4294967294 });
|
|
939
|
+
const serializer = new StandardOpenAPISerializer(jsonSerializer, bracketNotationSerializer);
|
|
940
|
+
const linkCodec = new StandardOpenapiLinkCodec(contract, serializer, options);
|
|
941
|
+
super(linkCodec, linkClient, options);
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
// ../../node_modules/.bun/@orpc+openapi-client@1.13.6+460773ef8ff1e07c/node_modules/@orpc/openapi-client/dist/adapters/fetch/index.mjs
|
|
946
|
+
import"@orpc/client";
|
|
947
|
+
import"@orpc/client/standard";
|
|
948
|
+
class OpenAPILink extends StandardOpenAPILink {
|
|
949
|
+
constructor(contract, options) {
|
|
950
|
+
const linkClient = new LinkFetchClient(options);
|
|
951
|
+
super(contract, linkClient, options);
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
// ../../packages/dalp/dapi/contract/src/routes/common/schemas/mutation.schema.ts
|
|
956
|
+
import { z as z3 } from "zod";
|
|
957
|
+
|
|
958
|
+
// ../../packages/core/validation/src/verification-type.ts
|
|
959
|
+
import { z } from "zod";
|
|
960
|
+
var verificationTypes = ["OTP", "PINCODE", "SECRET_CODES", "PASSKEY"];
|
|
961
|
+
var walletVerificationTypes = ["OTP", "PINCODE", "SECRET_CODES", "PASSKEY"];
|
|
962
|
+
var verificationType = z.enum(verificationTypes).meta({ description: "Type of verification", examples: ["OTP", "PINCODE", "SECRET_CODES"] });
|
|
963
|
+
var walletVerificationType = z.enum(walletVerificationTypes).describe("Type of verification for wallet transactions");
|
|
964
|
+
|
|
965
|
+
// ../../packages/dalp/dapi/contract/src/routes/common/schemas/user-verification.schema.ts
|
|
966
|
+
import { z as z2 } from "zod";
|
|
967
|
+
var UserVerificationSchema = z2.object({
|
|
968
|
+
secretVerificationCode: z2.string(),
|
|
969
|
+
verificationType: walletVerificationType.default("PINCODE")
|
|
970
|
+
});
|
|
971
|
+
|
|
972
|
+
// ../../packages/dalp/dapi/contract/src/routes/common/schemas/mutation.schema.ts
|
|
973
|
+
var MutationInputSchema = z3.object({
|
|
974
|
+
walletVerification: UserVerificationSchema.optional()
|
|
975
|
+
});
|
|
976
|
+
// ../../packages/dalp/dapi/contract/src/routes/common/schemas/mutation-output.schema.ts
|
|
977
|
+
import { z as z4 } from "zod";
|
|
978
|
+
var BaseMutationOutputSchema = z4.object({
|
|
979
|
+
txHash: z4.string().meta({
|
|
980
|
+
description: "The transaction hash",
|
|
981
|
+
examples: ["0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"]
|
|
982
|
+
})
|
|
983
|
+
});
|
|
984
|
+
// ../../packages/dalp/dapi/contract/src/routes/common/schemas/paginated-list.schema.ts
|
|
985
|
+
import { z as z6 } from "zod";
|
|
986
|
+
|
|
987
|
+
// ../../packages/dalp/dapi/contract/src/routes/common/schemas/sortable-list.schema.ts
|
|
988
|
+
import { z as z5 } from "zod";
|
|
989
|
+
var SortableListSchema = z5.object({
|
|
990
|
+
orderDirection: z5.enum(["asc", "desc"]).default("asc"),
|
|
991
|
+
orderBy: z5.string().default("id")
|
|
992
|
+
});
|
|
993
|
+
|
|
994
|
+
// ../../packages/dalp/dapi/contract/src/routes/common/schemas/paginated-list.schema.ts
|
|
995
|
+
var PaginatedListSchema = SortableListSchema.extend({
|
|
996
|
+
offset: z6.number().int().nonnegative().default(0),
|
|
997
|
+
limit: z6.number().int().positive().max(200).default(25)
|
|
998
|
+
});
|
|
999
|
+
// ../../packages/core/validation/src/role-requirement.ts
|
|
1000
|
+
import { z as z7 } from "zod";
|
|
1001
|
+
var RoleRequirementSchema = z7.lazy(() => z7.union([
|
|
1002
|
+
z7.string(),
|
|
1003
|
+
z7.object({
|
|
1004
|
+
any: z7.array(RoleRequirementSchema)
|
|
1005
|
+
}),
|
|
1006
|
+
z7.object({
|
|
1007
|
+
all: z7.array(RoleRequirementSchema)
|
|
1008
|
+
})
|
|
1009
|
+
]));
|
|
1010
|
+
|
|
1011
|
+
// ../../packages/dalp/dapi/contract/src/errors.ts
|
|
1012
|
+
import { oc } from "@orpc/contract";
|
|
1013
|
+
|
|
1014
|
+
// ../../node_modules/.bun/@orpc+openapi@1.13.6+50160a4e9ae07948/node_modules/@orpc/openapi/dist/shared/openapi.CoREqFh3.mjs
|
|
1015
|
+
import { isORPCErrorStatus as isORPCErrorStatus2, fallbackORPCErrorStatus, fallbackORPCErrorMessage } from "@orpc/client";
|
|
1016
|
+
import { toHttpPath as toHttpPath2 } from "@orpc/client/standard";
|
|
1017
|
+
import { fallbackContractConfig as fallbackContractConfig3, getEventIteratorSchemaDetails } from "@orpc/contract";
|
|
1018
|
+
// ../../node_modules/.bun/@orpc+openapi-client@1.13.6+460773ef8ff1e07c/node_modules/@orpc/openapi-client/dist/shared/openapi-client.Dgl8z2tb.mjs
|
|
1019
|
+
import { isSchemaIssue } from "@orpc/contract";
|
|
843
1020
|
// ../../node_modules/.bun/@orpc+openapi-client@1.13.6+460773ef8ff1e07c/node_modules/@orpc/openapi-client/dist/adapters/standard/index.mjs
|
|
844
1021
|
import"@orpc/contract";
|
|
845
1022
|
import"@orpc/client/standard";
|
|
@@ -9408,7 +9585,7 @@ var TokenDocumentConfirmUploadInputSchema = TokenReadInputSchema.extend({
|
|
|
9408
9585
|
objectKey: z201.string().min(1, "Object key is required"),
|
|
9409
9586
|
documentType: tokenDocumentType(),
|
|
9410
9587
|
fileName: z201.string().min(1, "File name is required").max(255, "File name too long"),
|
|
9411
|
-
fileSize: z201.number().int().positive("File size must be positive"),
|
|
9588
|
+
fileSize: z201.number().int().positive("File size must be positive").max(TOKEN_DOCUMENT_MAX_FILE_SIZE, "File size must be under 50MB"),
|
|
9412
9589
|
mimeType: tokenDocumentMimeType,
|
|
9413
9590
|
visibility: tokenDocumentVisibility(),
|
|
9414
9591
|
title: z201.string().max(500, "Title too long").optional(),
|
|
@@ -16109,7 +16286,7 @@ var dalpSerializers = [
|
|
|
16109
16286
|
// package.json
|
|
16110
16287
|
var package_default = {
|
|
16111
16288
|
name: "@settlemint/dalp-sdk",
|
|
16112
|
-
version: "2.1.7-main.
|
|
16289
|
+
version: "2.1.7-main.22820545676",
|
|
16113
16290
|
private: false,
|
|
16114
16291
|
description: "Fully typed SDK for the DALP tokenization platform API",
|
|
16115
16292
|
homepage: "https://settlemint.com",
|
|
@@ -16161,6 +16338,7 @@ var package_default = {
|
|
|
16161
16338
|
dependencies: {
|
|
16162
16339
|
"@orpc/client": "1.13.6",
|
|
16163
16340
|
"@orpc/contract": "1.13.6",
|
|
16341
|
+
"@orpc/openapi-client": "1.13.6",
|
|
16164
16342
|
"currency-codes": "2.2.0",
|
|
16165
16343
|
"date-fns": "4.1.0",
|
|
16166
16344
|
dnum: "2.17.0",
|
|
@@ -16193,7 +16371,7 @@ function createDalpClient(config3) {
|
|
|
16193
16371
|
organizationId,
|
|
16194
16372
|
idempotencyKey,
|
|
16195
16373
|
headers: userHeaders,
|
|
16196
|
-
requestValidation =
|
|
16374
|
+
requestValidation = false,
|
|
16197
16375
|
responseValidation = false,
|
|
16198
16376
|
fetch: customFetch
|
|
16199
16377
|
} = config3;
|
|
@@ -16218,8 +16396,8 @@ function createDalpClient(config3) {
|
|
|
16218
16396
|
if (responseValidation) {
|
|
16219
16397
|
plugins.push(new ResponseValidationPlugin(rpcContract));
|
|
16220
16398
|
}
|
|
16221
|
-
const link = new
|
|
16222
|
-
url: `${baseUrl}/api/
|
|
16399
|
+
const link = new OpenAPILink(rpcContract, {
|
|
16400
|
+
url: `${baseUrl}/api/v2`,
|
|
16223
16401
|
headers: async () => {
|
|
16224
16402
|
const defaults = {
|
|
16225
16403
|
"User-Agent": SDK_USER_AGENT
|
|
@@ -16242,8 +16420,12 @@ function createDalpClient(config3) {
|
|
|
16242
16420
|
}
|
|
16243
16421
|
return { ...defaults, ...secured };
|
|
16244
16422
|
},
|
|
16245
|
-
customJsonSerializers: dalpSerializers,
|
|
16246
16423
|
plugins,
|
|
16424
|
+
customJsonSerializers: [
|
|
16425
|
+
{ condition: bigDecimalSerializer.condition, serialize: bigDecimalSerializer.serialize },
|
|
16426
|
+
{ condition: bigIntSerializer.condition, serialize: bigIntSerializer.serialize },
|
|
16427
|
+
{ condition: timestampSerializer.condition, serialize: timestampSerializer.serialize }
|
|
16428
|
+
],
|
|
16247
16429
|
...customFetch ? { fetch: customFetch } : {}
|
|
16248
16430
|
});
|
|
16249
16431
|
return createORPCClient(link);
|
package/dist/types.d.ts
CHANGED
|
@@ -9,16 +9,21 @@
|
|
|
9
9
|
* @module
|
|
10
10
|
*/
|
|
11
11
|
import type { ContractRouterClient } from "@orpc/contract";
|
|
12
|
+
import type { JsonifiedClient } from "@orpc/openapi-client";
|
|
12
13
|
import type { rpcContract } from "./contract.js";
|
|
13
14
|
/**
|
|
14
15
|
* Fully typed DALP API client.
|
|
15
16
|
*
|
|
17
|
+
* Uses `JsonifiedClient` because the SDK communicates via the OpenAPI/REST
|
|
18
|
+
* endpoint where values are serialized as standard JSON (e.g., Date → string,
|
|
19
|
+
* BigInt → string).
|
|
20
|
+
*
|
|
16
21
|
* Provides auto-completed access to all v2 API namespaces:
|
|
17
22
|
* `account`, `actions`, `addons`, `admin`, `contacts`, `exchangeRates`,
|
|
18
23
|
* `externalToken`, `identityRecovery`, `monitoring`, `search`,
|
|
19
24
|
* `settings`, `system`, `token`, `transaction`, `user`.
|
|
20
25
|
*/
|
|
21
|
-
export type DalpClient = ContractRouterClient<typeof rpcContract
|
|
26
|
+
export type DalpClient = JsonifiedClient<ContractRouterClient<typeof rpcContract>>;
|
|
22
27
|
/**
|
|
23
28
|
* Configuration for creating a DALP API client.
|
|
24
29
|
*/
|
|
@@ -41,7 +46,7 @@ export interface DalpClientConfig {
|
|
|
41
46
|
/**
|
|
42
47
|
* Validate outgoing requests against the contract before sending.
|
|
43
48
|
* Catches schema violations client-side for faster feedback.
|
|
44
|
-
* @defaultValue
|
|
49
|
+
* @defaultValue false
|
|
45
50
|
*/
|
|
46
51
|
requestValidation?: boolean;
|
|
47
52
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@settlemint/dalp-sdk",
|
|
3
|
-
"version": "2.1.7-main.
|
|
3
|
+
"version": "2.1.7-main.22820545676",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Fully typed SDK for the DALP tokenization platform API",
|
|
6
6
|
"homepage": "https://settlemint.com",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@orpc/client": "1.13.6",
|
|
54
54
|
"@orpc/contract": "1.13.6",
|
|
55
|
+
"@orpc/openapi-client": "1.13.6",
|
|
55
56
|
"currency-codes": "2.2.0",
|
|
56
57
|
"date-fns": "4.1.0",
|
|
57
58
|
"dnum": "2.17.0",
|