@visa-check-r/integrations 0.0.123 → 0.0.125
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.cjs.js +55 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +51 -4
- package/dist/index.d.ts +51 -4
- package/dist/index.esm.js +55 -3
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -4491,17 +4491,18 @@ var createAdminAnalyticsService = (client) => ({
|
|
|
4491
4491
|
});
|
|
4492
4492
|
|
|
4493
4493
|
// src/services/partner-link/index.ts
|
|
4494
|
+
var LINK_REQUEST = "id partnerId partnerName code clientId clientName clientEmail status requestedAt respondedAt";
|
|
4494
4495
|
var PARTNER = "partner { id fullName code }";
|
|
4495
4496
|
var createPartnerLinkService = (client) => ({
|
|
4496
4497
|
async getLinkedPartner(option) {
|
|
4497
4498
|
var _a;
|
|
4498
|
-
const res = await client.request(`query getLinkedPartner { getLinkedPartner { ${PARTNER} } }`, {}, option);
|
|
4499
|
+
const res = await client.request(`query getLinkedPartner { getLinkedPartner { ${PARTNER} status } }`, {}, option);
|
|
4499
4500
|
return (_a = res.data) == null ? void 0 : _a.getLinkedPartner;
|
|
4500
4501
|
},
|
|
4501
4502
|
async linkPartner(input, option) {
|
|
4502
4503
|
var _a;
|
|
4503
4504
|
const res = await client.request(
|
|
4504
|
-
`mutation linkPartner($referralCode: String!) { linkPartner(referralCode: $referralCode) { ${PARTNER} profilesShared } }`,
|
|
4505
|
+
`mutation linkPartner($referralCode: String!) { linkPartner(referralCode: $referralCode) { ${PARTNER} status profilesShared } }`,
|
|
4505
4506
|
input,
|
|
4506
4507
|
option
|
|
4507
4508
|
);
|
|
@@ -4509,8 +4510,59 @@ var createPartnerLinkService = (client) => ({
|
|
|
4509
4510
|
},
|
|
4510
4511
|
async unlinkPartner(option) {
|
|
4511
4512
|
var _a;
|
|
4512
|
-
const res = await client.request(`mutation unlinkPartner { unlinkPartner { profilesUnshared } }`, {}, option);
|
|
4513
|
+
const res = await client.request(`mutation unlinkPartner { unlinkPartner { profilesUnshared requestCancelled } }`, {}, option);
|
|
4513
4514
|
return (_a = res.data) == null ? void 0 : _a.unlinkPartner;
|
|
4515
|
+
},
|
|
4516
|
+
/** Partners: clients waiting for an answer, oldest first. */
|
|
4517
|
+
async listLinkRequests(option) {
|
|
4518
|
+
var _a, _b, _c;
|
|
4519
|
+
const res = await client.request(
|
|
4520
|
+
`query listLinkRequests { listLinkRequests { linkRequests { ${LINK_REQUEST} } } }`,
|
|
4521
|
+
{},
|
|
4522
|
+
option
|
|
4523
|
+
);
|
|
4524
|
+
return (_c = (_b = (_a = res.data) == null ? void 0 : _a.listLinkRequests) == null ? void 0 : _b.linkRequests) != null ? _c : [];
|
|
4525
|
+
},
|
|
4526
|
+
/** Partners: link the client and see their visa profiles. */
|
|
4527
|
+
async acceptLinkRequest(id, option) {
|
|
4528
|
+
var _a, _b;
|
|
4529
|
+
const res = await client.request(
|
|
4530
|
+
`mutation acceptLinkRequest($id: String!) { acceptLinkRequest(id: $id) { linkRequest { ${LINK_REQUEST} } } }`,
|
|
4531
|
+
{ id },
|
|
4532
|
+
option
|
|
4533
|
+
);
|
|
4534
|
+
return (_b = (_a = res.data) == null ? void 0 : _a.acceptLinkRequest) == null ? void 0 : _b.linkRequest;
|
|
4535
|
+
},
|
|
4536
|
+
/** Partners: turn a client's request down. */
|
|
4537
|
+
async declineLinkRequest(id, option) {
|
|
4538
|
+
var _a, _b;
|
|
4539
|
+
const res = await client.request(
|
|
4540
|
+
`mutation declineLinkRequest($id: String!) { declineLinkRequest(id: $id) { linkRequest { ${LINK_REQUEST} } } }`,
|
|
4541
|
+
{ id },
|
|
4542
|
+
option
|
|
4543
|
+
);
|
|
4544
|
+
return (_b = (_a = res.data) == null ? void 0 : _a.declineLinkRequest) == null ? void 0 : _b.linkRequest;
|
|
4545
|
+
},
|
|
4546
|
+
/** Partners: clients, ready and flagged profiles, and waiting link requests. */
|
|
4547
|
+
async partnerDashboard(option) {
|
|
4548
|
+
var _a;
|
|
4549
|
+
const res = await client.request(
|
|
4550
|
+
`query partnerDashboard { partnerDashboard { clients readyToSubmit flagged pendingRequests } }`,
|
|
4551
|
+
{},
|
|
4552
|
+
option
|
|
4553
|
+
);
|
|
4554
|
+
return (_a = res.data) == null ? void 0 : _a.partnerDashboard;
|
|
4555
|
+
},
|
|
4556
|
+
/** The check status of each of the partner's client profiles asked for (at most 100); others are left out. */
|
|
4557
|
+
async partnerProfileChecks(visaProfileIds, option) {
|
|
4558
|
+
var _a, _b, _c;
|
|
4559
|
+
if (!visaProfileIds.length) return [];
|
|
4560
|
+
const res = await client.request(
|
|
4561
|
+
`query partnerProfileChecks($visaProfileIds: [String]!) { partnerProfileChecks(visaProfileIds: $visaProfileIds) { profileChecks { visaProfileId status } } }`,
|
|
4562
|
+
{ visaProfileIds },
|
|
4563
|
+
option
|
|
4564
|
+
);
|
|
4565
|
+
return (_c = (_b = (_a = res.data) == null ? void 0 : _a.partnerProfileChecks) == null ? void 0 : _b.profileChecks) != null ? _c : [];
|
|
4514
4566
|
}
|
|
4515
4567
|
});
|
|
4516
4568
|
|