@dakota-xyz/ts-sdk 1.0.17 → 1.2.0
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/index.d.mts +1013 -103
- package/dist/index.d.ts +1013 -103
- package/dist/index.js +557 -83
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +557 -84
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -666,6 +666,88 @@ var CustomersResource = class extends BaseResource {
|
|
|
666
666
|
path: `/customers/${customerId}`
|
|
667
667
|
});
|
|
668
668
|
}
|
|
669
|
+
/**
|
|
670
|
+
* Update the sub-client association for a customer.
|
|
671
|
+
*
|
|
672
|
+
* Associates or disassociates a customer with a sub-client.
|
|
673
|
+
* Set `sub_client_id` to associate, or set it to `null` to disassociate.
|
|
674
|
+
*
|
|
675
|
+
* @param customerId - Customer ID (KSUID)
|
|
676
|
+
* @param data - Sub-client association data
|
|
677
|
+
* @param options - Request options (e.g., custom idempotency key)
|
|
678
|
+
* @returns Updated customer record
|
|
679
|
+
*
|
|
680
|
+
* @example
|
|
681
|
+
* ```typescript
|
|
682
|
+
* // Associate customer with a sub-client
|
|
683
|
+
* const customer = await client.customers.updateSubClient('cust_abc123', {
|
|
684
|
+
* sub_client_id: 'cust_sub456',
|
|
685
|
+
* });
|
|
686
|
+
*
|
|
687
|
+
* // Disassociate customer from sub-client
|
|
688
|
+
* const customer = await client.customers.updateSubClient('cust_abc123', {
|
|
689
|
+
* sub_client_id: null,
|
|
690
|
+
* });
|
|
691
|
+
* ```
|
|
692
|
+
*/
|
|
693
|
+
async updateSubClient(customerId, data, options) {
|
|
694
|
+
return this.transport.request({
|
|
695
|
+
method: "PATCH",
|
|
696
|
+
path: `/customers/${customerId}/sub-client`,
|
|
697
|
+
body: data,
|
|
698
|
+
idempotencyKey: options?.idempotencyKey
|
|
699
|
+
});
|
|
700
|
+
}
|
|
701
|
+
/**
|
|
702
|
+
* Get a summary of all sub-clients and their associated customer counts.
|
|
703
|
+
*
|
|
704
|
+
* @returns Array of sub-client summaries
|
|
705
|
+
*
|
|
706
|
+
* @example
|
|
707
|
+
* ```typescript
|
|
708
|
+
* const summaries = await client.customers.getSubClientSummary();
|
|
709
|
+
* for (const summary of summaries) {
|
|
710
|
+
* console.log(`${summary.sub_client_name}: ${summary.customer_count} customers`);
|
|
711
|
+
* }
|
|
712
|
+
* ```
|
|
713
|
+
*/
|
|
714
|
+
async getSubClientSummary() {
|
|
715
|
+
const response = await this.transport.request({
|
|
716
|
+
method: "GET",
|
|
717
|
+
path: "/customers/sub-client-summary"
|
|
718
|
+
});
|
|
719
|
+
return response.data;
|
|
720
|
+
}
|
|
721
|
+
/**
|
|
722
|
+
* Bulk-import customers from Sumsub share tokens.
|
|
723
|
+
*
|
|
724
|
+
* Exchanges one or more Sumsub share tokens for Dakota customers + applications.
|
|
725
|
+
* The response surfaces per-token results — individual tokens can fail while
|
|
726
|
+
* others succeed.
|
|
727
|
+
*
|
|
728
|
+
* @param data - Bulk-import request containing the share tokens to redeem
|
|
729
|
+
* @param options - Request options (e.g., custom idempotency key)
|
|
730
|
+
* @returns Bulk-import summary with per-token results
|
|
731
|
+
*
|
|
732
|
+
* @example
|
|
733
|
+
* ```typescript
|
|
734
|
+
* const result = await client.customers.bulkImportFromSumsubTokens({
|
|
735
|
+
* tokens: ['_act-sbx-jwt-...', '_act-sbx-jwt-...'],
|
|
736
|
+
* });
|
|
737
|
+
* console.log(`Imported ${result.succeeded}/${result.total}`);
|
|
738
|
+
* for (const r of result.results ?? []) {
|
|
739
|
+
* if (!r.success) console.error(r.name, r.error);
|
|
740
|
+
* }
|
|
741
|
+
* ```
|
|
742
|
+
*/
|
|
743
|
+
async bulkImportFromSumsubTokens(data, options) {
|
|
744
|
+
return this.transport.request({
|
|
745
|
+
method: "POST",
|
|
746
|
+
path: "/customers/bulk-import-sumsub-tokens",
|
|
747
|
+
body: data,
|
|
748
|
+
idempotencyKey: options?.idempotencyKey
|
|
749
|
+
});
|
|
750
|
+
}
|
|
669
751
|
};
|
|
670
752
|
|
|
671
753
|
// src/client/resources/recipients.ts
|
|
@@ -750,6 +832,22 @@ var RecipientsResource = class extends BaseResource {
|
|
|
750
832
|
idempotencyKey: options?.idempotencyKey
|
|
751
833
|
});
|
|
752
834
|
}
|
|
835
|
+
/**
|
|
836
|
+
* Delete a recipient.
|
|
837
|
+
*
|
|
838
|
+
* @param recipientId - Recipient ID
|
|
839
|
+
*
|
|
840
|
+
* @example
|
|
841
|
+
* ```typescript
|
|
842
|
+
* await client.recipients.delete(recipientId);
|
|
843
|
+
* ```
|
|
844
|
+
*/
|
|
845
|
+
async delete(recipientId) {
|
|
846
|
+
await this.transport.request({
|
|
847
|
+
method: "DELETE",
|
|
848
|
+
path: `/recipients/${recipientId}`
|
|
849
|
+
});
|
|
850
|
+
}
|
|
753
851
|
};
|
|
754
852
|
|
|
755
853
|
// src/client/resources/destinations.ts
|
|
@@ -812,6 +910,23 @@ var DestinationsResource = class extends BaseResource {
|
|
|
812
910
|
(item) => item.destination_id
|
|
813
911
|
);
|
|
814
912
|
}
|
|
913
|
+
/**
|
|
914
|
+
* Delete a destination.
|
|
915
|
+
*
|
|
916
|
+
* @param recipientId - Recipient ID
|
|
917
|
+
* @param destinationId - Destination ID
|
|
918
|
+
*
|
|
919
|
+
* @example
|
|
920
|
+
* ```typescript
|
|
921
|
+
* await client.destinations.delete(recipientId, destinationId);
|
|
922
|
+
* ```
|
|
923
|
+
*/
|
|
924
|
+
async delete(recipientId, destinationId) {
|
|
925
|
+
await this.transport.request({
|
|
926
|
+
method: "DELETE",
|
|
927
|
+
path: `/recipients/${recipientId}/destinations/${destinationId}`
|
|
928
|
+
});
|
|
929
|
+
}
|
|
815
930
|
};
|
|
816
931
|
|
|
817
932
|
// src/client/resources/accounts.ts
|
|
@@ -921,6 +1036,22 @@ var AccountsResource = class extends BaseResource {
|
|
|
921
1036
|
idempotencyKey: options?.idempotencyKey
|
|
922
1037
|
});
|
|
923
1038
|
}
|
|
1039
|
+
/**
|
|
1040
|
+
* Delete an account.
|
|
1041
|
+
*
|
|
1042
|
+
* @param accountId - Account ID
|
|
1043
|
+
*
|
|
1044
|
+
* @example
|
|
1045
|
+
* ```typescript
|
|
1046
|
+
* await client.accounts.delete(accountId);
|
|
1047
|
+
* ```
|
|
1048
|
+
*/
|
|
1049
|
+
async delete(accountId) {
|
|
1050
|
+
await this.transport.request({
|
|
1051
|
+
method: "DELETE",
|
|
1052
|
+
path: `/accounts/${accountId}`
|
|
1053
|
+
});
|
|
1054
|
+
}
|
|
924
1055
|
};
|
|
925
1056
|
|
|
926
1057
|
// src/client/resources/transactions.ts
|
|
@@ -1154,23 +1285,6 @@ var EventsResource = class extends BaseResource {
|
|
|
1154
1285
|
list(params) {
|
|
1155
1286
|
return this.paginate("/events", params);
|
|
1156
1287
|
}
|
|
1157
|
-
/**
|
|
1158
|
-
* Get an event by ID.
|
|
1159
|
-
*
|
|
1160
|
-
* @param eventId - Event ID
|
|
1161
|
-
* @returns Event record
|
|
1162
|
-
*
|
|
1163
|
-
* @example
|
|
1164
|
-
* ```typescript
|
|
1165
|
-
* const event = await client.events.get(eventId);
|
|
1166
|
-
* ```
|
|
1167
|
-
*/
|
|
1168
|
-
async get(eventId) {
|
|
1169
|
-
return this.transport.request({
|
|
1170
|
-
method: "GET",
|
|
1171
|
-
path: `/events/${eventId}`
|
|
1172
|
-
});
|
|
1173
|
-
}
|
|
1174
1288
|
};
|
|
1175
1289
|
|
|
1176
1290
|
// src/client/resources/applications.ts
|
|
@@ -1211,58 +1325,78 @@ var ApplicationsResource = class extends BaseResource {
|
|
|
1211
1325
|
idempotencyKey: options?.idempotencyKey
|
|
1212
1326
|
});
|
|
1213
1327
|
}
|
|
1328
|
+
// ==========================================================================
|
|
1329
|
+
// Business Details
|
|
1330
|
+
// ==========================================================================
|
|
1214
1331
|
/**
|
|
1215
|
-
*
|
|
1332
|
+
* Update business details for an application.
|
|
1333
|
+
*
|
|
1334
|
+
* Uses PUT (full replace) per the OpenAPI spec.
|
|
1216
1335
|
*
|
|
1217
1336
|
* @param applicationId - Application ID
|
|
1218
|
-
* @param
|
|
1219
|
-
* @returns
|
|
1337
|
+
* @param data - Business details (full BusinessApplicationCreateRequest)
|
|
1338
|
+
* @returns Updated business details with application context
|
|
1220
1339
|
*/
|
|
1221
|
-
|
|
1222
|
-
return this.
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1340
|
+
async updateBusinessDetails(applicationId, data, options) {
|
|
1341
|
+
return this.transport.request({
|
|
1342
|
+
method: "PUT",
|
|
1343
|
+
path: `/applications/${applicationId}/business-details`,
|
|
1344
|
+
body: data,
|
|
1345
|
+
idempotencyKey: options?.idempotencyKey
|
|
1346
|
+
});
|
|
1226
1347
|
}
|
|
1348
|
+
// ==========================================================================
|
|
1349
|
+
// Individual Details (non-business applications)
|
|
1350
|
+
// ==========================================================================
|
|
1227
1351
|
/**
|
|
1228
|
-
*
|
|
1352
|
+
* Update individual details for a non-business application.
|
|
1353
|
+
*
|
|
1354
|
+
* Uses PUT (full replace) per the OpenAPI spec. Only callable when the
|
|
1355
|
+
* application status is 'pending'.
|
|
1229
1356
|
*
|
|
1230
1357
|
* @param applicationId - Application ID
|
|
1231
|
-
* @param data - Individual
|
|
1232
|
-
* @returns
|
|
1358
|
+
* @param data - Individual details (full IndividualRequest)
|
|
1359
|
+
* @returns Updated individual details with application context
|
|
1233
1360
|
*/
|
|
1234
|
-
async
|
|
1361
|
+
async updateIndividualDetails(applicationId, data, options) {
|
|
1235
1362
|
return this.transport.request({
|
|
1236
|
-
method: "
|
|
1237
|
-
path: `/applications/${applicationId}/
|
|
1363
|
+
method: "PUT",
|
|
1364
|
+
path: `/applications/${applicationId}/individual-details`,
|
|
1238
1365
|
body: data,
|
|
1239
1366
|
idempotencyKey: options?.idempotencyKey
|
|
1240
1367
|
});
|
|
1241
1368
|
}
|
|
1369
|
+
// ==========================================================================
|
|
1370
|
+
// Associated Individuals
|
|
1371
|
+
// ==========================================================================
|
|
1242
1372
|
/**
|
|
1243
|
-
*
|
|
1373
|
+
* Add an associated individual to an application.
|
|
1244
1374
|
*
|
|
1245
1375
|
* @param applicationId - Application ID
|
|
1246
|
-
* @param
|
|
1247
|
-
* @returns
|
|
1376
|
+
* @param data - Individual data
|
|
1377
|
+
* @returns Created individual
|
|
1248
1378
|
*/
|
|
1249
|
-
async
|
|
1379
|
+
async addIndividual(applicationId, data, options) {
|
|
1250
1380
|
return this.transport.request({
|
|
1251
|
-
method: "
|
|
1252
|
-
path: `/applications/${applicationId}/associated-individuals
|
|
1381
|
+
method: "POST",
|
|
1382
|
+
path: `/applications/${applicationId}/associated-individuals`,
|
|
1383
|
+
body: data,
|
|
1384
|
+
idempotencyKey: options?.idempotencyKey
|
|
1253
1385
|
});
|
|
1254
1386
|
}
|
|
1255
1387
|
/**
|
|
1256
1388
|
* Update an associated individual.
|
|
1257
1389
|
*
|
|
1390
|
+
* Uses PUT (full replace) per the OpenAPI spec.
|
|
1391
|
+
*
|
|
1258
1392
|
* @param applicationId - Application ID
|
|
1259
1393
|
* @param individualId - Individual ID
|
|
1260
|
-
* @param data -
|
|
1394
|
+
* @param data - Full individual data (replaces existing)
|
|
1261
1395
|
* @returns Updated individual
|
|
1262
1396
|
*/
|
|
1263
1397
|
async updateIndividual(applicationId, individualId, data, options) {
|
|
1264
1398
|
return this.transport.request({
|
|
1265
|
-
method: "
|
|
1399
|
+
method: "PUT",
|
|
1266
1400
|
path: `/applications/${applicationId}/associated-individuals/${individualId}`,
|
|
1267
1401
|
body: data,
|
|
1268
1402
|
idempotencyKey: options?.idempotencyKey
|
|
@@ -1280,27 +1414,145 @@ var ApplicationsResource = class extends BaseResource {
|
|
|
1280
1414
|
path: `/applications/${applicationId}/associated-individuals/${individualId}`
|
|
1281
1415
|
});
|
|
1282
1416
|
}
|
|
1417
|
+
// ==========================================================================
|
|
1418
|
+
// Attestations
|
|
1419
|
+
// ==========================================================================
|
|
1283
1420
|
/**
|
|
1284
|
-
*
|
|
1421
|
+
* Submit an attestation for an application.
|
|
1285
1422
|
*
|
|
1286
1423
|
* @param applicationId - Application ID
|
|
1287
|
-
* @param data -
|
|
1288
|
-
* @returns Updated application
|
|
1424
|
+
* @param data - Attestation data (type, timestamp, applicant_id)
|
|
1289
1425
|
*/
|
|
1290
|
-
async
|
|
1426
|
+
async submitAttestation(applicationId, data, options) {
|
|
1427
|
+
await this.transport.request({
|
|
1428
|
+
method: "POST",
|
|
1429
|
+
path: `/applications/${applicationId}/attestations`,
|
|
1430
|
+
body: data,
|
|
1431
|
+
idempotencyKey: options?.idempotencyKey
|
|
1432
|
+
});
|
|
1433
|
+
}
|
|
1434
|
+
// ==========================================================================
|
|
1435
|
+
// Enhanced Due Diligence (EDD)
|
|
1436
|
+
// ==========================================================================
|
|
1437
|
+
/**
|
|
1438
|
+
* Get the EDD record for an application.
|
|
1439
|
+
*
|
|
1440
|
+
* @param applicationId - Application ID
|
|
1441
|
+
* @returns EDD record with application context
|
|
1442
|
+
*/
|
|
1443
|
+
async getEDD(applicationId) {
|
|
1291
1444
|
return this.transport.request({
|
|
1292
|
-
method: "
|
|
1293
|
-
path: `/applications/${applicationId}/
|
|
1445
|
+
method: "GET",
|
|
1446
|
+
path: `/applications/${applicationId}/edd`
|
|
1447
|
+
});
|
|
1448
|
+
}
|
|
1449
|
+
/**
|
|
1450
|
+
* Create or update the EDD record for an application.
|
|
1451
|
+
*
|
|
1452
|
+
* This endpoint is idempotent (uses PUT).
|
|
1453
|
+
*
|
|
1454
|
+
* @param applicationId - Application ID
|
|
1455
|
+
* @param data - EDD data
|
|
1456
|
+
* @returns Updated EDD record with application context
|
|
1457
|
+
*/
|
|
1458
|
+
async createOrUpdateEDD(applicationId, data, options) {
|
|
1459
|
+
return this.transport.request({
|
|
1460
|
+
method: "PUT",
|
|
1461
|
+
path: `/applications/${applicationId}/edd`,
|
|
1294
1462
|
body: data,
|
|
1295
1463
|
idempotencyKey: options?.idempotencyKey
|
|
1296
1464
|
});
|
|
1297
1465
|
}
|
|
1466
|
+
// ==========================================================================
|
|
1467
|
+
// Application Documents
|
|
1468
|
+
// ==========================================================================
|
|
1298
1469
|
/**
|
|
1299
|
-
*
|
|
1470
|
+
* Upload an application document using base64-encoded content.
|
|
1471
|
+
*
|
|
1472
|
+
* For files larger than 20MB, use {@link getDocumentUploadUrl} and upload
|
|
1473
|
+
* directly to cloud storage, then call {@link verifyDocument}.
|
|
1474
|
+
*
|
|
1475
|
+
* @param applicationId - Application ID
|
|
1476
|
+
* @param data - Document data including base64 content
|
|
1477
|
+
* @returns Document upload response with document_id
|
|
1478
|
+
*/
|
|
1479
|
+
async createDocument(applicationId, data, options) {
|
|
1480
|
+
return this.transport.request({
|
|
1481
|
+
method: "POST",
|
|
1482
|
+
path: `/applications/${applicationId}/documents`,
|
|
1483
|
+
body: data,
|
|
1484
|
+
idempotencyKey: options?.idempotencyKey
|
|
1485
|
+
});
|
|
1486
|
+
}
|
|
1487
|
+
/**
|
|
1488
|
+
* List documents for an application.
|
|
1489
|
+
*
|
|
1490
|
+
* Supports filtering by category and document type.
|
|
1491
|
+
*
|
|
1492
|
+
* @param applicationId - Application ID
|
|
1493
|
+
* @param params - Pagination and filter parameters
|
|
1494
|
+
* @returns Paginated iterator of document metadata
|
|
1495
|
+
*/
|
|
1496
|
+
listDocuments(applicationId, params) {
|
|
1497
|
+
return this.paginate(
|
|
1498
|
+
`/applications/${applicationId}/documents`,
|
|
1499
|
+
params
|
|
1500
|
+
);
|
|
1501
|
+
}
|
|
1502
|
+
/**
|
|
1503
|
+
* Download/get a document by ID.
|
|
1504
|
+
*
|
|
1505
|
+
* @param applicationId - Application ID
|
|
1506
|
+
* @param documentId - Document ID
|
|
1507
|
+
* @returns Document content (binary)
|
|
1508
|
+
*/
|
|
1509
|
+
async getDocument(applicationId, documentId) {
|
|
1510
|
+
return this.transport.request({
|
|
1511
|
+
method: "GET",
|
|
1512
|
+
path: `/applications/${applicationId}/documents/${documentId}`
|
|
1513
|
+
});
|
|
1514
|
+
}
|
|
1515
|
+
/**
|
|
1516
|
+
* Delete a document from a pending application.
|
|
1517
|
+
*
|
|
1518
|
+
* Only documents from applications in 'pending' status can be deleted.
|
|
1519
|
+
*
|
|
1520
|
+
* @param applicationId - Application ID
|
|
1521
|
+
* @param documentId - Document ID
|
|
1522
|
+
*/
|
|
1523
|
+
async deleteDocument(applicationId, documentId) {
|
|
1524
|
+
await this.transport.request({
|
|
1525
|
+
method: "DELETE",
|
|
1526
|
+
path: `/applications/${applicationId}/documents/${documentId}`
|
|
1527
|
+
});
|
|
1528
|
+
}
|
|
1529
|
+
/**
|
|
1530
|
+
* Verify a document uploaded via presigned URL.
|
|
1531
|
+
*
|
|
1532
|
+
* After uploading a file to the presigned URL from {@link getDocumentUploadUrl},
|
|
1533
|
+
* call this endpoint to register and verify the upload.
|
|
1534
|
+
*
|
|
1535
|
+
* @param applicationId - Application ID
|
|
1536
|
+
* @param documentId - The upload_id from the presigned URL response
|
|
1537
|
+
* @returns Document upload response with document_id
|
|
1538
|
+
*/
|
|
1539
|
+
async verifyDocument(applicationId, documentId, _data, options) {
|
|
1540
|
+
return this.transport.request({
|
|
1541
|
+
method: "POST",
|
|
1542
|
+
path: `/applications/${applicationId}/documents/${documentId}/verifications`,
|
|
1543
|
+
body: _data ?? {},
|
|
1544
|
+
idempotencyKey: options?.idempotencyKey
|
|
1545
|
+
});
|
|
1546
|
+
}
|
|
1547
|
+
/**
|
|
1548
|
+
* Get a presigned upload URL for an application document.
|
|
1549
|
+
*
|
|
1550
|
+
* Use this for files larger than 20MB. Upload the file directly to the
|
|
1551
|
+
* returned URL, then call {@link verifyDocument} to register it.
|
|
1300
1552
|
*
|
|
1301
1553
|
* @param applicationId - Application ID
|
|
1302
1554
|
* @param data - Document metadata
|
|
1303
|
-
* @returns Upload URL and
|
|
1555
|
+
* @returns Upload URL and upload ID
|
|
1304
1556
|
*/
|
|
1305
1557
|
async getDocumentUploadUrl(applicationId, data, options) {
|
|
1306
1558
|
return this.transport.request({
|
|
@@ -1310,6 +1562,48 @@ var ApplicationsResource = class extends BaseResource {
|
|
|
1310
1562
|
idempotencyKey: options?.idempotencyKey
|
|
1311
1563
|
});
|
|
1312
1564
|
}
|
|
1565
|
+
// ==========================================================================
|
|
1566
|
+
// Individual Documents
|
|
1567
|
+
// ==========================================================================
|
|
1568
|
+
/**
|
|
1569
|
+
* Upload a document for an associated individual using base64-encoded content.
|
|
1570
|
+
*
|
|
1571
|
+
* Supports identity documents (passport, driver's license, residence permit)
|
|
1572
|
+
* and EDD documents (bank statement, etc.). For files larger than 10MB, use
|
|
1573
|
+
* {@link getIndividualDocumentUploadUrl} instead.
|
|
1574
|
+
*
|
|
1575
|
+
* @param applicationId - Application ID
|
|
1576
|
+
* @param individualId - Individual ID
|
|
1577
|
+
* @param data - Document data including base64 content
|
|
1578
|
+
* @returns Document upload response with document_id
|
|
1579
|
+
*/
|
|
1580
|
+
async uploadIndividualDocument(applicationId, individualId, data, options) {
|
|
1581
|
+
return this.transport.request({
|
|
1582
|
+
method: "POST",
|
|
1583
|
+
path: `/applications/${applicationId}/associated-individuals/${individualId}/documents`,
|
|
1584
|
+
body: data,
|
|
1585
|
+
idempotencyKey: options?.idempotencyKey
|
|
1586
|
+
});
|
|
1587
|
+
}
|
|
1588
|
+
/**
|
|
1589
|
+
* Get a presigned upload URL for an individual document.
|
|
1590
|
+
*
|
|
1591
|
+
* Use this for files larger than 10MB. Upload the file directly to the
|
|
1592
|
+
* returned URL.
|
|
1593
|
+
*
|
|
1594
|
+
* @param applicationId - Application ID
|
|
1595
|
+
* @param individualId - Individual ID
|
|
1596
|
+
* @param data - Document metadata
|
|
1597
|
+
* @returns Upload URL and upload ID
|
|
1598
|
+
*/
|
|
1599
|
+
async getIndividualDocumentUploadUrl(applicationId, individualId, data, options) {
|
|
1600
|
+
return this.transport.request({
|
|
1601
|
+
method: "POST",
|
|
1602
|
+
path: `/applications/${applicationId}/associated-individuals/${individualId}/document-uploads`,
|
|
1603
|
+
body: data,
|
|
1604
|
+
idempotencyKey: options?.idempotencyKey
|
|
1605
|
+
});
|
|
1606
|
+
}
|
|
1313
1607
|
};
|
|
1314
1608
|
|
|
1315
1609
|
// src/client/resources/policies.ts
|
|
@@ -1519,27 +1813,31 @@ var SignerGroupsResource = class extends BaseResource {
|
|
|
1519
1813
|
path: `/wallets/${walletId}/signer-groups/${signerGroupId}`
|
|
1520
1814
|
});
|
|
1521
1815
|
}
|
|
1522
|
-
};
|
|
1523
|
-
var SignersResource = class extends BaseResource {
|
|
1524
1816
|
/**
|
|
1525
|
-
* List
|
|
1817
|
+
* List signer groups attached to a wallet.
|
|
1526
1818
|
*
|
|
1819
|
+
* @param walletId - Wallet ID
|
|
1527
1820
|
* @param params - Pagination parameters
|
|
1528
|
-
* @returns Async iterator of
|
|
1821
|
+
* @returns Async iterator of signer groups
|
|
1529
1822
|
*/
|
|
1530
|
-
|
|
1531
|
-
return this.paginate(
|
|
1823
|
+
listForWallet(walletId, params) {
|
|
1824
|
+
return this.paginate(`/wallets/${walletId}/signer-groups`, params);
|
|
1532
1825
|
}
|
|
1826
|
+
};
|
|
1827
|
+
var SignersResource = class extends BaseResource {
|
|
1533
1828
|
/**
|
|
1534
|
-
*
|
|
1829
|
+
* Create a new signer.
|
|
1535
1830
|
*
|
|
1536
|
-
* @param
|
|
1537
|
-
* @
|
|
1831
|
+
* @param data - Signer creation data (name, public_key, key_type)
|
|
1832
|
+
* @param options - Request options
|
|
1833
|
+
* @returns Created signer
|
|
1538
1834
|
*/
|
|
1539
|
-
async
|
|
1835
|
+
async create(data, options) {
|
|
1540
1836
|
return this.transport.request({
|
|
1541
|
-
method: "
|
|
1542
|
-
path:
|
|
1837
|
+
method: "POST",
|
|
1838
|
+
path: "/signers",
|
|
1839
|
+
body: data,
|
|
1840
|
+
idempotencyKey: options?.idempotencyKey
|
|
1543
1841
|
});
|
|
1544
1842
|
}
|
|
1545
1843
|
/**
|
|
@@ -1593,6 +1891,34 @@ var ApiKeysResource = class extends BaseResource {
|
|
|
1593
1891
|
path: `/api-keys/${apiKeyId}`
|
|
1594
1892
|
});
|
|
1595
1893
|
}
|
|
1894
|
+
/**
|
|
1895
|
+
* Delete all API keys.
|
|
1896
|
+
*
|
|
1897
|
+
* Intended for incident response only.
|
|
1898
|
+
*/
|
|
1899
|
+
async deleteAll() {
|
|
1900
|
+
await this.transport.request({
|
|
1901
|
+
method: "DELETE",
|
|
1902
|
+
path: "/api-keys"
|
|
1903
|
+
});
|
|
1904
|
+
}
|
|
1905
|
+
/**
|
|
1906
|
+
* Create an API key for a specific client (admin only).
|
|
1907
|
+
*
|
|
1908
|
+
* Requires admin access token.
|
|
1909
|
+
*
|
|
1910
|
+
* @param data - Request data containing `client_id`
|
|
1911
|
+
* @param options - Request options
|
|
1912
|
+
* @returns Created API key response (includes key, only shown once)
|
|
1913
|
+
*/
|
|
1914
|
+
async createForClient(data, options) {
|
|
1915
|
+
return this.transport.request({
|
|
1916
|
+
method: "POST",
|
|
1917
|
+
path: "/api-keys/admin",
|
|
1918
|
+
body: data,
|
|
1919
|
+
idempotencyKey: options?.idempotencyKey
|
|
1920
|
+
});
|
|
1921
|
+
}
|
|
1596
1922
|
};
|
|
1597
1923
|
|
|
1598
1924
|
// src/client/resources/users.ts
|
|
@@ -1620,27 +1946,14 @@ var UsersResource = class extends BaseResource {
|
|
|
1620
1946
|
list(params) {
|
|
1621
1947
|
return this.paginate("/users", params);
|
|
1622
1948
|
}
|
|
1623
|
-
/**
|
|
1624
|
-
* Get a user by ID.
|
|
1625
|
-
*
|
|
1626
|
-
* @param userId - User ID
|
|
1627
|
-
* @returns User record
|
|
1628
|
-
*/
|
|
1629
|
-
async get(userId) {
|
|
1630
|
-
return this.transport.request({
|
|
1631
|
-
method: "GET",
|
|
1632
|
-
path: `/users/${userId}`
|
|
1633
|
-
});
|
|
1634
|
-
}
|
|
1635
1949
|
/**
|
|
1636
1950
|
* Update a user.
|
|
1637
1951
|
*
|
|
1638
1952
|
* @param userId - User ID
|
|
1639
|
-
* @param data - Update data
|
|
1640
|
-
* @returns Updated user
|
|
1953
|
+
* @param data - Update data (first_name, last_name, role)
|
|
1641
1954
|
*/
|
|
1642
1955
|
async update(userId, data, options) {
|
|
1643
|
-
|
|
1956
|
+
await this.transport.request({
|
|
1644
1957
|
method: "PATCH",
|
|
1645
1958
|
path: `/users/${userId}`,
|
|
1646
1959
|
body: data,
|
|
@@ -1724,13 +2037,42 @@ var WebhooksResource = class extends BaseResource {
|
|
|
1724
2037
|
});
|
|
1725
2038
|
}
|
|
1726
2039
|
/**
|
|
1727
|
-
* List webhook
|
|
2040
|
+
* List webhook delivery history.
|
|
1728
2041
|
*
|
|
1729
|
-
*
|
|
1730
|
-
*
|
|
2042
|
+
* Note: This endpoint uses cursor-based pagination (`cursor`/`has_more`) instead
|
|
2043
|
+
* of the standard `starting_after`/`has_more_after` format. Because of this,
|
|
2044
|
+
* it returns the raw response rather than a `PaginatedIterator`. Use the `cursor`
|
|
2045
|
+
* field from the response to fetch subsequent pages.
|
|
2046
|
+
*
|
|
2047
|
+
* @param params - Webhook history query parameters
|
|
2048
|
+
* @returns Webhook history response with `data`, `has_more`, and `cursor`
|
|
2049
|
+
*
|
|
2050
|
+
* @example
|
|
2051
|
+
* ```typescript
|
|
2052
|
+
* let cursor: string | undefined;
|
|
2053
|
+
* do {
|
|
2054
|
+
* const page = await client.webhooks.listEvents({ limit: 50, cursor });
|
|
2055
|
+
* for (const event of page.data) {
|
|
2056
|
+
* console.log(event);
|
|
2057
|
+
* }
|
|
2058
|
+
* cursor = page.cursor ?? undefined;
|
|
2059
|
+
* } while (page.has_more);
|
|
2060
|
+
* ```
|
|
1731
2061
|
*/
|
|
1732
|
-
listEvents(params) {
|
|
1733
|
-
|
|
2062
|
+
async listEvents(params) {
|
|
2063
|
+
const query = {};
|
|
2064
|
+
if (params) {
|
|
2065
|
+
for (const [key, value] of Object.entries(params)) {
|
|
2066
|
+
if (value !== void 0) {
|
|
2067
|
+
query[key] = value;
|
|
2068
|
+
}
|
|
2069
|
+
}
|
|
2070
|
+
}
|
|
2071
|
+
return this.transport.request({
|
|
2072
|
+
method: "GET",
|
|
2073
|
+
path: "/webhooks",
|
|
2074
|
+
query
|
|
2075
|
+
});
|
|
1734
2076
|
}
|
|
1735
2077
|
/**
|
|
1736
2078
|
* Get a webhook event by ID.
|
|
@@ -1747,10 +2089,14 @@ var WebhooksResource = class extends BaseResource {
|
|
|
1747
2089
|
/**
|
|
1748
2090
|
* Replay a webhook event.
|
|
1749
2091
|
*
|
|
2092
|
+
* Re-queues the webhook for delivery to all configured targets.
|
|
2093
|
+
*
|
|
1750
2094
|
* @param eventId - Webhook event ID
|
|
2095
|
+
* @param options - Request options
|
|
2096
|
+
* @returns Replay response with `webhook_id`, `status`, and `replayed_to_count`
|
|
1751
2097
|
*/
|
|
1752
2098
|
async replayEvent(eventId, options) {
|
|
1753
|
-
|
|
2099
|
+
return this.transport.request({
|
|
1754
2100
|
method: "POST",
|
|
1755
2101
|
path: `/webhooks/events/${eventId}/replay`,
|
|
1756
2102
|
idempotencyKey: options?.idempotencyKey
|
|
@@ -1875,9 +2221,10 @@ var SandboxResource = class extends BaseResource {
|
|
|
1875
2221
|
* Drives KYB, KYC, or applicant account status through a sandbox transition
|
|
1876
2222
|
* without waiting for real compliance review.
|
|
1877
2223
|
*
|
|
1878
|
-
* **Important:**
|
|
1879
|
-
*
|
|
1880
|
-
*
|
|
2224
|
+
* **Important:** Use `kyb_approve` to fully approve any customer type (individual or
|
|
2225
|
+
* business). This triggers the complete onboarding flow including endorsement and
|
|
2226
|
+
* recipient creation. The `kyc_*` types only update the individual applicant's KYC
|
|
2227
|
+
* application status without triggering the full onboarding flow.
|
|
1881
2228
|
*
|
|
1882
2229
|
* @param data - Simulation request data
|
|
1883
2230
|
* @returns Simulation response with previous and new state
|
|
@@ -1987,6 +2334,129 @@ var SandboxResource = class extends BaseResource {
|
|
|
1987
2334
|
}
|
|
1988
2335
|
};
|
|
1989
2336
|
|
|
2337
|
+
// src/client/resources/self-serve.ts
|
|
2338
|
+
var SelfServeResource = class extends BaseResource {
|
|
2339
|
+
/**
|
|
2340
|
+
* Purchase self-serve credits.
|
|
2341
|
+
*
|
|
2342
|
+
* Creates a Stripe checkout session for purchasing credits at the specified tier.
|
|
2343
|
+
*
|
|
2344
|
+
* @param data - Purchase request with the tier price
|
|
2345
|
+
* @param options - Optional request options (e.g., idempotency key)
|
|
2346
|
+
* @returns Response containing the Stripe checkout URL
|
|
2347
|
+
*
|
|
2348
|
+
* @example
|
|
2349
|
+
* ```typescript
|
|
2350
|
+
* const { checkout_url } = await client.selfServe.purchaseCredits({
|
|
2351
|
+
* tier_price_cents: 10000,
|
|
2352
|
+
* });
|
|
2353
|
+
* // Redirect user to checkout_url
|
|
2354
|
+
* ```
|
|
2355
|
+
*/
|
|
2356
|
+
async purchaseCredits(data, options) {
|
|
2357
|
+
return this.transport.request({
|
|
2358
|
+
method: "POST",
|
|
2359
|
+
path: "/self-serve/credits/purchase",
|
|
2360
|
+
body: data,
|
|
2361
|
+
idempotencyKey: options?.idempotencyKey
|
|
2362
|
+
});
|
|
2363
|
+
}
|
|
2364
|
+
/**
|
|
2365
|
+
* Get current credits balance.
|
|
2366
|
+
*
|
|
2367
|
+
* @returns The current balance and transfer capacity in cents
|
|
2368
|
+
*
|
|
2369
|
+
* @example
|
|
2370
|
+
* ```typescript
|
|
2371
|
+
* const balance = await client.selfServe.getBalance();
|
|
2372
|
+
* console.log(`Balance: $${balance.balance_cents / 100}`);
|
|
2373
|
+
* console.log(`Transfer capacity: $${balance.transfer_capacity_cents / 100}`);
|
|
2374
|
+
* ```
|
|
2375
|
+
*/
|
|
2376
|
+
async getBalance() {
|
|
2377
|
+
return this.transport.request({
|
|
2378
|
+
method: "GET",
|
|
2379
|
+
path: "/self-serve/credits/balance"
|
|
2380
|
+
});
|
|
2381
|
+
}
|
|
2382
|
+
/**
|
|
2383
|
+
* List credits ledger entries.
|
|
2384
|
+
*
|
|
2385
|
+
* Returns a cursor-paginated list of ledger entries (purchases, deductions, refunds).
|
|
2386
|
+
*
|
|
2387
|
+
* @param params - Optional query parameters for filtering and pagination
|
|
2388
|
+
* @returns Ledger response with entries and has_more flag
|
|
2389
|
+
*
|
|
2390
|
+
* @example
|
|
2391
|
+
* ```typescript
|
|
2392
|
+
* // Get recent ledger entries
|
|
2393
|
+
* const ledger = await client.selfServe.listLedger();
|
|
2394
|
+
* for (const entry of ledger.entries) {
|
|
2395
|
+
* console.log(entry.entry_type, entry.amount_cents, entry.description);
|
|
2396
|
+
* }
|
|
2397
|
+
*
|
|
2398
|
+
* // Filter by type with pagination
|
|
2399
|
+
* const purchases = await client.selfServe.listLedger({
|
|
2400
|
+
* type: 'purchase',
|
|
2401
|
+
* limit: 50,
|
|
2402
|
+
* });
|
|
2403
|
+
* ```
|
|
2404
|
+
*/
|
|
2405
|
+
async listLedger(params) {
|
|
2406
|
+
const query = {};
|
|
2407
|
+
if (params?.cursor !== void 0) query.cursor = params.cursor;
|
|
2408
|
+
if (params?.limit !== void 0) query.limit = params.limit;
|
|
2409
|
+
if (params?.type !== void 0) query.type = params.type;
|
|
2410
|
+
return this.transport.request({
|
|
2411
|
+
method: "GET",
|
|
2412
|
+
path: "/self-serve/credits/ledger",
|
|
2413
|
+
query
|
|
2414
|
+
});
|
|
2415
|
+
}
|
|
2416
|
+
/**
|
|
2417
|
+
* List available credit tiers.
|
|
2418
|
+
*
|
|
2419
|
+
* Returns all available pricing tiers for purchasing credits.
|
|
2420
|
+
*
|
|
2421
|
+
* @returns Response containing the list of available tiers
|
|
2422
|
+
*
|
|
2423
|
+
* @example
|
|
2424
|
+
* ```typescript
|
|
2425
|
+
* const { tiers } = await client.selfServe.listTiers();
|
|
2426
|
+
* for (const tier of tiers) {
|
|
2427
|
+
* console.log(`$${tier.price_cents / 100} → $${tier.transfer_capacity_cents / 100} capacity`);
|
|
2428
|
+
* }
|
|
2429
|
+
* ```
|
|
2430
|
+
*/
|
|
2431
|
+
async listTiers() {
|
|
2432
|
+
return this.transport.request({
|
|
2433
|
+
method: "GET",
|
|
2434
|
+
path: "/self-serve/credits/tiers"
|
|
2435
|
+
});
|
|
2436
|
+
}
|
|
2437
|
+
/**
|
|
2438
|
+
* Get the self-serve client's pricing config (fee schedule).
|
|
2439
|
+
*
|
|
2440
|
+
* Returns the caller's current `ClientPricingConfig` — transfer/ACH/wire/SEPA/SWIFT/KYC/KYB
|
|
2441
|
+
* fees plus the monthly minimum. Self-serve clients only.
|
|
2442
|
+
*
|
|
2443
|
+
* @returns The current pricing configuration
|
|
2444
|
+
*
|
|
2445
|
+
* @example
|
|
2446
|
+
* ```typescript
|
|
2447
|
+
* const pricing = await client.selfServe.getPricing();
|
|
2448
|
+
* console.log(`ACH fee: ${pricing.achFeeCents} cents`);
|
|
2449
|
+
* console.log(`Wire fee: ${pricing.wireFeeCents} cents`);
|
|
2450
|
+
* ```
|
|
2451
|
+
*/
|
|
2452
|
+
async getPricing() {
|
|
2453
|
+
return this.transport.request({
|
|
2454
|
+
method: "GET",
|
|
2455
|
+
path: "/self-serve/credits/pricing"
|
|
2456
|
+
});
|
|
2457
|
+
}
|
|
2458
|
+
};
|
|
2459
|
+
|
|
1990
2460
|
// src/client/client.ts
|
|
1991
2461
|
var DakotaClient = class {
|
|
1992
2462
|
config;
|
|
@@ -2026,6 +2496,8 @@ var DakotaClient = class {
|
|
|
2026
2496
|
info;
|
|
2027
2497
|
/** Sandbox API - testing simulations (sandbox only) */
|
|
2028
2498
|
sandbox;
|
|
2499
|
+
/** Self-Serve Credits API - manage prepaid transfer credits */
|
|
2500
|
+
selfServe;
|
|
2029
2501
|
/**
|
|
2030
2502
|
* Create a new Dakota client.
|
|
2031
2503
|
*
|
|
@@ -2078,6 +2550,7 @@ var DakotaClient = class {
|
|
|
2078
2550
|
this.webhooks = new WebhooksResource(this.transport);
|
|
2079
2551
|
this.info = new InfoResource(this.transport);
|
|
2080
2552
|
this.sandbox = new SandboxResource(this.transport);
|
|
2553
|
+
this.selfServe = new SelfServeResource(this.transport);
|
|
2081
2554
|
}
|
|
2082
2555
|
/**
|
|
2083
2556
|
* Get the resolved base URL.
|
|
@@ -2105,6 +2578,7 @@ exports.PaginatedIterator = PaginatedIterator;
|
|
|
2105
2578
|
exports.PoliciesResource = PoliciesResource;
|
|
2106
2579
|
exports.RecipientsResource = RecipientsResource;
|
|
2107
2580
|
exports.SandboxResource = SandboxResource;
|
|
2581
|
+
exports.SelfServeResource = SelfServeResource;
|
|
2108
2582
|
exports.SignerGroupsResource = SignerGroupsResource;
|
|
2109
2583
|
exports.SignersResource = SignersResource;
|
|
2110
2584
|
exports.TransactionsResource = TransactionsResource;
|