@opexa/portal-sdk 0.59.74 → 0.59.76
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 +1634 -1634
- package/dist/{chunk-5WRVWQBT.js → chunk-7APXFZ5G.js} +3 -3
- package/dist/chunk-7APXFZ5G.js.map +1 -0
- package/dist/{chunk-MU66ORJN.js → chunk-BDZPLMTL.js} +41 -12
- package/dist/chunk-BDZPLMTL.js.map +1 -0
- package/dist/{chunk-ROBGEUSE.js → chunk-WVFSGB7Y.js} +2 -2
- package/dist/chunk-WVFSGB7Y.js.map +1 -0
- package/dist/index.cjs +258 -139
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -10
- package/dist/index.d.ts +11 -10
- package/dist/index.js +223 -133
- package/dist/index.js.map +1 -1
- package/dist/services/index.cjs +38 -9
- package/dist/services/index.cjs.map +1 -1
- package/dist/services/index.d.cts +6 -5
- package/dist/services/index.d.ts +6 -5
- package/dist/services/index.js +2 -2
- package/dist/{types-CN0_FZew.d.cts → types-kTe_j8tm.d.cts} +19 -4
- package/dist/{types-DEyr_e0e.d.ts → types-lZQpMvHU.d.ts} +19 -4
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-5WRVWQBT.js.map +0 -1
- package/dist/chunk-MU66ORJN.js.map +0 -1
- package/dist/chunk-ROBGEUSE.js.map +0 -1
package/dist/services/index.cjs
CHANGED
|
@@ -2774,6 +2774,22 @@ var REFERRALS_QUERY = gql`
|
|
|
2774
2774
|
|
|
2775
2775
|
${REFERRAL_FRAGMENT}
|
|
2776
2776
|
`;
|
|
2777
|
+
var QUALIFIED_REFERRALS_QUERY = gql`
|
|
2778
|
+
query QualifiedReferrals($first: Int, $after: Cursor, $filter: ReferralFilterInput) {
|
|
2779
|
+
member {
|
|
2780
|
+
referrals(first: $first, after: $after, filter: $filter) {
|
|
2781
|
+
edges {
|
|
2782
|
+
node {
|
|
2783
|
+
... on Referral {
|
|
2784
|
+
id
|
|
2785
|
+
}
|
|
2786
|
+
}
|
|
2787
|
+
}
|
|
2788
|
+
totalCount
|
|
2789
|
+
}
|
|
2790
|
+
}
|
|
2791
|
+
}
|
|
2792
|
+
`;
|
|
2777
2793
|
var UPLINES_BY_NAME_QUERY = gql`
|
|
2778
2794
|
query UplinesByName($search: String!, $first: Int) {
|
|
2779
2795
|
uplinesByName(search: $search, first: $first) {
|
|
@@ -4501,10 +4517,11 @@ var AuthService = class {
|
|
|
4501
4517
|
headers.set("test-pass", input.testPass);
|
|
4502
4518
|
}
|
|
4503
4519
|
try {
|
|
4504
|
-
const res = await fetch(`${this.url}${version
|
|
4520
|
+
const res = await fetch(`${this.url}${version !== 1 ? `/v${version}/sessions` : "/sessions"}`, {
|
|
4505
4521
|
method: "POST",
|
|
4506
4522
|
headers,
|
|
4507
|
-
body: JSON.stringify(input)
|
|
4523
|
+
body: JSON.stringify(input),
|
|
4524
|
+
...version === 4 && { credentials: "include" }
|
|
4508
4525
|
});
|
|
4509
4526
|
const data = await res.json();
|
|
4510
4527
|
if (res.ok) {
|
|
@@ -4586,14 +4603,20 @@ var AuthService = class {
|
|
|
4586
4603
|
}
|
|
4587
4604
|
throw new Error("Invalid input 'type'");
|
|
4588
4605
|
}
|
|
4589
|
-
async refreshSession(refreshToken) {
|
|
4606
|
+
async refreshSession(refreshToken, version = 1) {
|
|
4590
4607
|
const headers = new Headers(this.headers);
|
|
4591
|
-
|
|
4608
|
+
if (version !== 4) {
|
|
4609
|
+
headers.append("Authorization", `Bearer ${refreshToken}`);
|
|
4610
|
+
}
|
|
4592
4611
|
try {
|
|
4593
|
-
const res = await fetch(
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4612
|
+
const res = await fetch(
|
|
4613
|
+
`${this.url}${version === 4 ? "/v4/session/refresh" : "/session:refresh"}`,
|
|
4614
|
+
{
|
|
4615
|
+
method: "POST",
|
|
4616
|
+
headers,
|
|
4617
|
+
...version === 4 && { credentials: "include" }
|
|
4618
|
+
}
|
|
4619
|
+
);
|
|
4597
4620
|
const data = await res.json();
|
|
4598
4621
|
if (res.ok) {
|
|
4599
4622
|
return {
|
|
@@ -5274,6 +5297,10 @@ var ReportService = class {
|
|
|
5274
5297
|
const res = await this.client.request(REFERRALS_QUERY, variables);
|
|
5275
5298
|
return res.ok ? { ok: res.ok, data: res.data.member.referrals } : res;
|
|
5276
5299
|
}
|
|
5300
|
+
async qualifiedReferrals(variables) {
|
|
5301
|
+
const res = await this.client.request(QUALIFIED_REFERRALS_QUERY, variables);
|
|
5302
|
+
return res.ok ? { ok: res.ok, data: res.data.member.referrals } : res;
|
|
5303
|
+
}
|
|
5277
5304
|
async referralCommission() {
|
|
5278
5305
|
const res = await this.client.request(
|
|
5279
5306
|
REFERRAL_COMMISSION_QUERY
|
|
@@ -6507,7 +6534,9 @@ var ExtensionService = class {
|
|
|
6507
6534
|
};
|
|
6508
6535
|
}
|
|
6509
6536
|
async memberCabinetSiteMachine() {
|
|
6510
|
-
const res = await this.client.request(
|
|
6537
|
+
const res = await this.client.request(
|
|
6538
|
+
MEMBER_CABINET_SITE_MACHINE_QUERY
|
|
6539
|
+
);
|
|
6511
6540
|
return res.ok ? { ok: res.ok, data: res.data.memberCabinetSiteMachine } : res;
|
|
6512
6541
|
}
|
|
6513
6542
|
};
|