@data-client/rest 0.1.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/LICENSE +201 -0
- package/README.md +110 -0
- package/dist/index.js +561 -0
- package/dist/index.umd.min.js +1 -0
- package/dist/next.js +520 -0
- package/dist/package.json +1 -0
- package/legacy/NetworkError.js +13 -0
- package/legacy/OptionsToFunction.js +2 -0
- package/legacy/RestEndpoint.js +225 -0
- package/legacy/RestEndpointTypeHelp.js +2 -0
- package/legacy/RestHelpers.js +33 -0
- package/legacy/createResource.js +88 -0
- package/legacy/extractCollection.js +14 -0
- package/legacy/getArrayPath.js +19 -0
- package/legacy/hookifyResource.js +24 -0
- package/legacy/index.js +10 -0
- package/legacy/mapCollection.js +14 -0
- package/legacy/next/OptionsToFunction.js +2 -0
- package/legacy/next/RestEndpoint.js +225 -0
- package/legacy/next/createResource.js +86 -0
- package/legacy/next/index.js +4 -0
- package/legacy/next/resourceTypes.js +2 -0
- package/legacy/paginatedCollections.js +29 -0
- package/legacy/paginationUpdate.js +36 -0
- package/legacy/paramsToString.js +6 -0
- package/legacy/paramsToString.native.js +9 -0
- package/legacy/pathTypes.js +2 -0
- package/legacy/test-fixtures.js +111 -0
- package/legacy/utiltypes.js +2 -0
- package/lib/NetworkError.d.ts +11 -0
- package/lib/NetworkError.d.ts.map +1 -0
- package/lib/NetworkError.js +13 -0
- package/lib/OptionsToFunction.d.ts +7 -0
- package/lib/OptionsToFunction.d.ts.map +1 -0
- package/lib/OptionsToFunction.js +2 -0
- package/lib/RestEndpoint.d.ts +548 -0
- package/lib/RestEndpoint.js +229 -0
- package/lib/RestEndpointTypeHelp.d.ts +10 -0
- package/lib/RestEndpointTypeHelp.d.ts.map +1 -0
- package/lib/RestEndpointTypeHelp.js +2 -0
- package/lib/RestHelpers.d.ts +7 -0
- package/lib/RestHelpers.d.ts.map +1 -0
- package/lib/RestHelpers.js +33 -0
- package/lib/createResource.d.ts +66 -0
- package/lib/createResource.d.ts.map +1 -0
- package/lib/createResource.js +104 -0
- package/lib/extractCollection.d.ts +11 -0
- package/lib/extractCollection.d.ts.map +1 -0
- package/lib/extractCollection.js +16 -0
- package/lib/getArrayPath.d.ts +3 -0
- package/lib/getArrayPath.d.ts.map +1 -0
- package/lib/getArrayPath.js +19 -0
- package/lib/hookifyResource.d.ts +14 -0
- package/lib/hookifyResource.d.ts.map +1 -0
- package/lib/hookifyResource.js +24 -0
- package/lib/index.d.ts +12 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +10 -0
- package/lib/mapCollection.d.ts +16 -0
- package/lib/mapCollection.d.ts.map +1 -0
- package/lib/mapCollection.js +16 -0
- package/lib/next/OptionsToFunction.d.ts +7 -0
- package/lib/next/OptionsToFunction.d.ts.map +1 -0
- package/lib/next/OptionsToFunction.js +2 -0
- package/lib/next/RestEndpoint.d.ts +542 -0
- package/lib/next/RestEndpoint.js +229 -0
- package/lib/next/createResource.d.ts +86 -0
- package/lib/next/createResource.d.ts.map +1 -0
- package/lib/next/createResource.js +100 -0
- package/lib/next/index.d.ts +6 -0
- package/lib/next/index.d.ts.map +1 -0
- package/lib/next/index.js +4 -0
- package/lib/next/resourceTypes.d.ts +31 -0
- package/lib/next/resourceTypes.d.ts.map +1 -0
- package/lib/next/resourceTypes.js +2 -0
- package/lib/paginatedCollections.d.ts +3 -0
- package/lib/paginatedCollections.d.ts.map +1 -0
- package/lib/paginatedCollections.js +29 -0
- package/lib/paginationUpdate.d.ts +8 -0
- package/lib/paginationUpdate.d.ts.map +1 -0
- package/lib/paginationUpdate.js +40 -0
- package/lib/paramsToString.d.ts +2 -0
- package/lib/paramsToString.d.ts.map +1 -0
- package/lib/paramsToString.js +6 -0
- package/lib/paramsToString.native.d.ts +2 -0
- package/lib/paramsToString.native.d.ts.map +1 -0
- package/lib/paramsToString.native.js +9 -0
- package/lib/pathTypes.d.ts +20 -0
- package/lib/pathTypes.d.ts.map +1 -0
- package/lib/pathTypes.js +2 -0
- package/lib/test-fixtures.d.ts +141 -0
- package/lib/test-fixtures.d.ts.map +1 -0
- package/lib/test-fixtures.js +111 -0
- package/lib/utiltypes.d.ts +21 -0
- package/lib/utiltypes.d.ts.map +1 -0
- package/lib/utiltypes.js +2 -0
- package/node.mjs +1 -0
- package/package.json +121 -0
- package/src/NetworkError.ts +17 -0
- package/src/OptionsToFunction.ts +42 -0
- package/src/RestEndpoint.d.ts +548 -0
- package/src/RestEndpoint.js +262 -0
- package/src/RestEndpointTypeHelp.ts +20 -0
- package/src/RestHelpers.ts +48 -0
- package/src/__tests__/Resource.test.ts +317 -0
- package/src/__tests__/RestEndpoint.ts +1304 -0
- package/src/__tests__/__snapshots__/RestEndpoint.ts.snap +18 -0
- package/src/__tests__/__snapshots__/createResource.test.ts.snap +5 -0
- package/src/__tests__/createResource.test.ts +583 -0
- package/src/__tests__/getArrayPath.test.ts +30 -0
- package/src/__tests__/hookifyResource.ts +197 -0
- package/src/__tests__/types.test.ts +309 -0
- package/src/createResource.ts +172 -0
- package/src/extractCollection.ts +34 -0
- package/src/getArrayPath.ts +20 -0
- package/src/hookifyResource.ts +36 -0
- package/src/index.ts +42 -0
- package/src/mapCollection.ts +54 -0
- package/src/next/OptionsToFunction.ts +41 -0
- package/src/next/RestEndpoint.d.ts +542 -0
- package/src/next/RestEndpoint.js +262 -0
- package/src/next/__tests__/RestEndpoint.ts +1333 -0
- package/src/next/__tests__/__snapshots__/RestEndpoint.ts.snap +18 -0
- package/src/next/__tests__/types.test.ts +429 -0
- package/src/next/createResource.ts +194 -0
- package/src/next/index.ts +5 -0
- package/src/next/resourceTypes.ts +32 -0
- package/src/package.json +1 -0
- package/src/paginatedCollections.ts +32 -0
- package/src/paginationUpdate.ts +49 -0
- package/src/paramsToString.native.ts +10 -0
- package/src/paramsToString.ts +7 -0
- package/src/pathTypes.ts +58 -0
- package/src/test-fixtures.ts +128 -0
- package/src/utiltypes.ts +25 -0
- package/ts4.0/NetworkError.d.ts +11 -0
- package/ts4.0/OptionsToFunction.d.ts +16 -0
- package/ts4.0/RestEndpoint.d.ts +240 -0
- package/ts4.0/RestEndpointTypeHelp.d.ts +10 -0
- package/ts4.0/RestHelpers.d.ts +7 -0
- package/ts4.0/createResource.d.ts +66 -0
- package/ts4.0/extractCollection.d.ts +11 -0
- package/ts4.0/getArrayPath.d.ts +3 -0
- package/ts4.0/hookifyResource.d.ts +19 -0
- package/ts4.0/index.d.ts +12 -0
- package/ts4.0/mapCollection.d.ts +16 -0
- package/ts4.0/next/OptionsToFunction.d.ts +16 -0
- package/ts4.0/next/RestEndpoint.d.ts +226 -0
- package/ts4.0/next/createResource.d.ts +94 -0
- package/ts4.0/next/index.d.ts +6 -0
- package/ts4.0/next/resourceTypes.d.ts +31 -0
- package/ts4.0/paginatedCollections.d.ts +3 -0
- package/ts4.0/paginationUpdate.d.ts +10 -0
- package/ts4.0/paramsToString.d.ts +2 -0
- package/ts4.0/paramsToString.native.d.ts +2 -0
- package/ts4.0/pathTypes.d.ts +20 -0
- package/ts4.0/test-fixtures.d.ts +141 -0
- package/ts4.0/utiltypes.d.ts +5 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
export declare const payload: {
|
|
2
|
+
id: number;
|
|
3
|
+
title: string;
|
|
4
|
+
content: string;
|
|
5
|
+
tags: string[];
|
|
6
|
+
};
|
|
7
|
+
export declare const createPayload: {
|
|
8
|
+
id: number;
|
|
9
|
+
title: string;
|
|
10
|
+
content: string;
|
|
11
|
+
tags: string[];
|
|
12
|
+
};
|
|
13
|
+
export declare const articlesPages: {
|
|
14
|
+
prevPage: string;
|
|
15
|
+
nextPage: string;
|
|
16
|
+
results: ({
|
|
17
|
+
id: number;
|
|
18
|
+
title: string;
|
|
19
|
+
content: string;
|
|
20
|
+
tags: string[];
|
|
21
|
+
} | {
|
|
22
|
+
id: number;
|
|
23
|
+
title: string;
|
|
24
|
+
content: string;
|
|
25
|
+
tags?: undefined;
|
|
26
|
+
})[];
|
|
27
|
+
};
|
|
28
|
+
export declare const users: {
|
|
29
|
+
id: number;
|
|
30
|
+
username: string;
|
|
31
|
+
email: string;
|
|
32
|
+
isAdmin: boolean;
|
|
33
|
+
}[];
|
|
34
|
+
export declare const nested: ({
|
|
35
|
+
id: number;
|
|
36
|
+
title: string;
|
|
37
|
+
content: string;
|
|
38
|
+
tags: string[];
|
|
39
|
+
author: {
|
|
40
|
+
id: number;
|
|
41
|
+
username: string;
|
|
42
|
+
email?: undefined;
|
|
43
|
+
};
|
|
44
|
+
} | {
|
|
45
|
+
id: number;
|
|
46
|
+
title: string;
|
|
47
|
+
content: string;
|
|
48
|
+
author: {
|
|
49
|
+
id: number;
|
|
50
|
+
username: string;
|
|
51
|
+
email: string;
|
|
52
|
+
};
|
|
53
|
+
tags?: undefined;
|
|
54
|
+
})[];
|
|
55
|
+
export declare const moreNested: ({
|
|
56
|
+
id: number;
|
|
57
|
+
title: string;
|
|
58
|
+
content: string;
|
|
59
|
+
tags: string[];
|
|
60
|
+
author: {
|
|
61
|
+
id: number;
|
|
62
|
+
username: string;
|
|
63
|
+
email?: undefined;
|
|
64
|
+
};
|
|
65
|
+
} | {
|
|
66
|
+
id: number;
|
|
67
|
+
title: string;
|
|
68
|
+
content: string;
|
|
69
|
+
author: {
|
|
70
|
+
id: number;
|
|
71
|
+
username: string;
|
|
72
|
+
email: string;
|
|
73
|
+
};
|
|
74
|
+
tags?: undefined;
|
|
75
|
+
})[];
|
|
76
|
+
export declare const valuesFixture: {
|
|
77
|
+
first: {
|
|
78
|
+
id: number;
|
|
79
|
+
title: string;
|
|
80
|
+
content: string;
|
|
81
|
+
tags: never[];
|
|
82
|
+
};
|
|
83
|
+
second: {
|
|
84
|
+
id: number;
|
|
85
|
+
name: string;
|
|
86
|
+
content: string;
|
|
87
|
+
tags: never[];
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
export declare const paginatedFirstPage: {
|
|
91
|
+
nextPage: string;
|
|
92
|
+
data: {
|
|
93
|
+
results: ({
|
|
94
|
+
id: number;
|
|
95
|
+
title: string;
|
|
96
|
+
content: string;
|
|
97
|
+
tags: string[];
|
|
98
|
+
author: {
|
|
99
|
+
id: number;
|
|
100
|
+
username: string;
|
|
101
|
+
email?: undefined;
|
|
102
|
+
};
|
|
103
|
+
} | {
|
|
104
|
+
id: number;
|
|
105
|
+
title: string;
|
|
106
|
+
content: string;
|
|
107
|
+
author: {
|
|
108
|
+
id: number;
|
|
109
|
+
username: string;
|
|
110
|
+
email: string;
|
|
111
|
+
};
|
|
112
|
+
tags?: undefined;
|
|
113
|
+
})[];
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
export declare const paginatedSecondPage: {
|
|
117
|
+
data: {
|
|
118
|
+
results: ({
|
|
119
|
+
id: number;
|
|
120
|
+
title: string;
|
|
121
|
+
content: string;
|
|
122
|
+
tags: string[];
|
|
123
|
+
author: {
|
|
124
|
+
id: number;
|
|
125
|
+
username: string;
|
|
126
|
+
email?: undefined;
|
|
127
|
+
};
|
|
128
|
+
} | {
|
|
129
|
+
id: number;
|
|
130
|
+
title: string;
|
|
131
|
+
content: string;
|
|
132
|
+
author: {
|
|
133
|
+
id: number;
|
|
134
|
+
username: string;
|
|
135
|
+
email: string;
|
|
136
|
+
};
|
|
137
|
+
tags?: undefined;
|
|
138
|
+
})[];
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
//# sourceMappingURL=test-fixtures.d.ts.map
|