@geekmidas/client 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.
Files changed (51) hide show
  1. package/README.md +518 -0
  2. package/dist/chunk-CUT6urMc.cjs +30 -0
  3. package/dist/fetcher-DLDD_7Sa.mjs +86 -0
  4. package/dist/fetcher-DLDD_7Sa.mjs.map +1 -0
  5. package/dist/fetcher-KdwHgdAl.cjs +98 -0
  6. package/dist/fetcher-KdwHgdAl.cjs.map +1 -0
  7. package/dist/fetcher.cjs +4 -0
  8. package/dist/fetcher.d.cts +18 -0
  9. package/dist/fetcher.d.mts +18 -0
  10. package/dist/fetcher.mjs +3 -0
  11. package/dist/openapi-hooks.cjs +44 -0
  12. package/dist/openapi-hooks.cjs.map +1 -0
  13. package/dist/openapi-hooks.d.cts +99 -0
  14. package/dist/openapi-hooks.d.mts +99 -0
  15. package/dist/openapi-hooks.mjs +43 -0
  16. package/dist/openapi-hooks.mjs.map +1 -0
  17. package/dist/openapi-types.d.cjs +0 -0
  18. package/dist/openapi-types.d.cts +443 -0
  19. package/dist/openapi-types.d.mts +443 -0
  20. package/dist/openapi.cjs +526 -0
  21. package/dist/openapi.cjs.map +1 -0
  22. package/dist/openapi.mjs +501 -0
  23. package/dist/openapi.mjs.map +1 -0
  24. package/dist/react-query.cjs +147 -0
  25. package/dist/react-query.cjs.map +1 -0
  26. package/dist/react-query.d.cts +77 -0
  27. package/dist/react-query.d.mts +77 -0
  28. package/dist/react-query.mjs +141 -0
  29. package/dist/react-query.mjs.map +1 -0
  30. package/dist/types-csACmD6U.d.cts +68 -0
  31. package/dist/types-tMp85Lt_.d.mts +68 -0
  32. package/dist/types.cjs +0 -0
  33. package/dist/types.d.cts +2 -0
  34. package/dist/types.d.mts +2 -0
  35. package/dist/types.mjs +0 -0
  36. package/package.json +59 -0
  37. package/src/__tests__/fetcher.spec.ts +409 -0
  38. package/src/__tests__/method-restrictions.spec.tsx +227 -0
  39. package/src/__tests__/openapi-hooks.spec.tsx +558 -0
  40. package/src/__tests__/react-query-infinite.spec.tsx +1003 -0
  41. package/src/__tests__/react-query-invalidation.spec.tsx +238 -0
  42. package/src/__tests__/react-query.spec.tsx +582 -0
  43. package/src/__tests__/setup.ts +281 -0
  44. package/src/__tests__/types.spec.ts +134 -0
  45. package/src/__tests__/url-parsing.spec.ts +196 -0
  46. package/src/fetcher.ts +173 -0
  47. package/src/openapi-hooks.ts +193 -0
  48. package/src/openapi-types.d.ts +440 -0
  49. package/src/openapi.json +595 -0
  50. package/src/react-query.ts +341 -0
  51. package/src/types.ts +149 -0
@@ -0,0 +1,440 @@
1
+ /**
2
+ * This file should be auto-generated by openapi-typescript.
3
+ * Run: npx openapi-typescript <your-openapi-spec> -o ./openapi-types.d.ts
4
+ *
5
+ * This is a placeholder file showing the expected structure.
6
+ */
7
+
8
+ export interface paths {
9
+ '/job/{id}': {
10
+ parameters: {
11
+ query?: never;
12
+ header?: never;
13
+ path?: never;
14
+ cookie?: never;
15
+ };
16
+ get: {
17
+ operationId: 'getJob';
18
+ parameters: {
19
+ query?: never;
20
+ header?: never;
21
+ path: {
22
+ id: string;
23
+ };
24
+ cookie?: never;
25
+ };
26
+ requestBody?: never;
27
+ responses: {
28
+ /** @description Successful response */
29
+ 200: {
30
+ headers: {
31
+ [name: string]: unknown;
32
+ };
33
+ content: {
34
+ 'application/json': {
35
+ role: string;
36
+ overview: string;
37
+ qualifications: string;
38
+ hourlyRate: {
39
+ max: number;
40
+ min: number;
41
+ };
42
+ dateNeeded: {
43
+ from: string;
44
+ to: string;
45
+ };
46
+ shiftHours: {
47
+ from: string;
48
+ to: string;
49
+ };
50
+ /** Format: uuid */
51
+ id: string;
52
+ /** Format: date-time */
53
+ createdAt: string;
54
+ /** Format: date-time */
55
+ updatedAt: string;
56
+ /** Format: uuid */
57
+ businessId: string;
58
+ /** Format: uuid */
59
+ creatorId: string;
60
+ /** @enum {string} */
61
+ status: 'Draft' | 'Active' | 'Closed' | 'Filled';
62
+ };
63
+ };
64
+ };
65
+ };
66
+ };
67
+ put: {
68
+ operationId: 'updateJob';
69
+ parameters: {
70
+ query?: never;
71
+ header?: never;
72
+ path: {
73
+ id: string;
74
+ };
75
+ cookie?: never;
76
+ };
77
+ requestBody: {
78
+ content: {
79
+ 'application/json': {
80
+ role?: string;
81
+ overview?: string;
82
+ qualifications?: string;
83
+ hourlyRate?: {
84
+ max: number;
85
+ min: number;
86
+ };
87
+ dateNeeded?: {
88
+ from: string;
89
+ to: string;
90
+ };
91
+ shiftHours?: {
92
+ from: string;
93
+ to: string;
94
+ };
95
+ /** @enum {string} */
96
+ status?: 'Draft' | 'Active' | 'Closed' | 'Filled';
97
+ };
98
+ };
99
+ };
100
+ responses: {
101
+ /** @description Successful response */
102
+ 200: {
103
+ headers: {
104
+ [name: string]: unknown;
105
+ };
106
+ content: {
107
+ 'application/json': {
108
+ role: string;
109
+ overview: string;
110
+ qualifications: string;
111
+ hourlyRate: {
112
+ max: number;
113
+ min: number;
114
+ };
115
+ dateNeeded: {
116
+ from: string;
117
+ to: string;
118
+ };
119
+ shiftHours: {
120
+ from: string;
121
+ to: string;
122
+ };
123
+ /** Format: uuid */
124
+ id: string;
125
+ /** Format: date-time */
126
+ createdAt: string;
127
+ /** Format: date-time */
128
+ updatedAt: string;
129
+ /** Format: uuid */
130
+ businessId: string;
131
+ /** Format: uuid */
132
+ creatorId: string;
133
+ /** @enum {string} */
134
+ status: 'Draft' | 'Active' | 'Closed' | 'Filled';
135
+ };
136
+ };
137
+ };
138
+ };
139
+ };
140
+ post?: never;
141
+ delete: {
142
+ operationId: 'deleteJob';
143
+ parameters: {
144
+ query?: never;
145
+ header?: never;
146
+ path: {
147
+ id: string;
148
+ };
149
+ cookie?: never;
150
+ };
151
+ requestBody?: never;
152
+ responses: {
153
+ /** @description Successful response */
154
+ 200: {
155
+ headers: {
156
+ [name: string]: unknown;
157
+ };
158
+ content: {
159
+ 'application/json': {
160
+ message: string;
161
+ /** Format: uuid */
162
+ id: string;
163
+ };
164
+ };
165
+ };
166
+ };
167
+ };
168
+ options?: never;
169
+ head?: never;
170
+ patch?: never;
171
+ trace?: never;
172
+ };
173
+ '/users': {
174
+ get: {
175
+ operationId: 'listUsers';
176
+ parameters: {
177
+ query: {
178
+ page?: number;
179
+ limit?: number;
180
+ sort?: 'asc' | 'desc';
181
+ };
182
+ };
183
+ responses: {
184
+ 200: {
185
+ content: {
186
+ 'application/json': {
187
+ users: Array<{
188
+ id: string;
189
+ name: string;
190
+ email: string;
191
+ }>;
192
+ };
193
+ };
194
+ };
195
+ };
196
+ };
197
+ post: {
198
+ operationId: 'createUser';
199
+ requestBody: {
200
+ content: {
201
+ 'application/json': {
202
+ name: string;
203
+ email: string;
204
+ };
205
+ };
206
+ };
207
+ responses: {
208
+ 201: {
209
+ content: {
210
+ 'application/json': {
211
+ id: string;
212
+ name: string;
213
+ email: string;
214
+ };
215
+ };
216
+ };
217
+ };
218
+ };
219
+ };
220
+ '/users/{id}': {
221
+ parameters: {
222
+ path: {
223
+ id: string;
224
+ };
225
+ };
226
+ get: {
227
+ operationId: 'getUser';
228
+ responses: {
229
+ 200: {
230
+ content: {
231
+ 'application/json': {
232
+ id: string;
233
+ name: string;
234
+ email: string;
235
+ };
236
+ };
237
+ };
238
+ };
239
+ };
240
+ put: {
241
+ operationId: 'updateUser';
242
+ requestBody: {
243
+ content: {
244
+ 'application/json': {
245
+ name?: string;
246
+ email?: string;
247
+ };
248
+ };
249
+ };
250
+ responses: {
251
+ 200: {
252
+ content: {
253
+ 'application/json': {
254
+ id: string;
255
+ name: string;
256
+ email: string;
257
+ };
258
+ };
259
+ };
260
+ };
261
+ };
262
+ delete: {
263
+ operationId: 'deleteUser';
264
+ responses: {
265
+ 204: {
266
+ content: never;
267
+ };
268
+ };
269
+ };
270
+ };
271
+ '/posts': {
272
+ get: {
273
+ operationId: 'listPosts';
274
+ parameters: {
275
+ query: {
276
+ page?: number;
277
+ limit?: number;
278
+ sort?: 'asc' | 'desc';
279
+ };
280
+ };
281
+ responses: {
282
+ 200: {
283
+ content: {
284
+ 'application/json': {
285
+ posts: Array<{
286
+ id: string;
287
+ title: string;
288
+ content: string;
289
+ authorId: string;
290
+ createdAt: string;
291
+ }>;
292
+ pagination: {
293
+ page: number;
294
+ limit: number;
295
+ total: number;
296
+ };
297
+ sort: 'asc' | 'desc';
298
+ };
299
+ };
300
+ };
301
+ };
302
+ };
303
+ };
304
+ '/protected': {
305
+ get: {
306
+ operationId: 'getProtected';
307
+ responses: {
308
+ 200: {
309
+ content: {
310
+ 'application/json': {
311
+ message: string;
312
+ };
313
+ };
314
+ };
315
+ 401: {
316
+ content: {
317
+ 'application/json': {
318
+ message: string;
319
+ };
320
+ };
321
+ };
322
+ };
323
+ };
324
+ };
325
+ '/error': {
326
+ get: {
327
+ operationId: 'getError';
328
+ responses: {
329
+ 500: {
330
+ content: {
331
+ 'application/json': {
332
+ message: string;
333
+ };
334
+ };
335
+ };
336
+ };
337
+ };
338
+ };
339
+ '/users/paginated': {
340
+ get: {
341
+ operationId: 'getUsersPaginated';
342
+ parameters: {
343
+ query: {
344
+ page?: number;
345
+ limit?: number;
346
+ };
347
+ };
348
+ responses: {
349
+ 200: {
350
+ content: {
351
+ 'application/json': {
352
+ users: Array<{
353
+ id: string;
354
+ name: string;
355
+ email: string;
356
+ }>;
357
+ pagination: {
358
+ page: number;
359
+ limit: number;
360
+ total: number;
361
+ hasMore: boolean;
362
+ };
363
+ };
364
+ };
365
+ };
366
+ };
367
+ };
368
+ };
369
+ '/messages': {
370
+ get: {
371
+ operationId: 'getMessages';
372
+ parameters: {
373
+ query: {
374
+ cursor?: string;
375
+ limit?: number;
376
+ };
377
+ };
378
+ responses: {
379
+ 200: {
380
+ content: {
381
+ 'application/json': {
382
+ messages: Array<{
383
+ id: string;
384
+ text: string;
385
+ timestamp: string;
386
+ }>;
387
+ nextCursor: string | null;
388
+ };
389
+ };
390
+ };
391
+ };
392
+ };
393
+ };
394
+ '/echo': {
395
+ get: {
396
+ operationId: 'echo';
397
+ parameters: {
398
+ query: {
399
+ [key: string]: string | number | boolean;
400
+ };
401
+ };
402
+ responses: {
403
+ 200: {
404
+ content: {
405
+ 'application/json': {
406
+ queryParams: Record<string, string>;
407
+ data: Array<{
408
+ id: string;
409
+ value: string;
410
+ }>;
411
+ pagination: {
412
+ page: number;
413
+ limit: number;
414
+ total: number;
415
+ hasMore: boolean;
416
+ };
417
+ };
418
+ };
419
+ };
420
+ };
421
+ };
422
+ };
423
+ }
424
+
425
+ export interface components {
426
+ schemas: {
427
+ User: {
428
+ id: string;
429
+ name: string;
430
+ email: string;
431
+ };
432
+ Post: {
433
+ id: string;
434
+ title: string;
435
+ content: string;
436
+ authorId: string;
437
+ createdAt: string;
438
+ };
439
+ };
440
+ }