@carlonicora/nextjs-jsonapi 1.138.0 → 1.139.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-L36KO77V.js → BlockNoteEditor-C7GK6NBI.js} +19 -19
- package/dist/{BlockNoteEditor-L36KO77V.js.map → BlockNoteEditor-C7GK6NBI.js.map} +1 -1
- package/dist/{BlockNoteEditor-JEHEQJAW.mjs → BlockNoteEditor-XVVV2CUL.mjs} +4 -4
- package/dist/billing/index.js +357 -357
- package/dist/billing/index.mjs +3 -3
- package/dist/{chunk-W73JBOIR.js → chunk-AWOOIQLF.js} +14 -2
- package/dist/chunk-AWOOIQLF.js.map +1 -0
- package/dist/{chunk-FPTJAORV.js → chunk-FYJKTQCU.js} +738 -740
- package/dist/chunk-FYJKTQCU.js.map +1 -0
- package/dist/{chunk-DVOBOFCF.mjs → chunk-GF4OWZKE.mjs} +13 -1
- package/dist/chunk-GF4OWZKE.mjs.map +1 -0
- package/dist/{chunk-JLC2YP35.mjs → chunk-GTBHGR3F.mjs} +15 -17
- package/dist/chunk-GTBHGR3F.mjs.map +1 -0
- package/dist/{chunk-M5IAN7IR.mjs → chunk-PKSCKISS.mjs} +2 -2
- package/dist/{chunk-C2LEIBUK.js → chunk-XN6CXBNO.js} +7 -7
- package/dist/{chunk-C2LEIBUK.js.map → chunk-XN6CXBNO.js.map} +1 -1
- package/dist/client/index.d.mts +2 -2
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/index.d.mts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +4 -4
- package/dist/components/index.mjs +3 -3
- package/dist/contexts/index.js +4 -4
- package/dist/contexts/index.mjs +3 -3
- package/dist/core/index.d.mts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +6 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +5 -1
- package/dist/features/help/index.js +37 -37
- package/dist/features/help/index.mjs +3 -3
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -2
- package/dist/{s3.service-gcEjq8gF.d.ts → s3.service-BrmeMjtk.d.ts} +3 -1
- package/dist/{s3.service-CBqyDZyz.d.mts → s3.service-CXKV_OT-.d.mts} +3 -1
- package/dist/server/index.d.mts +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +1 -1
- package/dist/{useDataListRetriever-BqJSFBck.d.mts → useDataListRetriever-WEXL4bqB.d.mts} +1 -0
- package/dist/{useDataListRetriever-BqJSFBck.d.ts → useDataListRetriever-WEXL4bqB.d.ts} +1 -0
- package/package.json +1 -1
- package/src/core/abstracts/AbstractService.ts +15 -0
- package/src/hooks/useDataListRetriever.ts +9 -1
- package/src/shadcnui/ui/progress.tsx +2 -7
- package/dist/chunk-DVOBOFCF.mjs.map +0 -1
- package/dist/chunk-FPTJAORV.js.map +0 -1
- package/dist/chunk-JLC2YP35.mjs.map +0 -1
- package/dist/chunk-W73JBOIR.js.map +0 -1
- /package/dist/{BlockNoteEditor-JEHEQJAW.mjs.map → BlockNoteEditor-XVVV2CUL.mjs.map} +0 -0
- /package/dist/{chunk-M5IAN7IR.mjs.map → chunk-PKSCKISS.mjs.map} +0 -0
package/dist/server/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var _chunkIOLU4ASDjs = require('../chunk-IOLU4ASD.js');
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunkAWOOIQLFjs = require('../chunk-AWOOIQLF.js');
|
|
19
19
|
require('../chunk-LXKSUWAV.js');
|
|
20
20
|
require('../chunk-IBS6NI7D.js');
|
|
21
21
|
|
|
@@ -86,7 +86,7 @@ var ServerSession = class {
|
|
|
86
86
|
if (!rawModules) return false;
|
|
87
87
|
const modules = JSON.parse(_pako2.default.ungzip(Buffer.from(rawModules, "base64"), { to: "string" }));
|
|
88
88
|
const selectedModule = modules.find((module) => module.id === params.module.moduleId);
|
|
89
|
-
return
|
|
89
|
+
return _chunkAWOOIQLFjs.checkPermissionsFromServer.call(void 0, {
|
|
90
90
|
module: params.module,
|
|
91
91
|
action: params.action,
|
|
92
92
|
data: params.data,
|
|
@@ -296,5 +296,5 @@ _chunk7QVYU63Ejs.__name.call(void 0, ServerJsonApiDelete, "ServerJsonApiDelete")
|
|
|
296
296
|
|
|
297
297
|
|
|
298
298
|
|
|
299
|
-
exports.ServerAuthService =
|
|
299
|
+
exports.ServerAuthService = _chunkAWOOIQLFjs.AuthService; exports.ServerCompanyService = _chunkAWOOIQLFjs.CompanyService; exports.ServerContentService = _chunkAWOOIQLFjs.ContentService; exports.ServerFeatureService = _chunkAWOOIQLFjs.FeatureService; exports.ServerJsonApiDelete = ServerJsonApiDelete; exports.ServerJsonApiGet = ServerJsonApiGet; exports.ServerJsonApiPatch = ServerJsonApiPatch; exports.ServerJsonApiPost = ServerJsonApiPost; exports.ServerJsonApiPut = ServerJsonApiPut; exports.ServerNotificationService = _chunkAWOOIQLFjs.NotificationService; exports.ServerPushService = _chunkAWOOIQLFjs.PushService; exports.ServerRoleService = _chunkAWOOIQLFjs.RoleService; exports.ServerS3Service = _chunkAWOOIQLFjs.S3Service; exports.ServerSession = ServerSession; exports.ServerUserService = _chunkAWOOIQLFjs.UserService; exports.configureServerJsonApi = configureServerJsonApi; exports.getServerApiUrl = getServerApiUrl; exports.getServerAppUrl = getServerAppUrl; exports.getServerToken = _chunkYUO55Q5Ajs.getServerToken; exports.getServerTrackablePages = getServerTrackablePages; exports.invalidateCacheTag = invalidateCacheTag; exports.invalidateCacheTags = invalidateCacheTags; exports.serverRequest = _chunkIOLU4ASDjs.serverRequest;
|
|
300
300
|
//# sourceMappingURL=index.js.map
|
package/dist/server/index.mjs
CHANGED
|
@@ -9,6 +9,7 @@ type DataListRetriever<T> = {
|
|
|
9
9
|
isLoaded: boolean;
|
|
10
10
|
data: T[] | undefined;
|
|
11
11
|
total?: number;
|
|
12
|
+
meta?: Record<string, any>;
|
|
12
13
|
next?: (onlyNewRecords?: boolean) => Promise<void>;
|
|
13
14
|
previous?: (onlyNewRecords?: boolean) => Promise<void>;
|
|
14
15
|
search: (search: string) => Promise<void>;
|
|
@@ -9,6 +9,7 @@ type DataListRetriever<T> = {
|
|
|
9
9
|
isLoaded: boolean;
|
|
10
10
|
data: T[] | undefined;
|
|
11
11
|
total?: number;
|
|
12
|
+
meta?: Record<string, any>;
|
|
12
13
|
next?: (onlyNewRecords?: boolean) => Promise<void>;
|
|
13
14
|
previous?: (onlyNewRecords?: boolean) => Promise<void>;
|
|
14
15
|
search: (search: string) => Promise<void>;
|
package/package.json
CHANGED
|
@@ -36,6 +36,19 @@ export function clearLastApiTotal(): void {
|
|
|
36
36
|
lastApiTotal = undefined;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
// Store the last full top-level `meta` object from any list API call - accessible by
|
|
40
|
+
// hooks that need aggregate meta beyond `total` (e.g. per-list counts). Same
|
|
41
|
+
// module-global design as lastApiTotal above.
|
|
42
|
+
let lastApiMeta: Record<string, any> | undefined = undefined;
|
|
43
|
+
|
|
44
|
+
export function getLastApiMeta(): Record<string, any> | undefined {
|
|
45
|
+
return lastApiMeta;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function clearLastApiMeta(): void {
|
|
49
|
+
lastApiMeta = undefined;
|
|
50
|
+
}
|
|
51
|
+
|
|
39
52
|
let globalErrorHandler: ((status: number, message: string) => void) | null = null;
|
|
40
53
|
|
|
41
54
|
/**
|
|
@@ -258,6 +271,8 @@ export abstract class AbstractService {
|
|
|
258
271
|
lastApiTotal = apiResponse.meta.total;
|
|
259
272
|
if (params.total) params.total.total = apiResponse.meta.total;
|
|
260
273
|
}
|
|
274
|
+
// Store the full top-level meta too, so hooks can read aggregates beyond `total`.
|
|
275
|
+
lastApiMeta = apiResponse.meta;
|
|
261
276
|
|
|
262
277
|
return apiResponse.data as T;
|
|
263
278
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { ClientAbstractService } from "../core/abstracts/ClientAbstractService";
|
|
5
|
-
import { getLastApiTotal } from "../core/abstracts/AbstractService";
|
|
5
|
+
import { getLastApiMeta, getLastApiTotal } from "../core/abstracts/AbstractService";
|
|
6
6
|
|
|
7
7
|
export type PageInfo = {
|
|
8
8
|
startItem: number;
|
|
@@ -16,6 +16,7 @@ export type DataListRetriever<T> = {
|
|
|
16
16
|
isLoaded: boolean;
|
|
17
17
|
data: T[] | undefined;
|
|
18
18
|
total?: number;
|
|
19
|
+
meta?: Record<string, any>;
|
|
19
20
|
next?: (onlyNewRecords?: boolean) => Promise<void>;
|
|
20
21
|
previous?: (onlyNewRecords?: boolean) => Promise<void>;
|
|
21
22
|
search: (search: string) => Promise<void>;
|
|
@@ -39,6 +40,7 @@ export function useDataListRetriever<T>(params: {
|
|
|
39
40
|
}): DataListRetriever<T> {
|
|
40
41
|
const [data, setData] = useState<T[] | undefined>(undefined);
|
|
41
42
|
const [total, setTotal] = useState<number | undefined>(undefined);
|
|
43
|
+
const [meta, setMeta] = useState<Record<string, any> | undefined>(undefined);
|
|
42
44
|
const [nextPage, setNextPage] = useState<string | undefined>(undefined);
|
|
43
45
|
const [previousPage, setPreviousPage] = useState<string | undefined>(undefined);
|
|
44
46
|
const [isLoaded, setIsLoaded] = useState(false);
|
|
@@ -218,6 +220,11 @@ export function useDataListRetriever<T>(params: {
|
|
|
218
220
|
if (apiTotal !== undefined) {
|
|
219
221
|
setTotal(apiTotal);
|
|
220
222
|
}
|
|
223
|
+
// Full top-level meta (aggregates beyond `total`, e.g. per-list counts)
|
|
224
|
+
const apiMeta = getLastApiMeta();
|
|
225
|
+
if (apiMeta !== undefined) {
|
|
226
|
+
setMeta(apiMeta);
|
|
227
|
+
}
|
|
221
228
|
}
|
|
222
229
|
} catch (error) {
|
|
223
230
|
if (thisRequestId === requestIdRef.current) {
|
|
@@ -359,6 +366,7 @@ export function useDataListRetriever<T>(params: {
|
|
|
359
366
|
isLoaded: isLoaded,
|
|
360
367
|
data: data as T[],
|
|
361
368
|
total,
|
|
369
|
+
meta,
|
|
362
370
|
next: nextPage ? loadNext : undefined,
|
|
363
371
|
previous: previousPage ? loadPrevious : undefined,
|
|
364
372
|
search: search,
|
|
@@ -6,14 +6,9 @@ import { cn } from "@/lib/utils";
|
|
|
6
6
|
|
|
7
7
|
function Progress({ className, children, value, ...props }: ProgressPrimitive.Root.Props) {
|
|
8
8
|
return (
|
|
9
|
-
<ProgressPrimitive.Root
|
|
10
|
-
value={value}
|
|
11
|
-
data-slot="progress"
|
|
12
|
-
className={cn("flex flex-wrap gap-3", className)}
|
|
13
|
-
{...props}
|
|
14
|
-
>
|
|
9
|
+
<ProgressPrimitive.Root value={value} data-slot="progress" className="flex flex-wrap gap-3" {...props}>
|
|
15
10
|
{children}
|
|
16
|
-
<ProgressTrack>
|
|
11
|
+
<ProgressTrack className={className}>
|
|
17
12
|
<ProgressIndicator />
|
|
18
13
|
</ProgressTrack>
|
|
19
14
|
</ProgressPrimitive.Root>
|