@carlonicora/nextjs-jsonapi 1.44.2 → 1.45.1
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 +2 -2
- package/dist/{BlockNoteEditor-2ZP2BEZC.mjs → BlockNoteEditor-IAA6SRJD.mjs} +4 -4
- package/dist/{BlockNoteEditor-C7CVGQDG.js → BlockNoteEditor-JYQVZHSR.js} +14 -14
- package/dist/{BlockNoteEditor-C7CVGQDG.js.map → BlockNoteEditor-JYQVZHSR.js.map} +1 -1
- package/dist/{auth.interface-BJGKQ0zr.d.ts → auth.interface-DgpoGNZN.d.ts} +1 -0
- package/dist/{auth.interface-8XglqHir.d.mts → auth.interface-quk7psiq.d.mts} +1 -0
- package/dist/billing/index.js +346 -346
- package/dist/billing/index.mjs +3 -3
- package/dist/{chunk-LBIC4GJK.mjs → chunk-4HMQNMP6.mjs} +28 -2
- package/dist/chunk-4HMQNMP6.mjs.map +1 -0
- package/dist/{chunk-L5F5ZN5F.js → chunk-AHXRHXZ2.js} +84 -2
- package/dist/chunk-AHXRHXZ2.js.map +1 -0
- package/dist/{chunk-CLXIZJVH.mjs → chunk-EA3EPEDL.mjs} +839 -450
- package/dist/chunk-EA3EPEDL.mjs.map +1 -0
- package/dist/{chunk-OODZEX6P.js → chunk-GP3MDKGE.js} +28 -2
- package/dist/chunk-GP3MDKGE.js.map +1 -0
- package/dist/{chunk-24E7WD4J.js → chunk-XRBK4J6U.js} +954 -565
- package/dist/chunk-XRBK4J6U.js.map +1 -0
- package/dist/{chunk-PHNL4QUF.mjs → chunk-ZMGUP2AI.mjs} +84 -2
- package/dist/chunk-ZMGUP2AI.mjs.map +1 -0
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/index.d.mts +160 -3
- package/dist/components/index.d.ts +160 -3
- package/dist/components/index.js +10 -4
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +9 -3
- package/dist/contexts/index.js +4 -4
- package/dist/contexts/index.mjs +3 -3
- package/dist/core/index.d.mts +42 -5
- package/dist/core/index.d.ts +42 -5
- package/dist/core/index.js +10 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +9 -1
- package/dist/index.d.mts +66 -5
- package/dist/index.d.ts +66 -5
- package/dist/index.js +17 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -2
- package/dist/{s3.service-DOwqcUDT.d.ts → s3.service--8IFzWsB.d.ts} +1 -1
- package/dist/{s3.service-D0rbmLFp.d.mts → s3.service-GQa6F4Ks.d.mts} +1 -1
- package/dist/server/index.d.mts +2 -2
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +1 -1
- package/package.json +3 -3
- package/scripts/generate-web-module/types/template-data.interface.ts +1 -1
- package/src/components/index.ts +1 -0
- package/src/core/index.ts +3 -0
- package/src/core/registry/ModuleRegistry.ts +3 -0
- package/src/features/auth/components/buttons/GoogleSignInButton.tsx +13 -2
- package/src/features/auth/components/forms/Login.tsx +24 -2
- package/src/features/auth/components/forms/Logout.tsx +9 -1
- package/src/features/auth/components/forms/Register.tsx +45 -5
- package/src/features/auth/components/forms/__tests__/Logout.spec.tsx +118 -0
- package/src/features/auth/config.ts +1 -1
- package/src/features/auth/data/auth.interface.ts +1 -0
- package/src/features/auth/data/auth.ts +1 -0
- package/src/features/auth/utils/__tests__/clearClientStorage.spec.ts +81 -0
- package/src/features/auth/utils/clearClientStorage.ts +11 -0
- package/src/features/auth/utils/index.ts +1 -0
- package/src/features/index.ts +1 -0
- package/src/features/referral/__tests__/config.spec.ts +105 -0
- package/src/features/referral/__tests__/referral-cookie.spec.ts +188 -0
- package/src/features/referral/components/ReferralCodeCapture.tsx +51 -0
- package/src/features/referral/components/ReferralDialog.tsx +94 -0
- package/src/features/referral/components/ReferralWidget.tsx +334 -0
- package/src/features/referral/components/index.ts +3 -0
- package/src/features/referral/config.ts +89 -0
- package/src/features/referral/data/ReferralService.ts +38 -0
- package/src/features/referral/data/ReferralStats.ts +31 -0
- package/src/features/referral/data/index.ts +2 -0
- package/src/features/referral/hooks/index.ts +2 -0
- package/src/features/referral/hooks/useReferralInvite.ts +32 -0
- package/src/features/referral/hooks/useReferralStats.ts +26 -0
- package/src/features/referral/index.ts +21 -0
- package/src/features/referral/interfaces/index.ts +1 -0
- package/src/features/referral/interfaces/referral.interface.ts +5 -0
- package/src/features/referral/referral-stats.module.ts +9 -0
- package/src/features/referral/referral.module.ts +9 -0
- package/src/features/referral/utils/index.ts +1 -0
- package/src/features/referral/utils/referral-cookie.ts +35 -0
- package/src/index.ts +4 -0
- package/dist/chunk-24E7WD4J.js.map +0 -1
- package/dist/chunk-CLXIZJVH.mjs.map +0 -1
- package/dist/chunk-L5F5ZN5F.js.map +0 -1
- package/dist/chunk-LBIC4GJK.mjs.map +0 -1
- package/dist/chunk-OODZEX6P.js.map +0 -1
- package/dist/chunk-PHNL4QUF.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-2ZP2BEZC.mjs.map → BlockNoteEditor-IAA6SRJD.mjs.map} +0 -0
|
@@ -2741,6 +2741,7 @@ var Auth = class extends AbstractApiData {
|
|
|
2741
2741
|
if (data.marketingConsent !== void 0) response.data.attributes.marketingConsent = data.marketingConsent;
|
|
2742
2742
|
if (data.marketingConsentAt !== void 0) response.data.attributes.marketingConsentAt = data.marketingConsentAt;
|
|
2743
2743
|
if (data.inviteCode !== void 0) response.data.attributes.inviteCode = data.inviteCode;
|
|
2744
|
+
if (data.referralCode !== void 0) response.data.attributes.referralCode = data.referralCode;
|
|
2744
2745
|
return response;
|
|
2745
2746
|
}
|
|
2746
2747
|
};
|
|
@@ -6452,6 +6453,83 @@ var WaitlistStatsModule = /* @__PURE__ */ __name((factory) => factory({
|
|
|
6452
6453
|
model: WaitlistStats
|
|
6453
6454
|
}), "WaitlistStatsModule");
|
|
6454
6455
|
|
|
6456
|
+
// src/features/referral/data/ReferralStats.ts
|
|
6457
|
+
var ReferralStats = class extends AbstractApiData {
|
|
6458
|
+
static {
|
|
6459
|
+
__name(this, "ReferralStats");
|
|
6460
|
+
}
|
|
6461
|
+
_referralCode;
|
|
6462
|
+
_completedReferrals;
|
|
6463
|
+
_totalTokensEarned;
|
|
6464
|
+
get referralCode() {
|
|
6465
|
+
return this._referralCode ?? "";
|
|
6466
|
+
}
|
|
6467
|
+
get completedReferrals() {
|
|
6468
|
+
return this._completedReferrals ?? 0;
|
|
6469
|
+
}
|
|
6470
|
+
get totalTokensEarned() {
|
|
6471
|
+
return this._totalTokensEarned ?? 0;
|
|
6472
|
+
}
|
|
6473
|
+
rehydrate(data) {
|
|
6474
|
+
super.rehydrate(data);
|
|
6475
|
+
this._referralCode = data.jsonApi.attributes.referralCode;
|
|
6476
|
+
this._completedReferrals = data.jsonApi.attributes.completedReferrals;
|
|
6477
|
+
this._totalTokensEarned = data.jsonApi.attributes.totalTokensEarned;
|
|
6478
|
+
return this;
|
|
6479
|
+
}
|
|
6480
|
+
createJsonApi() {
|
|
6481
|
+
return {};
|
|
6482
|
+
}
|
|
6483
|
+
};
|
|
6484
|
+
|
|
6485
|
+
// src/features/referral/data/ReferralService.ts
|
|
6486
|
+
var ReferralService = class extends AbstractService {
|
|
6487
|
+
static {
|
|
6488
|
+
__name(this, "ReferralService");
|
|
6489
|
+
}
|
|
6490
|
+
/**
|
|
6491
|
+
* Get referral stats for the current company.
|
|
6492
|
+
* Returns deserialized attributes from JSON:API response.
|
|
6493
|
+
*/
|
|
6494
|
+
static async getMyReferralStats() {
|
|
6495
|
+
const endpoint = new EndpointCreator({ endpoint: Modules.Referral, id: "stats" });
|
|
6496
|
+
return this.callApi({
|
|
6497
|
+
type: Modules.ReferralStats,
|
|
6498
|
+
method: "GET" /* GET */,
|
|
6499
|
+
endpoint: endpoint.generate()
|
|
6500
|
+
});
|
|
6501
|
+
}
|
|
6502
|
+
/**
|
|
6503
|
+
* Send a referral invitation email.
|
|
6504
|
+
* Uses overridesJsonApiCreation since the endpoint accepts a simple JSON body, not JSON:API format.
|
|
6505
|
+
* Returns 204 No Content on success.
|
|
6506
|
+
*/
|
|
6507
|
+
static async sendReferralEmail(email) {
|
|
6508
|
+
const endpoint = new EndpointCreator({ endpoint: Modules.Referral, id: "invite" });
|
|
6509
|
+
await this.callApi({
|
|
6510
|
+
type: Modules.Referral,
|
|
6511
|
+
method: "POST" /* POST */,
|
|
6512
|
+
endpoint: endpoint.generate(),
|
|
6513
|
+
input: { email },
|
|
6514
|
+
overridesJsonApiCreation: true
|
|
6515
|
+
});
|
|
6516
|
+
}
|
|
6517
|
+
};
|
|
6518
|
+
|
|
6519
|
+
// src/features/referral/referral.module.ts
|
|
6520
|
+
var ReferralModule = /* @__PURE__ */ __name((factory) => factory({
|
|
6521
|
+
name: "referrals",
|
|
6522
|
+
pageUrl: "/referrals",
|
|
6523
|
+
model: ReferralService
|
|
6524
|
+
}), "ReferralModule");
|
|
6525
|
+
|
|
6526
|
+
// src/features/referral/referral-stats.module.ts
|
|
6527
|
+
var ReferralStatsModule = /* @__PURE__ */ __name((factory) => factory({
|
|
6528
|
+
name: "referral-stats",
|
|
6529
|
+
pageUrl: "/referral-stats",
|
|
6530
|
+
model: ReferralStats
|
|
6531
|
+
}), "ReferralStatsModule");
|
|
6532
|
+
|
|
6455
6533
|
export {
|
|
6456
6534
|
RehydrationFactory,
|
|
6457
6535
|
AbstractApiData,
|
|
@@ -6613,6 +6691,10 @@ export {
|
|
|
6613
6691
|
WaitlistService,
|
|
6614
6692
|
WaitlistStats,
|
|
6615
6693
|
WaitlistModule,
|
|
6616
|
-
WaitlistStatsModule
|
|
6694
|
+
WaitlistStatsModule,
|
|
6695
|
+
ReferralStats,
|
|
6696
|
+
ReferralService,
|
|
6697
|
+
ReferralModule,
|
|
6698
|
+
ReferralStatsModule
|
|
6617
6699
|
};
|
|
6618
|
-
//# sourceMappingURL=chunk-
|
|
6700
|
+
//# sourceMappingURL=chunk-ZMGUP2AI.mjs.map
|