@carlonicora/nextjs-jsonapi 1.32.1 → 1.33.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/{BlockNoteEditor-YEVSJSOI.js → BlockNoteEditor-CUXI6ZTZ.js} +14 -14
- package/dist/{BlockNoteEditor-YEVSJSOI.js.map → BlockNoteEditor-CUXI6ZTZ.js.map} +1 -1
- package/dist/{BlockNoteEditor-TFL6ZXIJ.mjs → BlockNoteEditor-UTZ7F23J.mjs} +4 -4
- package/dist/billing/index.d.mts +6 -3
- package/dist/billing/index.d.ts +6 -3
- package/dist/billing/index.js +465 -384
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +114 -33
- package/dist/billing/index.mjs.map +1 -1
- package/dist/{chunk-NPNKFWV2.js → chunk-2PHWAL6Q.js} +4 -4
- package/dist/chunk-2PHWAL6Q.js.map +1 -0
- package/dist/{chunk-SLANIL6B.mjs → chunk-53WT73E6.mjs} +56 -64
- package/dist/chunk-53WT73E6.mjs.map +1 -0
- package/dist/{chunk-YCP2OMFD.mjs → chunk-HWQBSVBT.mjs} +40 -7
- package/dist/chunk-HWQBSVBT.mjs.map +1 -0
- package/dist/{chunk-HIF7DYR3.js → chunk-RSHCU3TI.js} +553 -561
- package/dist/chunk-RSHCU3TI.js.map +1 -0
- package/dist/{chunk-KYG2PIRB.js → chunk-TZRAOUAR.js} +118 -85
- package/dist/chunk-TZRAOUAR.js.map +1 -0
- package/dist/{chunk-IXVNXOZT.mjs → chunk-XLMJPA4N.mjs} +4 -4
- package/dist/{chunk-IXVNXOZT.mjs.map → chunk-XLMJPA4N.mjs.map} +1 -1
- package/dist/client/index.d.mts +7 -6
- package/dist/client/index.d.ts +7 -6
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/index.d.mts +4 -3
- package/dist/components/index.d.ts +4 -3
- package/dist/components/index.js +4 -4
- package/dist/components/index.mjs +3 -3
- package/dist/{config-CHwoRDOp.d.ts → config-BbaBV_yk.d.ts} +1 -1
- package/dist/{config-DiWyJzk9.d.mts → config-BxwhHdCD.d.mts} +1 -1
- package/dist/{content.interface-BSpowEiW.d.mts → content.interface-CWV0q4lZ.d.mts} +1 -1
- package/dist/{content.interface-DFQ7mkpL.d.ts → content.interface-CgUu4771.d.ts} +1 -1
- package/dist/contexts/index.d.mts +3 -2
- package/dist/contexts/index.d.ts +3 -2
- package/dist/contexts/index.js +4 -4
- package/dist/contexts/index.mjs +3 -3
- package/dist/core/index.d.mts +17 -8
- package/dist/core/index.d.ts +17 -8
- package/dist/core/index.js +6 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +5 -1
- package/dist/feature.interface-BxFFOPNq.d.mts +19 -0
- package/dist/feature.interface-CIWxo8NP.d.ts +19 -0
- package/dist/index.d.mts +10 -9
- package/dist/index.d.ts +10 -9
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -2
- package/dist/{notification.interface-D5MbtfZK.d.mts → notification.interface-DIln2r7X.d.mts} +2 -17
- package/dist/{notification.interface-CmKmObIU.d.ts → notification.interface-XARGKJAq.d.ts} +2 -17
- package/dist/{s3.service-CoC0k0iu.d.ts → s3.service-DcqkGrKD.d.ts} +12 -3
- package/dist/{s3.service-Duh9HW2n.d.mts → s3.service-ag6M_7GO.d.mts} +12 -3
- package/dist/scripts/generate-web-module/templates/pages/detail-page.template.js +1 -1
- package/dist/scripts/generate-web-module/templates/pages/detail-page.template.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/pages/list-page.template.js +1 -1
- package/dist/scripts/generate-web-module/templates/pages/list-page.template.js.map +1 -1
- package/dist/server/index.d.mts +4 -3
- package/dist/server/index.d.ts +4 -3
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +1 -1
- package/dist/{stripe-subscription.interface-BaZUngWe.d.ts → stripe-subscription.interface-Dm__xmvE.d.ts} +3 -0
- package/dist/{stripe-subscription.interface-Cm_It1fz.d.mts → stripe-subscription.interface-_VWPY2AA.d.mts} +3 -0
- package/dist/{useDataListRetriever-futhx3OP.d.mts → useDataListRetriever-BqJSFBck.d.mts} +1 -0
- package/dist/{useDataListRetriever-futhx3OP.d.ts → useDataListRetriever-BqJSFBck.d.ts} +1 -0
- package/dist/{useSocket-DUqGoPya.d.mts → useSocket-BILAdmZ0.d.mts} +1 -1
- package/dist/{useSocket-QuHa0ZmO.d.ts → useSocket-awibcC9B.d.ts} +1 -1
- package/package.json +1 -1
- package/scripts/generate-web-module/templates/pages/detail-page.template.ts +1 -1
- package/scripts/generate-web-module/templates/pages/list-page.template.ts +1 -1
- package/src/components/forms/DatePickerPopover.tsx +17 -15
- package/src/components/tables/ContentListTable.tsx +2 -2
- package/src/core/abstracts/AbstractService.ts +25 -0
- package/src/core/abstracts/ClientAbstractService.ts +10 -0
- package/src/features/billing/components/containers/BillingDashboardContainer.tsx +4 -1
- package/src/features/billing/stripe-invoice/components/details/InvoiceDetails.tsx +1 -1
- package/src/features/billing/stripe-invoice/components/lists/InvoicesList.tsx +1 -1
- package/src/features/billing/stripe-price/components/forms/PriceEditor.tsx +85 -1
- package/src/features/billing/stripe-price/data/stripe-price.interface.ts +3 -0
- package/src/features/billing/stripe-price/data/stripe-price.ts +18 -0
- package/src/features/billing/stripe-subscription/components/containers/SubscriptionsContainer.tsx +5 -2
- package/src/features/billing/stripe-subscription/components/forms/CancelSubscriptionDialog.tsx +5 -18
- package/src/features/billing/stripe-subscription/components/lists/SubscriptionsList.tsx +1 -1
- package/src/features/billing/stripe-subscription/components/widgets/ProductPricingList.tsx +16 -12
- package/src/features/billing/stripe-subscription/components/wizards/SubscriptionWizard.tsx +14 -3
- package/src/features/billing/stripe-subscription/components/wizards/WizardStepPlanSelection.tsx +14 -9
- package/src/features/billing/stripe-subscription/components/wizards/WizardStepReview.tsx +1 -1
- package/src/features/billing/stripe-subscription/data/stripe-subscription.service.ts +2 -2
- package/src/features/billing/stripe-usage/components/lists/UsageHistoryTable.tsx +1 -1
- package/src/features/company/components/details/TokenStatusIndicator.tsx +4 -6
- package/src/features/company/hooks/useSubscriptionStatus.ts +18 -0
- package/src/features/content/hooks/useContentTableStructure.tsx +1 -1
- package/src/features/user/contexts/CurrentUserContext.tsx +2 -1
- package/src/features/user/hooks/useUserTableStructure.tsx +1 -1
- package/src/hooks/useDataListRetriever.ts +13 -0
- package/src/login/config.ts +6 -6
- package/src/shadcnui/ui/table.tsx +20 -49
- package/dist/chunk-HIF7DYR3.js.map +0 -1
- package/dist/chunk-KYG2PIRB.js.map +0 -1
- package/dist/chunk-NPNKFWV2.js.map +0 -1
- package/dist/chunk-SLANIL6B.mjs.map +0 -1
- package/dist/chunk-YCP2OMFD.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-TFL6ZXIJ.mjs.map → BlockNoteEditor-UTZ7F23J.mjs.map} +0 -0
|
@@ -211,6 +211,15 @@ var HttpMethod = /* @__PURE__ */ ((HttpMethod2) => {
|
|
|
211
211
|
HttpMethod2["DELETE"] = "DELETE";
|
|
212
212
|
return HttpMethod2;
|
|
213
213
|
})(HttpMethod || {});
|
|
214
|
+
var lastApiTotal = void 0;
|
|
215
|
+
function getLastApiTotal() {
|
|
216
|
+
return lastApiTotal;
|
|
217
|
+
}
|
|
218
|
+
__name(getLastApiTotal, "getLastApiTotal");
|
|
219
|
+
function clearLastApiTotal() {
|
|
220
|
+
lastApiTotal = void 0;
|
|
221
|
+
}
|
|
222
|
+
__name(clearLastApiTotal, "clearLastApiTotal");
|
|
214
223
|
var globalErrorHandler = null;
|
|
215
224
|
function setGlobalErrorHandler(handler) {
|
|
216
225
|
globalErrorHandler = handler;
|
|
@@ -252,7 +261,8 @@ var AbstractService = class {
|
|
|
252
261
|
endpoint: params.endpoint,
|
|
253
262
|
next: params.next,
|
|
254
263
|
previous: params.previous,
|
|
255
|
-
self: params.self
|
|
264
|
+
self: params.self,
|
|
265
|
+
total: params.total
|
|
256
266
|
});
|
|
257
267
|
}
|
|
258
268
|
/**
|
|
@@ -265,7 +275,8 @@ var AbstractService = class {
|
|
|
265
275
|
endpoint: params.endpoint,
|
|
266
276
|
next: params.next,
|
|
267
277
|
previous: params.previous,
|
|
268
|
-
self: params.self
|
|
278
|
+
self: params.self,
|
|
279
|
+
total: params.total
|
|
269
280
|
});
|
|
270
281
|
}
|
|
271
282
|
/**
|
|
@@ -351,6 +362,10 @@ var AbstractService = class {
|
|
|
351
362
|
if (apiResponse.next && params.next) params.next.next = apiResponse.next;
|
|
352
363
|
if (apiResponse.prev && params.previous) params.previous.previous = apiResponse.prev;
|
|
353
364
|
if (apiResponse.self && params.self) params.self.self = apiResponse.self;
|
|
365
|
+
if (apiResponse.meta?.total !== void 0) {
|
|
366
|
+
lastApiTotal = apiResponse.meta.total;
|
|
367
|
+
if (params.total) params.total.total = apiResponse.meta.total;
|
|
368
|
+
}
|
|
354
369
|
return apiResponse.data;
|
|
355
370
|
}
|
|
356
371
|
/**
|
|
@@ -701,7 +716,8 @@ var ClientAbstractService = class {
|
|
|
701
716
|
endpoint: params.endpoint,
|
|
702
717
|
next: params.next,
|
|
703
718
|
previous: params.previous,
|
|
704
|
-
self: params.self
|
|
719
|
+
self: params.self,
|
|
720
|
+
total: params.total
|
|
705
721
|
});
|
|
706
722
|
}
|
|
707
723
|
/**
|
|
@@ -714,7 +730,8 @@ var ClientAbstractService = class {
|
|
|
714
730
|
endpoint: params.endpoint,
|
|
715
731
|
next: params.next,
|
|
716
732
|
previous: params.previous,
|
|
717
|
-
self: params.self
|
|
733
|
+
self: params.self,
|
|
734
|
+
total: params.total
|
|
718
735
|
});
|
|
719
736
|
}
|
|
720
737
|
/**
|
|
@@ -793,6 +810,7 @@ var ClientAbstractService = class {
|
|
|
793
810
|
if (apiResponse.next && params.next) params.next.next = apiResponse.next;
|
|
794
811
|
if (apiResponse.prev && params.previous) params.previous.previous = apiResponse.prev;
|
|
795
812
|
if (apiResponse.self && params.self) params.self.self = apiResponse.self;
|
|
813
|
+
if (apiResponse.meta?.total !== void 0 && params.total) params.total.total = apiResponse.meta.total;
|
|
796
814
|
return apiResponse.data;
|
|
797
815
|
}
|
|
798
816
|
/**
|
|
@@ -2958,6 +2976,8 @@ var StripePrice = class extends AbstractApiData {
|
|
|
2958
2976
|
_description;
|
|
2959
2977
|
_features;
|
|
2960
2978
|
_token;
|
|
2979
|
+
_priceFeatures = [];
|
|
2980
|
+
// Platform Feature entities
|
|
2961
2981
|
get stripePriceId() {
|
|
2962
2982
|
if (!this._stripePriceId) throw new Error("stripePriceId is not defined");
|
|
2963
2983
|
return this._stripePriceId;
|
|
@@ -3004,6 +3024,9 @@ var StripePrice = class extends AbstractApiData {
|
|
|
3004
3024
|
get token() {
|
|
3005
3025
|
return this._token;
|
|
3006
3026
|
}
|
|
3027
|
+
get priceFeatures() {
|
|
3028
|
+
return this._priceFeatures;
|
|
3029
|
+
}
|
|
3007
3030
|
rehydrate(data) {
|
|
3008
3031
|
super.rehydrate(data);
|
|
3009
3032
|
this._stripePriceId = data.jsonApi.attributes.stripePriceId;
|
|
@@ -3026,6 +3049,7 @@ var StripePrice = class extends AbstractApiData {
|
|
|
3026
3049
|
this._features = data.jsonApi.attributes.features ? typeof data.jsonApi.attributes.features === "string" ? JSON.parse(data.jsonApi.attributes.features) : data.jsonApi.attributes.features : void 0;
|
|
3027
3050
|
this._token = data.jsonApi.attributes.token;
|
|
3028
3051
|
this._product = this._readIncluded(data, "product", Modules.StripeProduct);
|
|
3052
|
+
this._priceFeatures = this._readIncluded(data, "features", Modules.Feature);
|
|
3029
3053
|
return this;
|
|
3030
3054
|
}
|
|
3031
3055
|
createJsonApi(data) {
|
|
@@ -3066,6 +3090,13 @@ var StripePrice = class extends AbstractApiData {
|
|
|
3066
3090
|
if ("token" in data && data.token !== void 0) {
|
|
3067
3091
|
response.data.attributes.token = data.token;
|
|
3068
3092
|
}
|
|
3093
|
+
if (data.featureIds && data.featureIds.length > 0) {
|
|
3094
|
+
response.data.relationships = response.data.relationships || {};
|
|
3095
|
+
response.data.relationships.features = data.featureIds.map((id) => ({
|
|
3096
|
+
type: Modules.Feature.name,
|
|
3097
|
+
id
|
|
3098
|
+
}));
|
|
3099
|
+
}
|
|
3069
3100
|
return response;
|
|
3070
3101
|
}
|
|
3071
3102
|
};
|
|
@@ -3526,7 +3557,7 @@ var StripeSubscriptionService = class extends AbstractService {
|
|
|
3526
3557
|
});
|
|
3527
3558
|
return this.callApi({
|
|
3528
3559
|
type: Modules.StripeSubscription,
|
|
3529
|
-
method: "
|
|
3560
|
+
method: "POST" /* POST */,
|
|
3530
3561
|
endpoint: endpoint.generate(),
|
|
3531
3562
|
input: params
|
|
3532
3563
|
});
|
|
@@ -3540,7 +3571,7 @@ var StripeSubscriptionService = class extends AbstractService {
|
|
|
3540
3571
|
id: params.subscriptionId,
|
|
3541
3572
|
childEndpoint: "proration-preview"
|
|
3542
3573
|
});
|
|
3543
|
-
endpoint.addAdditionalParam("
|
|
3574
|
+
endpoint.addAdditionalParam("priceId", params.newPriceId);
|
|
3544
3575
|
if (params.quantity) {
|
|
3545
3576
|
endpoint.addAdditionalParam("quantity", params.quantity.toString());
|
|
3546
3577
|
}
|
|
@@ -5223,6 +5254,8 @@ export {
|
|
|
5223
5254
|
RehydrationFactory,
|
|
5224
5255
|
AbstractApiData,
|
|
5225
5256
|
HttpMethod,
|
|
5257
|
+
getLastApiTotal,
|
|
5258
|
+
clearLastApiTotal,
|
|
5226
5259
|
setGlobalErrorHandler,
|
|
5227
5260
|
getGlobalErrorHandler,
|
|
5228
5261
|
AbstractService,
|
|
@@ -5343,4 +5376,4 @@ export {
|
|
|
5343
5376
|
AVAILABLE_OAUTH_SCOPES,
|
|
5344
5377
|
DEFAULT_GRANT_TYPES
|
|
5345
5378
|
};
|
|
5346
|
-
//# sourceMappingURL=chunk-
|
|
5379
|
+
//# sourceMappingURL=chunk-HWQBSVBT.mjs.map
|