@zyphe-sdk/core 0.7.0 → 0.9.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.ts +782 -296
- package/dist/index.js +93 -0
- package/dist/index.js.map +1 -1
- package/dist/openapi.d.ts +593 -261
- package/dist/openapi.json +1185 -483
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -222,6 +222,11 @@ async function completeDocumentSelectionStep({ verificationSession, payload }, o
|
|
|
222
222
|
return processDocumentSelectionResponse.data;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
+
// src/utils/attachment.ts
|
|
226
|
+
function attachmentFileName(header) {
|
|
227
|
+
return header ? /filename="?([^";]+)"?/i.exec(header)?.[1] : void 0;
|
|
228
|
+
}
|
|
229
|
+
|
|
225
230
|
// src/gen/dv_result.ts
|
|
226
231
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
227
232
|
function imageProvenanceFromJSON(object) {
|
|
@@ -1338,6 +1343,25 @@ async function listFlowResults({ organizationId, flowSlug, isSandbox, pagination
|
|
|
1338
1343
|
}
|
|
1339
1344
|
});
|
|
1340
1345
|
}
|
|
1346
|
+
async function searchFlowResults({ organizationId, isSandbox, search, locale }, opts) {
|
|
1347
|
+
ensureApiKeyType(opts.apiKey, ["SECRET"]);
|
|
1348
|
+
const client = zypheApiClient(opts);
|
|
1349
|
+
return client.POST("/sdk/organizations/{organization_id}/flow-results/search", {
|
|
1350
|
+
params: {
|
|
1351
|
+
path: {
|
|
1352
|
+
organization_id: organizationId
|
|
1353
|
+
},
|
|
1354
|
+
query: {
|
|
1355
|
+
sandbox: isSandbox,
|
|
1356
|
+
locale
|
|
1357
|
+
}
|
|
1358
|
+
},
|
|
1359
|
+
body: search,
|
|
1360
|
+
headers: {
|
|
1361
|
+
[API_KEY_HEADER]: opts.apiKey
|
|
1362
|
+
}
|
|
1363
|
+
});
|
|
1364
|
+
}
|
|
1341
1365
|
async function getFlowResult({ organizationId, flowResultId, isSandbox }, opts) {
|
|
1342
1366
|
ensureApiKeyType(opts.apiKey, ["SECRET"]);
|
|
1343
1367
|
const client = zypheApiClient(opts);
|
|
@@ -1398,6 +1422,38 @@ async function getDvResult({ organizationId, flowResultId, dvResultId, isSandbox
|
|
|
1398
1422
|
data: data ? decodeLengthPrefixedMessages(new Uint8Array(data)) : void 0
|
|
1399
1423
|
};
|
|
1400
1424
|
}
|
|
1425
|
+
async function getDvResultReport({ organizationId, flowResultId, flowSlug, dvResultId, isSandbox, locale }, opts) {
|
|
1426
|
+
ensureApiKeyType(opts.apiKey, ["SECRET"]);
|
|
1427
|
+
const client = zypheApiClient(opts);
|
|
1428
|
+
const { data, error, response } = await client.GET(
|
|
1429
|
+
"/sdk/organizations/{organization_id}/flow-results/{flow_result_id}/flow/{flow_slug}/dv/{dv_result_id}/report",
|
|
1430
|
+
{
|
|
1431
|
+
params: {
|
|
1432
|
+
path: {
|
|
1433
|
+
organization_id: organizationId,
|
|
1434
|
+
flow_result_id: flowResultId,
|
|
1435
|
+
flow_slug: flowSlug,
|
|
1436
|
+
dv_result_id: dvResultId
|
|
1437
|
+
},
|
|
1438
|
+
query: {
|
|
1439
|
+
sandbox: isSandbox,
|
|
1440
|
+
locale
|
|
1441
|
+
}
|
|
1442
|
+
},
|
|
1443
|
+
headers: {
|
|
1444
|
+
[API_KEY_HEADER]: opts.apiKey,
|
|
1445
|
+
Accept: "application/pdf"
|
|
1446
|
+
},
|
|
1447
|
+
parseAs: "arrayBuffer"
|
|
1448
|
+
}
|
|
1449
|
+
);
|
|
1450
|
+
return {
|
|
1451
|
+
data: data ? new Uint8Array(data) : void 0,
|
|
1452
|
+
error,
|
|
1453
|
+
response,
|
|
1454
|
+
fileName: attachmentFileName(response.headers.get("content-disposition"))
|
|
1455
|
+
};
|
|
1456
|
+
}
|
|
1401
1457
|
|
|
1402
1458
|
// src/kyb.ts
|
|
1403
1459
|
async function addKybUbos({ organizationId, kybResultId, isSandbox, persons, locale }, opts) {
|
|
@@ -1545,6 +1601,40 @@ async function getKybCase({ organizationId, caseId, isSandbox, locale }, opts) {
|
|
|
1545
1601
|
}
|
|
1546
1602
|
});
|
|
1547
1603
|
}
|
|
1604
|
+
async function getKybCaseReport({ organizationId, caseId, isSandbox, locale, ifNoneMatch }, opts) {
|
|
1605
|
+
ensureApiKeyType(opts.apiKey, ["SECRET"]);
|
|
1606
|
+
const client = zypheApiClient(opts);
|
|
1607
|
+
const { data, error, response } = await client.GET("/sdk/organizations/{organization_id}/kyb-cases/{case_id}/report", {
|
|
1608
|
+
params: {
|
|
1609
|
+
path: {
|
|
1610
|
+
organization_id: organizationId,
|
|
1611
|
+
case_id: caseId
|
|
1612
|
+
},
|
|
1613
|
+
query: {
|
|
1614
|
+
sandbox: isSandbox,
|
|
1615
|
+
locale
|
|
1616
|
+
},
|
|
1617
|
+
header: ifNoneMatch ? { "If-None-Match": ifNoneMatch } : void 0
|
|
1618
|
+
},
|
|
1619
|
+
headers: {
|
|
1620
|
+
[API_KEY_HEADER]: opts.apiKey,
|
|
1621
|
+
Accept: "application/pdf"
|
|
1622
|
+
},
|
|
1623
|
+
parseAs: "arrayBuffer"
|
|
1624
|
+
});
|
|
1625
|
+
const etag = response.headers.get("etag") ?? void 0;
|
|
1626
|
+
if (response.status === 304) {
|
|
1627
|
+
return { data: void 0, error: void 0, response, notModified: true, etag, fileName: void 0 };
|
|
1628
|
+
}
|
|
1629
|
+
return {
|
|
1630
|
+
data: data ? new Uint8Array(data) : void 0,
|
|
1631
|
+
error,
|
|
1632
|
+
response,
|
|
1633
|
+
notModified: false,
|
|
1634
|
+
etag,
|
|
1635
|
+
fileName: attachmentFileName(response.headers.get("content-disposition"))
|
|
1636
|
+
};
|
|
1637
|
+
}
|
|
1548
1638
|
async function decideKybCase({ organizationId, caseId, isSandbox, locale, outcome, reason, reasonCode, dueDiligenceLevel, confirmingProposalId }, opts) {
|
|
1549
1639
|
ensureApiKeyType(opts.apiKey, ["SECRET"]);
|
|
1550
1640
|
const client = zypheApiClient(opts);
|
|
@@ -2062,9 +2152,11 @@ export {
|
|
|
2062
2152
|
createVerificationSession,
|
|
2063
2153
|
decideKybCase,
|
|
2064
2154
|
getDvResult,
|
|
2155
|
+
getDvResultReport,
|
|
2065
2156
|
getFlowResult,
|
|
2066
2157
|
getKybCase,
|
|
2067
2158
|
getKybCaseOfficers,
|
|
2159
|
+
getKybCaseReport,
|
|
2068
2160
|
getNextStepDetails,
|
|
2069
2161
|
getTinCheck,
|
|
2070
2162
|
getTinCheckQuote,
|
|
@@ -2082,6 +2174,7 @@ export {
|
|
|
2082
2174
|
requestKybOnDemandDocument,
|
|
2083
2175
|
runTinCheck,
|
|
2084
2176
|
screenAml,
|
|
2177
|
+
searchFlowResults,
|
|
2085
2178
|
sendKybCaseUboReminder,
|
|
2086
2179
|
sendKybUboReminder,
|
|
2087
2180
|
timingSafeEqual,
|