@geekmidas/client 0.4.0 → 0.5.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.
Files changed (71) hide show
  1. package/dist/auth-fetcher.cjs +0 -1
  2. package/dist/auth-fetcher.cjs.map +1 -1
  3. package/dist/auth-fetcher.d.cts +1 -1
  4. package/dist/auth-fetcher.d.cts.map +1 -1
  5. package/dist/auth-fetcher.d.mts +1 -1
  6. package/dist/auth-fetcher.d.mts.map +1 -1
  7. package/dist/auth-fetcher.mjs +0 -1
  8. package/dist/auth-fetcher.mjs.map +1 -1
  9. package/dist/endpoint-hooks.cjs +10 -5
  10. package/dist/endpoint-hooks.cjs.map +1 -1
  11. package/dist/endpoint-hooks.d.cts +2 -2
  12. package/dist/endpoint-hooks.d.cts.map +1 -1
  13. package/dist/endpoint-hooks.d.mts +2 -2
  14. package/dist/endpoint-hooks.d.mts.map +1 -1
  15. package/dist/endpoint-hooks.mjs +10 -5
  16. package/dist/endpoint-hooks.mjs.map +1 -1
  17. package/dist/fetcher-5fnBE7Dk.mjs.map +1 -1
  18. package/dist/fetcher-CgLEaIAC.cjs.map +1 -1
  19. package/dist/fetcher.d.cts +1 -1
  20. package/dist/fetcher.d.cts.map +1 -1
  21. package/dist/fetcher.d.mts +1 -1
  22. package/dist/fetcher.d.mts.map +1 -1
  23. package/dist/infer.d.cts.map +1 -1
  24. package/dist/infer.d.mts.map +1 -1
  25. package/dist/openapi-hooks.cjs.map +1 -1
  26. package/dist/openapi-hooks.d.cts +2 -2
  27. package/dist/openapi-hooks.d.cts.map +1 -1
  28. package/dist/openapi-hooks.d.mts +2 -2
  29. package/dist/openapi-hooks.d.mts.map +1 -1
  30. package/dist/openapi-hooks.mjs.map +1 -1
  31. package/dist/openapi-types.d.cts.map +1 -1
  32. package/dist/openapi-types.d.mts.map +1 -1
  33. package/dist/openapi.cjs.map +1 -1
  34. package/dist/openapi.mjs.map +1 -1
  35. package/dist/react-query.cjs.map +1 -1
  36. package/dist/react-query.d.cts +1 -1
  37. package/dist/react-query.d.cts.map +1 -1
  38. package/dist/react-query.d.mts +1 -1
  39. package/dist/react-query.d.mts.map +1 -1
  40. package/dist/react-query.mjs.map +1 -1
  41. package/dist/{types-FxummKaL.d.mts → types-4K4N-Fl1.d.cts} +2 -2
  42. package/dist/types-4K4N-Fl1.d.cts.map +1 -0
  43. package/dist/{types-vutATyWv.d.cts → types-hhkZWjQn.d.mts} +2 -2
  44. package/dist/types-hhkZWjQn.d.mts.map +1 -0
  45. package/dist/types.d.cts +1 -1
  46. package/dist/types.d.mts +1 -1
  47. package/package.json +3 -3
  48. package/src/__tests__/auth-fetcher.spec.ts +476 -476
  49. package/src/__tests__/endpoint-hooks.spec.tsx +348 -348
  50. package/src/__tests__/fetcher.spec.ts +403 -403
  51. package/src/__tests__/infer.integration.spec.ts +171 -171
  52. package/src/__tests__/infer.spec.ts +182 -182
  53. package/src/__tests__/method-restrictions.spec.tsx +165 -165
  54. package/src/__tests__/openapi-hooks.spec.tsx +536 -536
  55. package/src/__tests__/react-query-infinite.spec.tsx +989 -989
  56. package/src/__tests__/react-query-invalidation.spec.tsx +223 -222
  57. package/src/__tests__/react-query.spec.tsx +567 -567
  58. package/src/__tests__/setup.ts +260 -260
  59. package/src/__tests__/types.spec.ts +127 -127
  60. package/src/__tests__/url-parsing.spec.ts +191 -191
  61. package/src/auth-fetcher.ts +160 -162
  62. package/src/endpoint-hooks.ts +151 -156
  63. package/src/fetcher.ts +163 -163
  64. package/src/infer.ts +64 -63
  65. package/src/openapi-hooks.ts +146 -146
  66. package/src/openapi-types.d.ts +428 -428
  67. package/src/openapi.json +593 -593
  68. package/src/react-query.ts +281 -281
  69. package/src/types.ts +121 -124
  70. package/dist/types-FxummKaL.d.mts.map +0 -1
  71. package/dist/types-vutATyWv.d.cts.map +0 -1
@@ -6,435 +6,435 @@
6
6
  */
7
7
 
8
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
- };
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
423
  }
424
424
 
425
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
- };
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
440
  }