@carlonicora/nextjs-jsonapi 0.0.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 +889 -0
- package/dist/AbstractService-BKlpJA61.d.mts +109 -0
- package/dist/AbstractService-D9eSVKNa.d.ts +109 -0
- package/dist/ApiData-DPKNfY-9.d.mts +10 -0
- package/dist/ApiData-DPKNfY-9.d.ts +10 -0
- package/dist/ApiDataInterface-DPP8s46n.d.mts +21 -0
- package/dist/ApiDataInterface-DPP8s46n.d.ts +21 -0
- package/dist/ApiRequestDataTypeInterface-CUKFDBx2.d.mts +20 -0
- package/dist/ApiRequestDataTypeInterface-CUKFDBx2.d.ts +20 -0
- package/dist/ApiResponseInterface-BHN5D9r5.d.mts +16 -0
- package/dist/ApiResponseInterface-DDI7QQPR.d.ts +16 -0
- package/dist/BlockNoteEditor-UVO3VZZE.mjs +396 -0
- package/dist/BlockNoteEditor-UVO3VZZE.mjs.map +1 -0
- package/dist/BlockNoteEditor-VFWG6LXI.js +396 -0
- package/dist/BlockNoteEditor-VFWG6LXI.js.map +1 -0
- package/dist/JsonApiRequest-S3ICLM7B.mjs +20 -0
- package/dist/JsonApiRequest-S3ICLM7B.mjs.map +1 -0
- package/dist/JsonApiRequest-ZZLSP26T.js +20 -0
- package/dist/JsonApiRequest-ZZLSP26T.js.map +1 -0
- package/dist/atoms/index.d.mts +12 -0
- package/dist/atoms/index.d.ts +12 -0
- package/dist/atoms/index.js +9 -0
- package/dist/atoms/index.js.map +1 -0
- package/dist/atoms/index.mjs +9 -0
- package/dist/atoms/index.mjs.map +1 -0
- package/dist/breadcrumb.item.data.interface-CgB4_1EE.d.mts +6 -0
- package/dist/breadcrumb.item.data.interface-CgB4_1EE.d.ts +6 -0
- package/dist/chunk-2K3Q24UF.js +89 -0
- package/dist/chunk-2K3Q24UF.js.map +1 -0
- package/dist/chunk-2LM6LCJW.mjs +1091 -0
- package/dist/chunk-2LM6LCJW.mjs.map +1 -0
- package/dist/chunk-366S2JCC.mjs +31 -0
- package/dist/chunk-366S2JCC.mjs.map +1 -0
- package/dist/chunk-3FBCC4G3.js +8 -0
- package/dist/chunk-3FBCC4G3.js.map +1 -0
- package/dist/chunk-4HCRAOS5.js +28 -0
- package/dist/chunk-4HCRAOS5.js.map +1 -0
- package/dist/chunk-5W6AKZE6.mjs +131 -0
- package/dist/chunk-5W6AKZE6.mjs.map +1 -0
- package/dist/chunk-6GKHCVF6.js +98 -0
- package/dist/chunk-6GKHCVF6.js.map +1 -0
- package/dist/chunk-7QVYU63E.js +7 -0
- package/dist/chunk-7QVYU63E.js.map +1 -0
- package/dist/chunk-A3J3AAYM.mjs +97 -0
- package/dist/chunk-A3J3AAYM.mjs.map +1 -0
- package/dist/chunk-A5DDIABK.js +4209 -0
- package/dist/chunk-A5DDIABK.js.map +1 -0
- package/dist/chunk-AUXK7QSA.mjs +15 -0
- package/dist/chunk-AUXK7QSA.mjs.map +1 -0
- package/dist/chunk-AWONBQQP.js +97 -0
- package/dist/chunk-AWONBQQP.js.map +1 -0
- package/dist/chunk-BLWVZK6J.mjs +28 -0
- package/dist/chunk-BLWVZK6J.mjs.map +1 -0
- package/dist/chunk-C7C7VY4F.mjs +77 -0
- package/dist/chunk-C7C7VY4F.mjs.map +1 -0
- package/dist/chunk-CXQOWQSY.js +55 -0
- package/dist/chunk-CXQOWQSY.js.map +1 -0
- package/dist/chunk-DD3KISNB.mjs +98 -0
- package/dist/chunk-DD3KISNB.mjs.map +1 -0
- package/dist/chunk-DKKMWBP4.mjs +1 -0
- package/dist/chunk-DKKMWBP4.mjs.map +1 -0
- package/dist/chunk-DO2HLAZO.js +48 -0
- package/dist/chunk-DO2HLAZO.js.map +1 -0
- package/dist/chunk-DZXDB3K2.mjs +17 -0
- package/dist/chunk-DZXDB3K2.mjs.map +1 -0
- package/dist/chunk-ECDTZBYO.mjs +230 -0
- package/dist/chunk-ECDTZBYO.mjs.map +1 -0
- package/dist/chunk-EFJEWLRL.js +16 -0
- package/dist/chunk-EFJEWLRL.js.map +1 -0
- package/dist/chunk-FY4SXJGU.js +806 -0
- package/dist/chunk-FY4SXJGU.js.map +1 -0
- package/dist/chunk-GYWPEPOH.mjs +1354 -0
- package/dist/chunk-GYWPEPOH.mjs.map +1 -0
- package/dist/chunk-H6FMOA6B.js +1 -0
- package/dist/chunk-H6FMOA6B.js.map +1 -0
- package/dist/chunk-HR4H2FP7.mjs +89 -0
- package/dist/chunk-HR4H2FP7.mjs.map +1 -0
- package/dist/chunk-I2REI7OA.js +462 -0
- package/dist/chunk-I2REI7OA.js.map +1 -0
- package/dist/chunk-IBS6NI7D.js +77 -0
- package/dist/chunk-IBS6NI7D.js.map +1 -0
- package/dist/chunk-IWFGEPAA.mjs +4209 -0
- package/dist/chunk-IWFGEPAA.mjs.map +1 -0
- package/dist/chunk-J4Q36PMP.js +31 -0
- package/dist/chunk-J4Q36PMP.js.map +1 -0
- package/dist/chunk-JC3WJK65.js +1091 -0
- package/dist/chunk-JC3WJK65.js.map +1 -0
- package/dist/chunk-L6EQEAXU.mjs +462 -0
- package/dist/chunk-L6EQEAXU.mjs.map +1 -0
- package/dist/chunk-LXKSUWAV.js +15 -0
- package/dist/chunk-LXKSUWAV.js.map +1 -0
- package/dist/chunk-MFO27OHB.mjs +48 -0
- package/dist/chunk-MFO27OHB.mjs.map +1 -0
- package/dist/chunk-PAWJFY3S.mjs +7 -0
- package/dist/chunk-PAWJFY3S.mjs.map +1 -0
- package/dist/chunk-Q2N6SQYW.mjs +8 -0
- package/dist/chunk-Q2N6SQYW.mjs.map +1 -0
- package/dist/chunk-RAF7PNLG.js +131 -0
- package/dist/chunk-RAF7PNLG.js.map +1 -0
- package/dist/chunk-RUR22SVM.js +17 -0
- package/dist/chunk-RUR22SVM.js.map +1 -0
- package/dist/chunk-TEGF6ZWG.js +109 -0
- package/dist/chunk-TEGF6ZWG.js.map +1 -0
- package/dist/chunk-TMVHSY3Y.js +230 -0
- package/dist/chunk-TMVHSY3Y.js.map +1 -0
- package/dist/chunk-V2JJPI7N.js +1354 -0
- package/dist/chunk-V2JJPI7N.js.map +1 -0
- package/dist/chunk-WWWMJZEF.mjs +806 -0
- package/dist/chunk-WWWMJZEF.mjs.map +1 -0
- package/dist/chunk-X4BIHJ2B.mjs +55 -0
- package/dist/chunk-X4BIHJ2B.mjs.map +1 -0
- package/dist/chunk-YDVTFM7X.mjs +109 -0
- package/dist/chunk-YDVTFM7X.mjs.map +1 -0
- package/dist/chunk-YF5XQZDR.mjs +16 -0
- package/dist/chunk-YF5XQZDR.mjs.map +1 -0
- package/dist/client/index.d.mts +252 -0
- package/dist/client/index.d.ts +252 -0
- package/dist/client/index.js +275 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/index.mjs +274 -0
- package/dist/client/index.mjs.map +1 -0
- package/dist/components/index.d.mts +441 -0
- package/dist/components/index.d.ts +441 -0
- package/dist/components/index.js +2474 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index.mjs +2474 -0
- package/dist/components/index.mjs.map +1 -0
- package/dist/config-hXufftVS.d.mts +34 -0
- package/dist/config-hXufftVS.d.ts +34 -0
- package/dist/content.interface-BhyAiOFq.d.ts +35 -0
- package/dist/content.interface-Dg2lt_An.d.mts +35 -0
- package/dist/contexts/index.d.mts +56 -0
- package/dist/contexts/index.d.ts +56 -0
- package/dist/contexts/index.js +21 -0
- package/dist/contexts/index.js.map +1 -0
- package/dist/contexts/index.mjs +21 -0
- package/dist/contexts/index.mjs.map +1 -0
- package/dist/core/index.d.mts +152 -0
- package/dist/core/index.d.ts +152 -0
- package/dist/core/index.js +47 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/index.mjs +47 -0
- package/dist/core/index.mjs.map +1 -0
- package/dist/d3.link.interface-QMdB22bC.d.mts +20 -0
- package/dist/d3.link.interface-QMdB22bC.d.ts +20 -0
- package/dist/features/index.d.mts +553 -0
- package/dist/features/index.d.ts +553 -0
- package/dist/features/index.js +94 -0
- package/dist/features/index.js.map +1 -0
- package/dist/features/index.mjs +94 -0
- package/dist/features/index.mjs.map +1 -0
- package/dist/hooks/index.d.mts +94 -0
- package/dist/hooks/index.d.ts +94 -0
- package/dist/hooks/index.js +43 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/index.mjs +43 -0
- package/dist/hooks/index.mjs.map +1 -0
- package/dist/index.d.mts +72 -0
- package/dist/index.d.ts +72 -0
- package/dist/index.js +84 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +84 -0
- package/dist/index.mjs.map +1 -0
- package/dist/interfaces/index.d.mts +3 -0
- package/dist/interfaces/index.d.ts +3 -0
- package/dist/interfaces/index.js +2 -0
- package/dist/interfaces/index.js.map +1 -0
- package/dist/interfaces/index.mjs +2 -0
- package/dist/interfaces/index.mjs.map +1 -0
- package/dist/permissions/index.d.mts +41 -0
- package/dist/permissions/index.d.ts +41 -0
- package/dist/permissions/index.js +14 -0
- package/dist/permissions/index.js.map +1 -0
- package/dist/permissions/index.mjs +14 -0
- package/dist/permissions/index.mjs.map +1 -0
- package/dist/request-7FE3LJLV.mjs +9 -0
- package/dist/request-7FE3LJLV.mjs.map +1 -0
- package/dist/request-FYMQK5CX.mjs +9 -0
- package/dist/request-FYMQK5CX.mjs.map +1 -0
- package/dist/request-QFS7NEIE.js +9 -0
- package/dist/request-QFS7NEIE.js.map +1 -0
- package/dist/request-ZYY6RI5X.js +9 -0
- package/dist/request-ZYY6RI5X.js.map +1 -0
- package/dist/roles/index.d.mts +33 -0
- package/dist/roles/index.d.ts +33 -0
- package/dist/roles/index.js +12 -0
- package/dist/roles/index.js.map +1 -0
- package/dist/roles/index.mjs +12 -0
- package/dist/roles/index.mjs.map +1 -0
- package/dist/server/index.d.mts +44 -0
- package/dist/server/index.d.ts +44 -0
- package/dist/server/index.js +29 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/index.mjs +29 -0
- package/dist/server/index.mjs.map +1 -0
- package/dist/shadcnui/index.d.mts +698 -0
- package/dist/shadcnui/index.d.ts +698 -0
- package/dist/shadcnui/index.js +466 -0
- package/dist/shadcnui/index.js.map +1 -0
- package/dist/shadcnui/index.mjs +465 -0
- package/dist/shadcnui/index.mjs.map +1 -0
- package/dist/token-IJSPOMW6.mjs +9 -0
- package/dist/token-IJSPOMW6.mjs.map +1 -0
- package/dist/token-MJMC26ON.js +9 -0
- package/dist/token-MJMC26ON.js.map +1 -0
- package/dist/token-UADJQ7VC.mjs +9 -0
- package/dist/token-UADJQ7VC.mjs.map +1 -0
- package/dist/token-UYE7CV6X.js +9 -0
- package/dist/token-UYE7CV6X.js.map +1 -0
- package/dist/types-DluCaP1I.d.ts +95 -0
- package/dist/types-lQVA8d_P.d.mts +95 -0
- package/dist/useDataListRetriever-futhx3OP.d.mts +32 -0
- package/dist/useDataListRetriever-futhx3OP.d.ts +32 -0
- package/dist/user.interface-CAsTIbuQ.d.mts +85 -0
- package/dist/user.interface-CbWqMaaU.d.ts +85 -0
- package/dist/utils/index.d.mts +201 -0
- package/dist/utils/index.d.ts +201 -0
- package/dist/utils/index.js +32 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/index.mjs +32 -0
- package/dist/utils/index.mjs.map +1 -0
- package/package.json +205 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { A as ApiDataInterface, J as JsonApiHydratedDataInterface } from './ApiDataInterface-DPP8s46n.mjs';
|
|
2
|
+
import { A as ApiRequestDataTypeInterface } from './ApiRequestDataTypeInterface-CUKFDBx2.mjs';
|
|
3
|
+
|
|
4
|
+
declare abstract class AbstractApiData implements ApiDataInterface {
|
|
5
|
+
protected _jsonApi?: any;
|
|
6
|
+
protected _included?: any[];
|
|
7
|
+
protected _id?: string;
|
|
8
|
+
protected _type?: string;
|
|
9
|
+
protected _createdAt?: Date;
|
|
10
|
+
protected _updatedAt?: Date;
|
|
11
|
+
protected _self?: string;
|
|
12
|
+
get type(): string;
|
|
13
|
+
get id(): string;
|
|
14
|
+
get self(): string | undefined;
|
|
15
|
+
get createdAt(): Date;
|
|
16
|
+
get updatedAt(): Date;
|
|
17
|
+
get included(): any[];
|
|
18
|
+
get jsonApi(): any;
|
|
19
|
+
ingestJsonApi(_data: JsonApiHydratedDataInterface): void;
|
|
20
|
+
generateApiUrl(_params?: any): string;
|
|
21
|
+
createJsonApi(_data?: any): any;
|
|
22
|
+
protected _readIncluded<T extends ApiDataInterface>(data: JsonApiHydratedDataInterface, type: string, dataType: ApiRequestDataTypeInterface): T | T[] | undefined;
|
|
23
|
+
dehydrate(): JsonApiHydratedDataInterface;
|
|
24
|
+
rehydrate(data: JsonApiHydratedDataInterface): this;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare enum HttpMethod {
|
|
28
|
+
GET = "GET",
|
|
29
|
+
POST = "POST",
|
|
30
|
+
PUT = "PUT",
|
|
31
|
+
PATCH = "PATCH",
|
|
32
|
+
DELETE = "DELETE"
|
|
33
|
+
}
|
|
34
|
+
interface NextRef {
|
|
35
|
+
next?: string;
|
|
36
|
+
}
|
|
37
|
+
interface PreviousRef {
|
|
38
|
+
previous?: string;
|
|
39
|
+
}
|
|
40
|
+
interface SelfRef {
|
|
41
|
+
self?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Set a global error handler for API errors (client-side only).
|
|
45
|
+
* This handler will be called instead of throwing errors.
|
|
46
|
+
*/
|
|
47
|
+
declare function setGlobalErrorHandler(handler: (status: number, message: string) => void): void;
|
|
48
|
+
/**
|
|
49
|
+
* Get the current global error handler.
|
|
50
|
+
*/
|
|
51
|
+
declare function getGlobalErrorHandler(): ((status: number, message: string) => void) | null;
|
|
52
|
+
/**
|
|
53
|
+
* Abstract base class for services that interact with the JSON:API.
|
|
54
|
+
* Extend this class to create feature-specific services.
|
|
55
|
+
*/
|
|
56
|
+
declare abstract class AbstractService {
|
|
57
|
+
/**
|
|
58
|
+
* Extract locale from client-side URL pathname
|
|
59
|
+
* URL structure: /{locale}/route-path (e.g., /it/accounts)
|
|
60
|
+
* Fallback chain: URL locale → navigator.language → "en"
|
|
61
|
+
*/
|
|
62
|
+
private static getClientLocale;
|
|
63
|
+
static next<T>(params: {
|
|
64
|
+
type: ApiRequestDataTypeInterface;
|
|
65
|
+
endpoint: string;
|
|
66
|
+
next?: NextRef;
|
|
67
|
+
previous?: PreviousRef;
|
|
68
|
+
self?: SelfRef;
|
|
69
|
+
}): Promise<T>;
|
|
70
|
+
/**
|
|
71
|
+
* Fetch the previous page of results.
|
|
72
|
+
*/
|
|
73
|
+
static previous<T>(params: {
|
|
74
|
+
type: ApiRequestDataTypeInterface;
|
|
75
|
+
endpoint: string;
|
|
76
|
+
next?: NextRef;
|
|
77
|
+
previous?: PreviousRef;
|
|
78
|
+
self?: SelfRef;
|
|
79
|
+
}): Promise<T>;
|
|
80
|
+
/**
|
|
81
|
+
* Make an API call with automatic environment detection and error handling.
|
|
82
|
+
*/
|
|
83
|
+
protected static callApi<T>(params: {
|
|
84
|
+
type: ApiRequestDataTypeInterface;
|
|
85
|
+
method: HttpMethod;
|
|
86
|
+
endpoint: string;
|
|
87
|
+
companyId?: string;
|
|
88
|
+
input?: any;
|
|
89
|
+
overridesJsonApiCreation?: boolean;
|
|
90
|
+
next?: NextRef;
|
|
91
|
+
previous?: PreviousRef;
|
|
92
|
+
self?: SelfRef;
|
|
93
|
+
responseType?: ApiRequestDataTypeInterface;
|
|
94
|
+
files?: {
|
|
95
|
+
[key: string]: File | Blob;
|
|
96
|
+
} | File | Blob;
|
|
97
|
+
}): Promise<T>;
|
|
98
|
+
/**
|
|
99
|
+
* Get raw JSON:API response data without deserialization.
|
|
100
|
+
*/
|
|
101
|
+
protected static getRawData(params: {
|
|
102
|
+
type: ApiRequestDataTypeInterface;
|
|
103
|
+
method: HttpMethod;
|
|
104
|
+
endpoint: string;
|
|
105
|
+
companyId?: string;
|
|
106
|
+
}): Promise<any>;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export { AbstractApiData as A, HttpMethod as H, type NextRef as N, type PreviousRef as P, type SelfRef as S, AbstractService as a, getGlobalErrorHandler as g, setGlobalErrorHandler as s };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { A as ApiDataInterface, J as JsonApiHydratedDataInterface } from './ApiDataInterface-DPP8s46n.js';
|
|
2
|
+
import { A as ApiRequestDataTypeInterface } from './ApiRequestDataTypeInterface-CUKFDBx2.js';
|
|
3
|
+
|
|
4
|
+
declare abstract class AbstractApiData implements ApiDataInterface {
|
|
5
|
+
protected _jsonApi?: any;
|
|
6
|
+
protected _included?: any[];
|
|
7
|
+
protected _id?: string;
|
|
8
|
+
protected _type?: string;
|
|
9
|
+
protected _createdAt?: Date;
|
|
10
|
+
protected _updatedAt?: Date;
|
|
11
|
+
protected _self?: string;
|
|
12
|
+
get type(): string;
|
|
13
|
+
get id(): string;
|
|
14
|
+
get self(): string | undefined;
|
|
15
|
+
get createdAt(): Date;
|
|
16
|
+
get updatedAt(): Date;
|
|
17
|
+
get included(): any[];
|
|
18
|
+
get jsonApi(): any;
|
|
19
|
+
ingestJsonApi(_data: JsonApiHydratedDataInterface): void;
|
|
20
|
+
generateApiUrl(_params?: any): string;
|
|
21
|
+
createJsonApi(_data?: any): any;
|
|
22
|
+
protected _readIncluded<T extends ApiDataInterface>(data: JsonApiHydratedDataInterface, type: string, dataType: ApiRequestDataTypeInterface): T | T[] | undefined;
|
|
23
|
+
dehydrate(): JsonApiHydratedDataInterface;
|
|
24
|
+
rehydrate(data: JsonApiHydratedDataInterface): this;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare enum HttpMethod {
|
|
28
|
+
GET = "GET",
|
|
29
|
+
POST = "POST",
|
|
30
|
+
PUT = "PUT",
|
|
31
|
+
PATCH = "PATCH",
|
|
32
|
+
DELETE = "DELETE"
|
|
33
|
+
}
|
|
34
|
+
interface NextRef {
|
|
35
|
+
next?: string;
|
|
36
|
+
}
|
|
37
|
+
interface PreviousRef {
|
|
38
|
+
previous?: string;
|
|
39
|
+
}
|
|
40
|
+
interface SelfRef {
|
|
41
|
+
self?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Set a global error handler for API errors (client-side only).
|
|
45
|
+
* This handler will be called instead of throwing errors.
|
|
46
|
+
*/
|
|
47
|
+
declare function setGlobalErrorHandler(handler: (status: number, message: string) => void): void;
|
|
48
|
+
/**
|
|
49
|
+
* Get the current global error handler.
|
|
50
|
+
*/
|
|
51
|
+
declare function getGlobalErrorHandler(): ((status: number, message: string) => void) | null;
|
|
52
|
+
/**
|
|
53
|
+
* Abstract base class for services that interact with the JSON:API.
|
|
54
|
+
* Extend this class to create feature-specific services.
|
|
55
|
+
*/
|
|
56
|
+
declare abstract class AbstractService {
|
|
57
|
+
/**
|
|
58
|
+
* Extract locale from client-side URL pathname
|
|
59
|
+
* URL structure: /{locale}/route-path (e.g., /it/accounts)
|
|
60
|
+
* Fallback chain: URL locale → navigator.language → "en"
|
|
61
|
+
*/
|
|
62
|
+
private static getClientLocale;
|
|
63
|
+
static next<T>(params: {
|
|
64
|
+
type: ApiRequestDataTypeInterface;
|
|
65
|
+
endpoint: string;
|
|
66
|
+
next?: NextRef;
|
|
67
|
+
previous?: PreviousRef;
|
|
68
|
+
self?: SelfRef;
|
|
69
|
+
}): Promise<T>;
|
|
70
|
+
/**
|
|
71
|
+
* Fetch the previous page of results.
|
|
72
|
+
*/
|
|
73
|
+
static previous<T>(params: {
|
|
74
|
+
type: ApiRequestDataTypeInterface;
|
|
75
|
+
endpoint: string;
|
|
76
|
+
next?: NextRef;
|
|
77
|
+
previous?: PreviousRef;
|
|
78
|
+
self?: SelfRef;
|
|
79
|
+
}): Promise<T>;
|
|
80
|
+
/**
|
|
81
|
+
* Make an API call with automatic environment detection and error handling.
|
|
82
|
+
*/
|
|
83
|
+
protected static callApi<T>(params: {
|
|
84
|
+
type: ApiRequestDataTypeInterface;
|
|
85
|
+
method: HttpMethod;
|
|
86
|
+
endpoint: string;
|
|
87
|
+
companyId?: string;
|
|
88
|
+
input?: any;
|
|
89
|
+
overridesJsonApiCreation?: boolean;
|
|
90
|
+
next?: NextRef;
|
|
91
|
+
previous?: PreviousRef;
|
|
92
|
+
self?: SelfRef;
|
|
93
|
+
responseType?: ApiRequestDataTypeInterface;
|
|
94
|
+
files?: {
|
|
95
|
+
[key: string]: File | Blob;
|
|
96
|
+
} | File | Blob;
|
|
97
|
+
}): Promise<T>;
|
|
98
|
+
/**
|
|
99
|
+
* Get raw JSON:API response data without deserialization.
|
|
100
|
+
*/
|
|
101
|
+
protected static getRawData(params: {
|
|
102
|
+
type: ApiRequestDataTypeInterface;
|
|
103
|
+
method: HttpMethod;
|
|
104
|
+
endpoint: string;
|
|
105
|
+
companyId?: string;
|
|
106
|
+
}): Promise<any>;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export { AbstractApiData as A, HttpMethod as H, type NextRef as N, type PreviousRef as P, type SelfRef as S, AbstractService as a, getGlobalErrorHandler as g, setGlobalErrorHandler as s };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
interface JsonApiHydratedDataInterface {
|
|
2
|
+
jsonApi: any;
|
|
3
|
+
included: any[];
|
|
4
|
+
allData?: any[];
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
interface ApiDataInterface {
|
|
8
|
+
get included(): any[];
|
|
9
|
+
get type(): string;
|
|
10
|
+
get id(): string;
|
|
11
|
+
get createdAt(): Date;
|
|
12
|
+
get updatedAt(): Date;
|
|
13
|
+
get self(): string | undefined;
|
|
14
|
+
get jsonApi(): any;
|
|
15
|
+
generateApiUrl(params?: any): string;
|
|
16
|
+
dehydrate(): JsonApiHydratedDataInterface;
|
|
17
|
+
rehydrate(data: JsonApiHydratedDataInterface): this;
|
|
18
|
+
createJsonApi(data: any): any;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type { ApiDataInterface as A, JsonApiHydratedDataInterface as J };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
interface JsonApiHydratedDataInterface {
|
|
2
|
+
jsonApi: any;
|
|
3
|
+
included: any[];
|
|
4
|
+
allData?: any[];
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
interface ApiDataInterface {
|
|
8
|
+
get included(): any[];
|
|
9
|
+
get type(): string;
|
|
10
|
+
get id(): string;
|
|
11
|
+
get createdAt(): Date;
|
|
12
|
+
get updatedAt(): Date;
|
|
13
|
+
get self(): string | undefined;
|
|
14
|
+
get jsonApi(): any;
|
|
15
|
+
generateApiUrl(params?: any): string;
|
|
16
|
+
dehydrate(): JsonApiHydratedDataInterface;
|
|
17
|
+
rehydrate(data: JsonApiHydratedDataInterface): this;
|
|
18
|
+
createJsonApi(data: any): any;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type { ApiDataInterface as A, JsonApiHydratedDataInterface as J };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type GetterKeys<T> = {
|
|
2
|
+
[K in keyof T]: T[K] extends () => any ? never : K;
|
|
3
|
+
}[keyof T];
|
|
4
|
+
type FieldSelector<T> = {
|
|
5
|
+
type: string;
|
|
6
|
+
fields: ReadonlyArray<GetterKeys<T>>;
|
|
7
|
+
};
|
|
8
|
+
declare function createJsonApiInclusion<T>(dataType: string, fields: ReadonlyArray<GetterKeys<T>>): FieldSelector<T>;
|
|
9
|
+
|
|
10
|
+
type ApiRequestDataTypeInterface = {
|
|
11
|
+
name: string;
|
|
12
|
+
cache?: string;
|
|
13
|
+
inclusions?: Record<string, {
|
|
14
|
+
types?: string[];
|
|
15
|
+
fields?: FieldSelector<any>[];
|
|
16
|
+
}>;
|
|
17
|
+
model: new () => any;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { type ApiRequestDataTypeInterface as A, type FieldSelector as F, type GetterKeys as G, createJsonApiInclusion as c };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type GetterKeys<T> = {
|
|
2
|
+
[K in keyof T]: T[K] extends () => any ? never : K;
|
|
3
|
+
}[keyof T];
|
|
4
|
+
type FieldSelector<T> = {
|
|
5
|
+
type: string;
|
|
6
|
+
fields: ReadonlyArray<GetterKeys<T>>;
|
|
7
|
+
};
|
|
8
|
+
declare function createJsonApiInclusion<T>(dataType: string, fields: ReadonlyArray<GetterKeys<T>>): FieldSelector<T>;
|
|
9
|
+
|
|
10
|
+
type ApiRequestDataTypeInterface = {
|
|
11
|
+
name: string;
|
|
12
|
+
cache?: string;
|
|
13
|
+
inclusions?: Record<string, {
|
|
14
|
+
types?: string[];
|
|
15
|
+
fields?: FieldSelector<any>[];
|
|
16
|
+
}>;
|
|
17
|
+
model: new () => any;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { type ApiRequestDataTypeInterface as A, type FieldSelector as F, type GetterKeys as G, createJsonApiInclusion as c };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { A as ApiDataInterface } from './ApiDataInterface-DPP8s46n.mjs';
|
|
2
|
+
|
|
3
|
+
interface ApiResponseInterface {
|
|
4
|
+
ok: boolean;
|
|
5
|
+
response: number;
|
|
6
|
+
raw?: any;
|
|
7
|
+
self?: string;
|
|
8
|
+
next?: string;
|
|
9
|
+
prev?: string;
|
|
10
|
+
nextPage?: () => Promise<ApiResponseInterface>;
|
|
11
|
+
prevPage?: () => Promise<ApiResponseInterface>;
|
|
12
|
+
data: ApiDataInterface | ApiDataInterface[];
|
|
13
|
+
error: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type { ApiResponseInterface as A };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { A as ApiDataInterface } from './ApiDataInterface-DPP8s46n.js';
|
|
2
|
+
|
|
3
|
+
interface ApiResponseInterface {
|
|
4
|
+
ok: boolean;
|
|
5
|
+
response: number;
|
|
6
|
+
raw?: any;
|
|
7
|
+
self?: string;
|
|
8
|
+
next?: string;
|
|
9
|
+
prev?: string;
|
|
10
|
+
nextPage?: () => Promise<ApiResponseInterface>;
|
|
11
|
+
prevPage?: () => Promise<ApiResponseInterface>;
|
|
12
|
+
data: ApiDataInterface | ApiDataInterface[];
|
|
13
|
+
error: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type { ApiResponseInterface as A };
|