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