@carlonicora/nextjs-jsonapi 6.30.0 → 6.31.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.
Files changed (88) hide show
  1. package/dist/{BlockNoteEditor-FTRTY4YJ.js → BlockNoteEditor-ICGGCW6N.js} +24 -24
  2. package/dist/{BlockNoteEditor-FTRTY4YJ.js.map → BlockNoteEditor-ICGGCW6N.js.map} +1 -1
  3. package/dist/{BlockNoteEditor-SQQF7OCY.mjs → BlockNoteEditor-O4E67ECL.mjs} +4 -4
  4. package/dist/{BlockNoteViewer-76CKL6W5.mjs → BlockNoteViewer-BNZEXGVT.mjs} +2 -2
  5. package/dist/{BlockNoteViewer-B25WKYQP.js → BlockNoteViewer-YONLBNXW.js} +3 -3
  6. package/dist/{BlockNoteViewer-B25WKYQP.js.map → BlockNoteViewer-YONLBNXW.js.map} +1 -1
  7. package/dist/billing/index.js +465 -465
  8. package/dist/billing/index.mjs +3 -3
  9. package/dist/{chunk-77JC2UCF.js → chunk-5XP5G45B.js} +23 -10
  10. package/dist/chunk-5XP5G45B.js.map +1 -0
  11. package/dist/{chunk-MNN6MTEN.mjs → chunk-BT3VFB3I.mjs} +154 -125
  12. package/dist/chunk-BT3VFB3I.mjs.map +1 -0
  13. package/dist/{chunk-7MGXQIEP.mjs → chunk-FDKAVSZ6.mjs} +2 -2
  14. package/dist/{chunk-FJUKLVVX.mjs → chunk-HNK2O6YE.mjs} +23 -10
  15. package/dist/chunk-HNK2O6YE.mjs.map +1 -0
  16. package/dist/{chunk-M7YK5CCE.mjs → chunk-JL6XL5NK.mjs} +9 -2
  17. package/dist/chunk-JL6XL5NK.mjs.map +1 -0
  18. package/dist/{chunk-S4FSGMKX.js → chunk-M7FA63QE.js} +796 -767
  19. package/dist/chunk-M7FA63QE.js.map +1 -0
  20. package/dist/{chunk-F3EVYBMA.js → chunk-NQL2NDKH.js} +4 -4
  21. package/dist/{chunk-F3EVYBMA.js.map → chunk-NQL2NDKH.js.map} +1 -1
  22. package/dist/{chunk-ONU4WCDG.js → chunk-Q5SMFSE4.js} +11 -4
  23. package/dist/chunk-Q5SMFSE4.js.map +1 -0
  24. package/dist/client/index.js +4 -4
  25. package/dist/client/index.mjs +3 -3
  26. package/dist/components/index.js +4 -4
  27. package/dist/components/index.mjs +3 -3
  28. package/dist/contexts/index.js +4 -4
  29. package/dist/contexts/index.mjs +3 -3
  30. package/dist/core/index.js +2 -2
  31. package/dist/core/index.mjs +1 -1
  32. package/dist/email-automations/index.js +105 -105
  33. package/dist/email-automations/index.mjs +3 -3
  34. package/dist/features/analytics/index.js +114 -114
  35. package/dist/features/analytics/index.mjs +3 -3
  36. package/dist/features/analytics/server.js +4 -4
  37. package/dist/features/analytics/server.mjs +2 -2
  38. package/dist/features/auth/components/GdprConsentSection.d.ts +2 -1
  39. package/dist/features/auth/components/GdprConsentSection.d.ts.map +1 -1
  40. package/dist/features/auth/components/forms/Login.d.ts.map +1 -1
  41. package/dist/features/auth/components/forms/Register.d.ts.map +1 -1
  42. package/dist/features/auth/data/auth.service.d.ts +8 -3
  43. package/dist/features/auth/data/auth.service.d.ts.map +1 -1
  44. package/dist/features/auth/data/pending-registration.d.ts +2 -0
  45. package/dist/features/auth/data/pending-registration.d.ts.map +1 -1
  46. package/dist/features/auth/data/pending-registration.interface.d.ts +1 -0
  47. package/dist/features/auth/data/pending-registration.interface.d.ts.map +1 -1
  48. package/dist/features/auth/hooks/useCompleteLogin.d.ts +9 -0
  49. package/dist/features/auth/hooks/useCompleteLogin.d.ts.map +1 -0
  50. package/dist/features/blog/index.js +129 -129
  51. package/dist/features/blog/index.mjs +3 -3
  52. package/dist/features/blog/server.js +7 -7
  53. package/dist/features/blog/server.mjs +1 -1
  54. package/dist/features/help/index.js +37 -37
  55. package/dist/features/help/index.mjs +3 -3
  56. package/dist/features/tokenusage/index.js +114 -114
  57. package/dist/features/tokenusage/index.mjs +3 -3
  58. package/dist/index.js +3 -3
  59. package/dist/index.mjs +2 -2
  60. package/dist/login/config.d.ts +3 -0
  61. package/dist/login/config.d.ts.map +1 -1
  62. package/dist/login/index.d.ts +1 -1
  63. package/dist/login/index.d.ts.map +1 -1
  64. package/dist/server/index.js +3 -3
  65. package/dist/server/index.mjs +2 -2
  66. package/package.json +1 -1
  67. package/src/features/auth/components/GdprConsentSection.tsx +3 -1
  68. package/src/features/auth/components/forms/Login.tsx +4 -32
  69. package/src/features/auth/components/forms/Register.tsx +66 -36
  70. package/src/features/auth/data/__tests__/auth.oauth-completion.spec.ts +44 -0
  71. package/src/features/auth/data/__tests__/pending-registration.spec.ts +8 -0
  72. package/src/features/auth/data/auth.service.ts +21 -15
  73. package/src/features/auth/data/pending-registration.interface.ts +1 -0
  74. package/src/features/auth/data/pending-registration.ts +6 -0
  75. package/src/features/auth/hooks/__tests__/useCompleteLogin.spec.tsx +85 -0
  76. package/src/features/auth/hooks/useCompleteLogin.ts +47 -0
  77. package/src/login/__tests__/config.spec.ts +21 -0
  78. package/src/login/config.ts +8 -0
  79. package/src/login/index.ts +1 -0
  80. package/dist/chunk-77JC2UCF.js.map +0 -1
  81. package/dist/chunk-FJUKLVVX.mjs.map +0 -1
  82. package/dist/chunk-M7YK5CCE.mjs.map +0 -1
  83. package/dist/chunk-MNN6MTEN.mjs.map +0 -1
  84. package/dist/chunk-ONU4WCDG.js.map +0 -1
  85. package/dist/chunk-S4FSGMKX.js.map +0 -1
  86. /package/dist/{BlockNoteEditor-SQQF7OCY.mjs.map → BlockNoteEditor-O4E67ECL.mjs.map} +0 -0
  87. /package/dist/{BlockNoteViewer-76CKL6W5.mjs.map → BlockNoteViewer-BNZEXGVT.mjs.map} +0 -0
  88. /package/dist/{chunk-7MGXQIEP.mjs.map → chunk-FDKAVSZ6.mjs.map} +0 -0
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  VIEWPORT_COOKIE_NAME,
6
6
  checkPermissionsFromServer
7
- } from "./chunk-FJUKLVVX.mjs";
7
+ } from "./chunk-HNK2O6YE.mjs";
8
8
  import {
9
9
  __name
10
10
  } from "./chunk-PAWJFY3S.mjs";
@@ -139,4 +139,4 @@ export {
139
139
  ServerSession,
140
140
  buildOfflineManifest
141
141
  };
142
- //# sourceMappingURL=chunk-7MGXQIEP.mjs.map
142
+ //# sourceMappingURL=chunk-FDKAVSZ6.mjs.map
@@ -2922,17 +2922,25 @@ var AuthService = class extends AbstractService {
2922
2922
  suppressGlobalError: true
2923
2923
  });
2924
2924
  }
2925
+ /**
2926
+ * Completes an OAuth sign-up waiting for consent. A sign-up with a usable
2927
+ * waitlist invite sends no consent: the server copies it from the waitlist.
2928
+ * Throws an Error with message `"<status>:<message>"` on failure.
2929
+ */
2925
2930
  static async completeOAuthRegistration(params) {
2926
- const endpoint = new EndpointCreator({ endpoint: Modules.Auth, id: "oauth", childEndpoint: "complete" });
2927
- const response = await JsonApiPost({
2928
- classKey: Modules.Auth,
2929
- endpoint: endpoint.generate(),
2930
- body: params,
2931
- overridesJsonApiCreation: true,
2932
- language: "en"
2931
+ const input = {
2932
+ id: params.pendingId,
2933
+ termsAcceptedAt: params.termsAcceptedAt,
2934
+ marketingConsent: params.marketingConsent,
2935
+ marketingConsentAt: params.marketingConsentAt
2936
+ };
2937
+ return this.callApi({
2938
+ type: Modules.Auth,
2939
+ method: "POST" /* POST */,
2940
+ endpoint: new EndpointCreator({ endpoint: Modules.Auth, id: "oauth", childEndpoint: "complete" }).generate(),
2941
+ input,
2942
+ suppressGlobalError: true
2933
2943
  });
2934
- if (!response.ok) throw new Error(response.error);
2935
- return response.data;
2936
2944
  }
2937
2945
  };
2938
2946
 
@@ -3265,6 +3273,7 @@ var PendingRegistration = class extends AbstractApiData {
3265
3273
  _provider;
3266
3274
  _hasPass;
3267
3275
  _emailInUse;
3276
+ _hasInvite;
3268
3277
  get name() {
3269
3278
  return this._name ?? "";
3270
3279
  }
@@ -3283,6 +3292,9 @@ var PendingRegistration = class extends AbstractApiData {
3283
3292
  get emailInUse() {
3284
3293
  return this._emailInUse ?? false;
3285
3294
  }
3295
+ get hasInvite() {
3296
+ return this._hasInvite ?? false;
3297
+ }
3286
3298
  rehydrate(data) {
3287
3299
  super.rehydrate(data);
3288
3300
  this._name = data.jsonApi.attributes.name;
@@ -3291,6 +3303,7 @@ var PendingRegistration = class extends AbstractApiData {
3291
3303
  this._provider = data.jsonApi.attributes.provider;
3292
3304
  this._hasPass = data.jsonApi.attributes.hasPass ?? false;
3293
3305
  this._emailInUse = data.jsonApi.attributes.emailInUse ?? false;
3306
+ this._hasInvite = data.jsonApi.attributes.hasInvite ?? false;
3294
3307
  return this;
3295
3308
  }
3296
3309
  /** Read-only resource: the payload only identifies it. */
@@ -12971,4 +12984,4 @@ export {
12971
12984
  AuditLogService,
12972
12985
  AuditLogModule
12973
12986
  };
12974
- //# sourceMappingURL=chunk-FJUKLVVX.mjs.map
12987
+ //# sourceMappingURL=chunk-HNK2O6YE.mjs.map