@gewis/planka-client 2.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.
@@ -0,0 +1,951 @@
1
+ import {
2
+ type Config,
3
+ type ClientOptions as CFClientOptions,
4
+ createClient,
5
+ createConfig,
6
+ Options as CFOptions,
7
+ TDataShape,
8
+ Client,
9
+ formDataBodySerializer,
10
+ } from '@hey-api/client-fetch';
11
+ import {
12
+ AuthorizeError,
13
+ AuthorizeOidcRequest,
14
+ AuthorizeOidcResponse,
15
+ AuthorizeRequest,
16
+ AuthorizeResponse,
17
+ CreateAttachmentRequest,
18
+ CreateAttachmentResponse,
19
+ CreateBoardMembershipRequest,
20
+ CreateBoardMembershipResponse,
21
+ CreateBoardRequest,
22
+ CreateBoardResponse,
23
+ CreateCardLabelRequest,
24
+ CreateCardLabelResponse,
25
+ CreateCardMembershipRequest,
26
+ CreateCardMembershipResponse,
27
+ CreateCardRequest,
28
+ CreateCardResponse,
29
+ CreateCommentActionRequest,
30
+ CreateCommentActionResponse,
31
+ CreateLabelRequest,
32
+ CreateLabelResponse,
33
+ CreateListRequest,
34
+ CreateListResponse,
35
+ CreateProjectManagerRequest,
36
+ CreateProjectManagerResponse,
37
+ CreateProjectRequest,
38
+ CreateProjectResponse,
39
+ CreateTaskRequest,
40
+ CreateTaskResponse,
41
+ CreateUserRequest,
42
+ CreateUserResponse,
43
+ DeleteAttachmentRequest,
44
+ DeleteAttachmentResponse,
45
+ DeleteBoardMembershipRequest,
46
+ DeleteBoardMembershipResponse,
47
+ DeleteBoardRequest,
48
+ DeleteBoardResponse,
49
+ DeleteCardLabelRequest,
50
+ DeleteCardLabelResponse,
51
+ DeleteCardMembershipRequest,
52
+ DeleteCardMembershipResponse,
53
+ DeleteCardRequest,
54
+ DeleteCardResponse,
55
+ DeleteCommentActionRequest,
56
+ DeleteCommentActionResponse,
57
+ DeleteLabelRequest,
58
+ DeleteLabelResponse,
59
+ DeleteListRequest,
60
+ DeleteListResponse,
61
+ DeleteProjectManagerRequest,
62
+ DeleteProjectManagerResponse,
63
+ DeleteProjectRequest,
64
+ DeleteProjectResponse,
65
+ DeleteTaskRequest,
66
+ DeleteTaskResponse,
67
+ DeleteUserRequest,
68
+ DeleteUserResponse,
69
+ DuplicateCardRequest,
70
+ DuplicateCardResponse,
71
+ GetAttachmentRequest,
72
+ GetAttachmentResponse,
73
+ GetAttachmentThumbnailRequest,
74
+ GetAttachmentThumbnailResponse,
75
+ GetBoardRequest,
76
+ GetBoardResponse,
77
+ GetCardActionsRequest,
78
+ GetCardActionsResponse,
79
+ GetCardRequest,
80
+ GetCardResponse,
81
+ GetConfigRequest,
82
+ GetConfigResponse,
83
+ GetNotificationRequest,
84
+ GetNotificationResponse,
85
+ GetNotificationsRequest,
86
+ GetNotificationsResponse,
87
+ GetProjectRequest,
88
+ GetProjectResponse,
89
+ GetProjectsRequest,
90
+ GetProjectsResponse,
91
+ GetUserRequest,
92
+ GetUserResponse,
93
+ GetUsersRequest,
94
+ GetUsersResponse,
95
+ HttpError,
96
+ SortListRequest,
97
+ SortListResponse,
98
+ UnauthorizeRequest,
99
+ UnauthorizeResponse,
100
+ UpdateAttachmentRequest,
101
+ UpdateAttachmentResponse,
102
+ UpdateBoardMembershipRequest,
103
+ UpdateBoardMembershipResponse,
104
+ UpdateBoardRequest,
105
+ UpdateBoardResponse,
106
+ UpdateCardRequest,
107
+ UpdateCardResponse,
108
+ UpdateCommentActionRequest,
109
+ UpdateCommentActionResponse,
110
+ UpdateLabelRequest,
111
+ UpdateLabelResponse,
112
+ UpdateListRequest,
113
+ UpdateListResponse,
114
+ UpdateNotificationsRequest,
115
+ UpdateNotificationsResponse,
116
+ UpdateProjectBackgroundImageRequest,
117
+ UpdateProjectBackgroundImageResponse,
118
+ UpdateProjectRequest,
119
+ UpdateProjectResponse,
120
+ UpdateTaskRequest,
121
+ UpdateTaskResponse,
122
+ UpdateUserAvatarRequest,
123
+ UpdateUserAvatarResponse,
124
+ UpdateUserEmailRequest,
125
+ UpdateUserEmailResponse,
126
+ UpdateUserPasswordRequest,
127
+ UpdateUserPasswordResponse,
128
+ UpdateUserRequest,
129
+ UpdateUserResponse,
130
+ UpdateUserUsernameRequest,
131
+ UpdateUserUsernameResponse,
132
+ } from './types';
133
+
134
+ export type ClientOptions = {
135
+ baseUrl: `${string}://${string}/api` | (string & {});
136
+ };
137
+
138
+ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = CFOptions<
139
+ TData,
140
+ ThrowOnError
141
+ > & {
142
+ client?: Client;
143
+ meta?: Record<string, unknown>;
144
+ };
145
+
146
+ export type CreateClientConfig<T extends CFClientOptions = ClientOptions> = (
147
+ override?: Config<CFClientOptions & T>,
148
+ ) => Config<Required<CFClientOptions> & T>;
149
+
150
+ export const client = createClient(createConfig<ClientOptions>());
151
+
152
+ /**
153
+ * Get config
154
+ * 'GET /api/config': 'show-config'
155
+ * @param options
156
+ */
157
+ export const getConfig = <ThrowOnError extends boolean = false>(options?: Options<GetConfigRequest, ThrowOnError>) => {
158
+ return (options?.client ?? client).get<GetConfigResponse, unknown, ThrowOnError>({
159
+ ...options,
160
+ url: '/api/config',
161
+ });
162
+ };
163
+
164
+ /**
165
+ * Create access token
166
+ * 'POST /api/access-tokens': 'access-tokens/create'
167
+ * @param options
168
+ */
169
+ export const authorize = <ThrowOnError extends boolean = false>(options: Options<AuthorizeRequest, ThrowOnError>) => {
170
+ return (options?.client ?? client).post<AuthorizeResponse, AuthorizeError, ThrowOnError>({
171
+ ...options,
172
+ url: '/api/access-tokens',
173
+ });
174
+ };
175
+
176
+ /**
177
+ * Exchange access token using oidc
178
+ * 'POST /api/access-tokens/exchange-using-oidc': 'access-tokens/exchange-using-oidc'
179
+ * TODO -- this endpoint needs a written test
180
+ * @param options
181
+ */
182
+ export const authorizeOidc = <ThrowOnError extends boolean = false>(
183
+ options: Options<AuthorizeOidcRequest, ThrowOnError>,
184
+ ) => {
185
+ return (options?.client ?? client).post<AuthorizeOidcResponse, HttpError, ThrowOnError>({
186
+ ...options,
187
+ url: '/api/access-tokens/exchange-using-oidc',
188
+ });
189
+ };
190
+
191
+ /**
192
+ * Delete access token
193
+ * 'DELETE /api/access-tokens/me': 'access-tokens/delete'
194
+ * @param options
195
+ */
196
+ export const unauthorize = <ThrowOnError extends boolean = false>(
197
+ options?: Options<UnauthorizeRequest, ThrowOnError>,
198
+ ) => {
199
+ return (options?.client ?? client).delete<UnauthorizeResponse, HttpError, ThrowOnError>({
200
+ ...options,
201
+ url: '/api/access-tokens/me',
202
+ });
203
+ };
204
+
205
+ /**
206
+ * Get users
207
+ * 'GET /api/users': 'users/index'
208
+ * @param options
209
+ */
210
+ export const getUsers = <ThrowOnError extends boolean = false>(options?: Options<GetUsersRequest, ThrowOnError>) => {
211
+ return (options?.client ?? client).get<GetUsersResponse, HttpError, ThrowOnError>({
212
+ ...options,
213
+ url: '/api/users',
214
+ });
215
+ };
216
+
217
+ /**
218
+ * Create user
219
+ * 'POST /api/users': 'users/create'
220
+ * @param options
221
+ */
222
+ export const createUser = <ThrowOnError extends boolean = false>(options: Options<CreateUserRequest, ThrowOnError>) => {
223
+ return (options?.client ?? client).post<CreateUserResponse, HttpError, ThrowOnError>({
224
+ ...options,
225
+ url: '/api/users',
226
+ });
227
+ };
228
+
229
+ /**
230
+ * Get user
231
+ * 'GET /api/users/:id': 'users/show'
232
+ * @param options
233
+ */
234
+ export const getUser = <ThrowOnError extends boolean = false>(options: Options<GetUserRequest, ThrowOnError>) => {
235
+ return (options?.client ?? client).get<GetUserResponse, HttpError, ThrowOnError>({
236
+ ...options,
237
+ url: '/api/users/{id}',
238
+ });
239
+ };
240
+
241
+ /**
242
+ * Update user
243
+ * 'PATCH /api/users/:id': 'users/update'
244
+ * @param options
245
+ */
246
+ export const updateUser = <ThrowOnError extends boolean = false>(options: Options<UpdateUserRequest, ThrowOnError>) => {
247
+ return (options?.client ?? client).patch<UpdateUserResponse, HttpError, ThrowOnError>({
248
+ ...options,
249
+ url: '/api/users/{id}',
250
+ });
251
+ };
252
+
253
+ /**
254
+ * Update user email
255
+ * 'PATCH /api/users/:id/email': 'users/update-email'
256
+ * @param options
257
+ */
258
+ export const updateUserEmail = <ThrowOnError extends boolean = false>(
259
+ options: Options<UpdateUserEmailRequest, ThrowOnError>,
260
+ ) => {
261
+ return (options?.client ?? client).patch<UpdateUserEmailResponse, HttpError, ThrowOnError>({
262
+ ...options,
263
+ url: '/api/users/{id}/email',
264
+ });
265
+ };
266
+
267
+ /**
268
+ * Update user password
269
+ * 'PATCH /api/users/:id/password': 'users/update-password'
270
+ * @param options
271
+ */
272
+ export const updateUserPassword = <ThrowOnError extends boolean = false>(
273
+ options: Options<UpdateUserPasswordRequest, ThrowOnError>,
274
+ ) => {
275
+ return (options?.client ?? client).patch<UpdateUserPasswordResponse, HttpError, ThrowOnError>({
276
+ ...options,
277
+ url: '/api/users/{id}/password',
278
+ });
279
+ };
280
+
281
+ /**
282
+ * Update user username
283
+ * 'PATCH /api/users/:id/username': 'users/update-username'
284
+ * @param options
285
+ */
286
+ export const updateUserUsername = <ThrowOnError extends boolean = false>(
287
+ options: Options<UpdateUserUsernameRequest, ThrowOnError>,
288
+ ) => {
289
+ return (options?.client ?? client).patch<UpdateUserUsernameResponse, HttpError, ThrowOnError>({
290
+ ...options,
291
+ url: '/api/users/{id}/username',
292
+ });
293
+ };
294
+
295
+ /**
296
+ * Update user avatar
297
+ * 'POST /api/users/:id/avatar': 'users/update-avatar'
298
+ * @param options
299
+ */
300
+ export const updateUserAvatar = <ThrowOnError extends boolean = false>(
301
+ options: Options<UpdateUserAvatarRequest, ThrowOnError>,
302
+ ) => {
303
+ return (options?.client ?? client).post<UpdateUserAvatarResponse, HttpError, ThrowOnError>({
304
+ ...formDataBodySerializer,
305
+ ...options,
306
+ headers: {
307
+ 'Content-Type': null,
308
+ },
309
+ url: '/api/users/{id}/avatar',
310
+ });
311
+ };
312
+
313
+ /**
314
+ * Delete user
315
+ * 'DELETE /api/users/:id': 'users/delete'
316
+ * @param options
317
+ */
318
+ export const deleteUser = <ThrowOnError extends boolean = false>(options: Options<DeleteUserRequest, ThrowOnError>) => {
319
+ return (options?.client ?? client).delete<DeleteUserResponse, HttpError, ThrowOnError>({
320
+ ...options,
321
+ url: '/api/users/{id}',
322
+ });
323
+ };
324
+
325
+ /**
326
+ * Get projects
327
+ * 'GET /api/projects': 'projects/index'
328
+ * @param options
329
+ */
330
+ export const getProjects = <ThrowOnError extends boolean = false>(
331
+ options: Options<GetProjectsRequest, ThrowOnError>,
332
+ ) => {
333
+ return (options?.client ?? client).get<GetProjectsResponse, HttpError, ThrowOnError>({
334
+ ...options,
335
+ url: '/api/projects',
336
+ });
337
+ };
338
+
339
+ /**
340
+ * Create project
341
+ * 'POST /api/projects': 'projects/create'
342
+ * @param options
343
+ */
344
+ export const createProject = <ThrowOnError extends boolean = false>(
345
+ options: Options<CreateProjectRequest, ThrowOnError>,
346
+ ) => {
347
+ return (options?.client ?? client).post<CreateProjectResponse, HttpError, ThrowOnError>({
348
+ ...options,
349
+ url: '/api/projects',
350
+ });
351
+ };
352
+
353
+ /**
354
+ * Get project
355
+ * 'GET /api/projects/:id': 'projects/show'
356
+ * @param options
357
+ */
358
+ export const getProject = <ThrowOnError extends boolean = false>(options: Options<GetProjectRequest, ThrowOnError>) => {
359
+ return (options?.client ?? client).get<GetProjectResponse, HttpError, ThrowOnError>({
360
+ ...options,
361
+ url: '/api/projects/{id}',
362
+ });
363
+ };
364
+
365
+ /**
366
+ * Update project
367
+ * 'PATCH /api/projects/:id': 'projects/update'
368
+ * @param options
369
+ */
370
+ export const updateProject = <ThrowOnError extends boolean = false>(
371
+ options: Options<UpdateProjectRequest, ThrowOnError>,
372
+ ) => {
373
+ return (options?.client ?? client).patch<UpdateProjectResponse, HttpError, ThrowOnError>({
374
+ ...options,
375
+ url: '/api/projects/{id}',
376
+ });
377
+ };
378
+
379
+ /**
380
+ * Update project background image
381
+ * 'POST /api/projects/:id/background-image': 'projects/update-background-image'
382
+ * @param options
383
+ */
384
+ export const updateProjectBackgroundImage = <ThrowOnError extends boolean = false>(
385
+ options: Options<UpdateProjectBackgroundImageRequest, ThrowOnError>,
386
+ ) => {
387
+ return (options?.client ?? client).post<UpdateProjectBackgroundImageResponse, HttpError, ThrowOnError>({
388
+ ...formDataBodySerializer,
389
+ ...options,
390
+ headers: {
391
+ 'Content-Type': null,
392
+ },
393
+ url: '/api/projects/{id}/background-image',
394
+ });
395
+ };
396
+
397
+ /**
398
+ * Delete project
399
+ * 'DELETE /api/projects/:id': 'projects/delete'
400
+ * @param options
401
+ */
402
+ export const deleteProject = <ThrowOnError extends boolean = false>(
403
+ options: Options<DeleteProjectRequest, ThrowOnError>,
404
+ ) => {
405
+ return (options?.client ?? client).delete<DeleteProjectResponse, HttpError, ThrowOnError>({
406
+ ...options,
407
+ url: '/api/projects/{id}',
408
+ });
409
+ };
410
+
411
+ /**
412
+ * Create project manager
413
+ * 'POST /api/projects/:projectId/managers': 'project-managers/create'
414
+ * @param options
415
+ */
416
+ export const createProjectManager = <ThrowOnError extends boolean = false>(
417
+ options: Options<CreateProjectManagerRequest, ThrowOnError>,
418
+ ) => {
419
+ return (options?.client ?? client).post<CreateProjectManagerResponse, HttpError, ThrowOnError>({
420
+ ...options,
421
+ url: '/api/projects/{projectId}/managers',
422
+ });
423
+ };
424
+
425
+ /**
426
+ * Delete project manager
427
+ * 'DELETE /api/project-managers/:id': 'project-managers/delete'
428
+ * @param options
429
+ */
430
+ export const deleteProjectManager = <ThrowOnError extends boolean = false>(
431
+ options: Options<DeleteProjectManagerRequest, ThrowOnError>,
432
+ ) => {
433
+ return (options?.client ?? client).delete<DeleteProjectManagerResponse, HttpError, ThrowOnError>({
434
+ ...options,
435
+ url: '/api/project-managers/{id}',
436
+ });
437
+ };
438
+
439
+ /**
440
+ * Create board
441
+ * 'POST /api/projects/:projectId/boards': 'boards/create'
442
+ * @param options
443
+ */
444
+ export const createBoard = <ThrowOnError extends boolean = false>(
445
+ options: Options<CreateBoardRequest, ThrowOnError>,
446
+ ) => {
447
+ return (options?.client ?? client).post<CreateBoardResponse, HttpError, ThrowOnError>({
448
+ ...options,
449
+ url: '/api/projects/{projectId}/boards',
450
+ });
451
+ };
452
+
453
+ /**
454
+ * Get board
455
+ * 'GET /api/boards/:id': 'boards/show'
456
+ * @param options
457
+ */
458
+ export const getBoard = <ThrowOnError extends boolean = false>(options: Options<GetBoardRequest, ThrowOnError>) => {
459
+ return (options?.client ?? client).get<GetBoardResponse, HttpError, ThrowOnError>({
460
+ ...options,
461
+ url: '/api/boards/{id}',
462
+ });
463
+ };
464
+
465
+ /**
466
+ * Update board
467
+ * 'PATCH /api/boards/:id': 'boards/update'
468
+ * @param options
469
+ */
470
+ export const updateBoard = <ThrowOnError extends boolean = false>(
471
+ options: Options<UpdateBoardRequest, ThrowOnError>,
472
+ ) => {
473
+ return (options?.client ?? client).patch<UpdateBoardResponse, HttpError, ThrowOnError>({
474
+ ...options,
475
+ url: '/api/boards/{id}',
476
+ });
477
+ };
478
+
479
+ /**
480
+ * Delete board
481
+ * 'DELETE /api/boards/:id': 'boards/delete'
482
+ * @param options
483
+ */
484
+ export const deleteBoard = <ThrowOnError extends boolean = false>(
485
+ options: Options<DeleteBoardRequest, ThrowOnError>,
486
+ ) => {
487
+ return (options?.client ?? client).delete<DeleteBoardResponse, HttpError, ThrowOnError>({
488
+ ...options,
489
+ url: '/api/boards/{id}',
490
+ });
491
+ };
492
+
493
+ /**
494
+ * Create board membership
495
+ * 'POST /api/boards/:boardId/memberships': 'board-memberships/create'
496
+ * @param options
497
+ */
498
+ export const createBoardMembership = <ThrowOnError extends boolean = false>(
499
+ options: Options<CreateBoardMembershipRequest, ThrowOnError>,
500
+ ) => {
501
+ return (options?.client ?? client).post<CreateBoardMembershipResponse, HttpError, ThrowOnError>({
502
+ ...options,
503
+ url: '/api/boards/{boardId}/memberships',
504
+ });
505
+ };
506
+
507
+ /**
508
+ * Update board membership
509
+ * 'PATCH /api/board-memberships/:id': 'board-memberships/update'
510
+ * @param options
511
+ */
512
+ export const updateBoardMembership = <ThrowOnError extends boolean = false>(
513
+ options: Options<UpdateBoardMembershipRequest, ThrowOnError>,
514
+ ) => {
515
+ return (options?.client ?? client).patch<UpdateBoardMembershipResponse, HttpError, ThrowOnError>({
516
+ ...options,
517
+ url: '/api/board-memberships/{id}',
518
+ });
519
+ };
520
+
521
+ /**
522
+ * Delete board membership
523
+ * 'DELETE /api/board-memberships/:id': 'board-memberships/delete'
524
+ * @param options
525
+ */
526
+ export const deleteBoardMembership = <ThrowOnError extends boolean = false>(
527
+ options: Options<DeleteBoardMembershipRequest, ThrowOnError>,
528
+ ) => {
529
+ return (options?.client ?? client).delete<DeleteBoardMembershipResponse, HttpError, ThrowOnError>({
530
+ ...options,
531
+ url: '/api/board-memberships/{id}',
532
+ });
533
+ };
534
+
535
+ /**
536
+ * Create label
537
+ * 'POST /api/boards/:boardId/labels': 'labels/create'
538
+ * @param options
539
+ */
540
+ export const createLabel = <ThrowOnError extends boolean = false>(
541
+ options: Options<CreateLabelRequest, ThrowOnError>,
542
+ ) => {
543
+ return (options?.client ?? client).post<CreateLabelResponse, HttpError, ThrowOnError>({
544
+ ...options,
545
+ url: '/api/boards/{boardId}/labels',
546
+ });
547
+ };
548
+
549
+ /**
550
+ * Update label
551
+ * 'PATCH /api/labels/:id': 'labels/update'
552
+ * @param options
553
+ */
554
+ export const updateLabel = <ThrowOnError extends boolean = false>(
555
+ options: Options<UpdateLabelRequest, ThrowOnError>,
556
+ ) => {
557
+ return (options?.client ?? client).patch<UpdateLabelResponse, HttpError, ThrowOnError>({
558
+ ...options,
559
+ url: '/api/labels/{id}',
560
+ });
561
+ };
562
+
563
+ /**
564
+ * Delete label
565
+ * 'DELETE /api/labels/:id': 'labels/delete'
566
+ * @param options
567
+ */
568
+ export const deleteLabel = <ThrowOnError extends boolean = false>(
569
+ options: Options<DeleteLabelRequest, ThrowOnError>,
570
+ ) => {
571
+ return (options?.client ?? client).delete<DeleteLabelResponse, HttpError, ThrowOnError>({
572
+ ...options,
573
+ url: '/api/labels/{id}',
574
+ });
575
+ };
576
+
577
+ /**
578
+ * Create list
579
+ * 'POST /api/boards/:boardId/lists': 'lists/create'
580
+ * @param options
581
+ */
582
+ export const createList = <ThrowOnError extends boolean = false>(options: Options<CreateListRequest, ThrowOnError>) => {
583
+ return (options?.client ?? client).post<CreateListResponse, HttpError, ThrowOnError>({
584
+ ...options,
585
+ url: '/api/boards/{boardId}/lists',
586
+ });
587
+ };
588
+
589
+ /**
590
+ * Update list
591
+ * 'PATCH /api/lists/:id': 'lists/update'
592
+ * @param options
593
+ */
594
+ export const updateList = <ThrowOnError extends boolean = false>(options: Options<UpdateListRequest, ThrowOnError>) => {
595
+ return (options?.client ?? client).patch<UpdateListResponse, HttpError, ThrowOnError>({
596
+ ...options,
597
+ url: '/api/lists/{id}',
598
+ });
599
+ };
600
+
601
+ /**
602
+ * Sort list
603
+ * 'POST /api/lists/:id/sort': 'lists/sort'
604
+ * @param options
605
+ */
606
+ export const sortList = <ThrowOnError extends boolean = false>(options: Options<SortListRequest, ThrowOnError>) => {
607
+ return (options?.client ?? client).post<SortListResponse, HttpError, ThrowOnError>({
608
+ ...options,
609
+ url: '/api/lists/{id}/sort',
610
+ });
611
+ };
612
+
613
+ /**
614
+ * Delete list
615
+ * 'DELETE /api/lists/:id': 'lists/delete'
616
+ * @param options
617
+ */
618
+ export const deleteList = <ThrowOnError extends boolean = false>(options: Options<DeleteListRequest, ThrowOnError>) => {
619
+ return (options?.client ?? client).delete<DeleteListResponse, HttpError, ThrowOnError>({
620
+ ...options,
621
+ url: '/api/lists/{id}',
622
+ });
623
+ };
624
+
625
+ /**
626
+ * Create card
627
+ * 'POST /api/lists/:listId/cards': 'cards/create'
628
+ * @param options
629
+ */
630
+ export const createCard = <ThrowOnError extends boolean = false>(options: Options<CreateCardRequest, ThrowOnError>) => {
631
+ return (options?.client ?? client).post<CreateCardResponse, HttpError, ThrowOnError>({
632
+ ...options,
633
+ url: '/api/lists/{listId}/cards',
634
+ });
635
+ };
636
+
637
+ /**
638
+ * Get card
639
+ * 'GET /api/cards/:id': 'cards/show'
640
+ * @param options
641
+ */
642
+ export const getCard = <ThrowOnError extends boolean = false>(options: Options<GetCardRequest, ThrowOnError>) => {
643
+ return (options?.client ?? client).get<GetCardResponse, HttpError, ThrowOnError>({
644
+ ...options,
645
+ url: '/api/cards/{id}',
646
+ });
647
+ };
648
+
649
+ /**
650
+ * Update card
651
+ * 'PATCH /api/cards/:id': 'cards/update'
652
+ * @param options
653
+ */
654
+ export const updateCard = <ThrowOnError extends boolean = false>(options: Options<UpdateCardRequest, ThrowOnError>) => {
655
+ return (options?.client ?? client).patch<UpdateCardResponse, HttpError, ThrowOnError>({
656
+ ...options,
657
+ url: '/api/cards/{id}',
658
+ });
659
+ };
660
+
661
+ /**
662
+ * Duplicate card
663
+ * 'POST /api/cards/:id/duplicate': 'cards/duplicate'
664
+ * @param options
665
+ */
666
+ export const duplicateCard = <ThrowOnError extends boolean = false>(
667
+ options: Options<DuplicateCardRequest, ThrowOnError>,
668
+ ) => {
669
+ return (options?.client ?? client).post<DuplicateCardResponse, HttpError, ThrowOnError>({
670
+ ...options,
671
+ url: '/api/cards/{id}/duplicate',
672
+ });
673
+ };
674
+
675
+ /**
676
+ * Delete card
677
+ * 'DELETE /api/cards/:id': 'cards/delete'
678
+ * @param options
679
+ */
680
+ export const deleteCard = <ThrowOnError extends boolean = false>(options: Options<DeleteCardRequest, ThrowOnError>) => {
681
+ return (options?.client ?? client).delete<DeleteCardResponse, HttpError, ThrowOnError>({
682
+ ...options,
683
+ url: '/api/cards/{id}',
684
+ });
685
+ };
686
+
687
+ /**
688
+ * Create card membership
689
+ * 'POST /api/cards/:cardId/memberships': 'card-memberships/create'
690
+ * @param options
691
+ */
692
+ export const createCardMembership = <ThrowOnError extends boolean = false>(
693
+ options: Options<CreateCardMembershipRequest, ThrowOnError>,
694
+ ) => {
695
+ return (options?.client ?? client).post<CreateCardMembershipResponse, HttpError, ThrowOnError>({
696
+ ...options,
697
+ url: '/api/cards/{cardId}/memberships',
698
+ });
699
+ };
700
+
701
+ /**
702
+ * Delete card membership
703
+ * 'DELETE /api/cards/:cardId/memberships': 'card-memberships/delete'
704
+ * @param options
705
+ */
706
+ export const deleteCardMembership = <ThrowOnError extends boolean = false>(
707
+ options: Options<DeleteCardMembershipRequest, ThrowOnError>,
708
+ ) => {
709
+ return (options?.client ?? client).delete<DeleteCardMembershipResponse, HttpError, ThrowOnError>({
710
+ ...options,
711
+ url: '/api/cards/{cardId}/memberships',
712
+ });
713
+ };
714
+
715
+ /**
716
+ * Create card label
717
+ * 'POST /api/cards/:cardId/labels': 'card-labels/create'
718
+ * @param options
719
+ */
720
+ export const createCardLabel = <ThrowOnError extends boolean = false>(
721
+ options: Options<CreateCardLabelRequest, ThrowOnError>,
722
+ ) => {
723
+ return (options?.client ?? client).post<CreateCardLabelResponse, HttpError, ThrowOnError>({
724
+ ...options,
725
+ url: '/api/cards/{cardId}/labels',
726
+ });
727
+ };
728
+
729
+ /**
730
+ * Delete card label
731
+ * 'DELETE /api/cards/:cardId/labels/:labelId': 'card-labels/delete'
732
+ * @param options
733
+ */
734
+ export const deleteCardLabel = <ThrowOnError extends boolean = false>(
735
+ options: Options<DeleteCardLabelRequest, ThrowOnError>,
736
+ ) => {
737
+ return (options?.client ?? client).delete<DeleteCardLabelResponse, HttpError, ThrowOnError>({
738
+ ...options,
739
+ url: '/api/cards/{cardId}/labels/{labelId}',
740
+ });
741
+ };
742
+
743
+ /**
744
+ * Create task
745
+ * 'POST /api/cards/:cardId/tasks': 'tasks/create'
746
+ * @param options
747
+ */
748
+ export const createTask = <ThrowOnError extends boolean = false>(options: Options<CreateTaskRequest, ThrowOnError>) => {
749
+ return (options?.client ?? client).post<CreateTaskResponse, HttpError, ThrowOnError>({
750
+ ...options,
751
+ url: '/api/cards/{cardId}/tasks',
752
+ });
753
+ };
754
+
755
+ /**
756
+ * Update task
757
+ * 'PATCH /api/tasks/:id': 'tasks/update'
758
+ * @param options
759
+ */
760
+ export const updateTask = <ThrowOnError extends boolean = false>(options: Options<UpdateTaskRequest, ThrowOnError>) => {
761
+ return (options?.client ?? client).patch<UpdateTaskResponse, HttpError, ThrowOnError>({
762
+ ...options,
763
+ url: '/api/tasks/{id}',
764
+ });
765
+ };
766
+
767
+ /**
768
+ * Delete task
769
+ * 'DELETE /api/tasks/:id': 'tasks/delete'
770
+ * @param options
771
+ */
772
+ export const deleteTask = <ThrowOnError extends boolean = false>(options: Options<DeleteTaskRequest, ThrowOnError>) => {
773
+ return (options?.client ?? client).delete<DeleteTaskResponse, HttpError, ThrowOnError>({
774
+ ...options,
775
+ url: '/api/tasks/{id}',
776
+ });
777
+ };
778
+
779
+ /**
780
+ * Create attachment
781
+ * 'POST /api/cards/:cardId/attachments': 'attachments/create'
782
+ * @param options
783
+ */
784
+ export const createAttachment = <ThrowOnError extends boolean = false>(
785
+ options: Options<CreateAttachmentRequest, ThrowOnError>,
786
+ ) => {
787
+ return (options?.client ?? client).post<CreateAttachmentResponse, HttpError, ThrowOnError>({
788
+ ...formDataBodySerializer,
789
+ ...options,
790
+ headers: {
791
+ 'Content-Type': null,
792
+ },
793
+ url: '/api/cards/{cardId}/attachments',
794
+ });
795
+ };
796
+
797
+ /**
798
+ * Update attachment
799
+ * 'PATCH /api/attachments/:id': 'attachments/update'
800
+ * @param options
801
+ */
802
+ export const updateAttachment = <ThrowOnError extends boolean = false>(
803
+ options: Options<UpdateAttachmentRequest, ThrowOnError>,
804
+ ) => {
805
+ return (options?.client ?? client).patch<UpdateAttachmentResponse, HttpError, ThrowOnError>({
806
+ ...options,
807
+ url: '/api/attachments/{id}',
808
+ });
809
+ };
810
+
811
+ /**
812
+ * Delete attachment
813
+ * 'DELETE /api/attachments/:id': 'attachments/delete'
814
+ * @param options
815
+ */
816
+ export const deleteAttachment = <ThrowOnError extends boolean = false>(
817
+ options: Options<DeleteAttachmentRequest, ThrowOnError>,
818
+ ) => {
819
+ return (options?.client ?? client).delete<DeleteAttachmentResponse, HttpError, ThrowOnError>({
820
+ ...options,
821
+ url: '/api/attachments/{id}',
822
+ });
823
+ };
824
+
825
+ /**
826
+ * Get attachment
827
+ * 'GET /attachments/:id/download/:filename'
828
+ * Note: this endpoint requires access token to be passed as a cookie, not as bearer token
829
+ * @param options
830
+ */
831
+ export const getAttachment = <ThrowOnError extends boolean = false>(
832
+ options: Options<GetAttachmentRequest, ThrowOnError>,
833
+ ) => {
834
+ return (options?.client ?? client).get<GetAttachmentResponse, HttpError, ThrowOnError>({
835
+ ...options,
836
+ url: '/attachments/{id}/download/{filename}',
837
+ });
838
+ };
839
+
840
+ /**
841
+ * Get attachment thumbnail
842
+ * 'GET /attachments/:id/download/thumbnails/cover-256.:extension'
843
+ * Note: this endpoint requires access token to be passed as a cookie, not as bearer token
844
+ * @param options
845
+ */
846
+ export const getAttachmentThumbnail = <ThrowOnError extends boolean = false>(
847
+ options: Options<GetAttachmentThumbnailRequest, ThrowOnError>,
848
+ ) => {
849
+ return (options?.client ?? client).get<GetAttachmentThumbnailResponse, HttpError, ThrowOnError>({
850
+ ...options,
851
+ url: '/attachments/{id}/download/thumbnails/cover-256.{extension}',
852
+ });
853
+ };
854
+
855
+ /**
856
+ * Get card actions
857
+ * 'GET /api/cards/:cardId/actions': 'actions/index'
858
+ * @param options
859
+ */
860
+ export const getCardActions = <ThrowOnError extends boolean = false>(
861
+ options: Options<GetCardActionsRequest, ThrowOnError>,
862
+ ) => {
863
+ return (options?.client ?? client).get<GetCardActionsResponse, HttpError, ThrowOnError>({
864
+ ...options,
865
+ url: '/api/cards/{cardId}/actions',
866
+ });
867
+ };
868
+
869
+ /**
870
+ * Create comment action
871
+ * 'POST /api/cards/:cardId/comment-actions': 'comment-actions/create'
872
+ * @param options
873
+ */
874
+ export const createCommentAction = <ThrowOnError extends boolean = false>(
875
+ options: Options<CreateCommentActionRequest, ThrowOnError>,
876
+ ) => {
877
+ return (options?.client ?? client).post<CreateCommentActionResponse, HttpError, ThrowOnError>({
878
+ ...options,
879
+ url: '/api/cards/{cardId}/comment-actions',
880
+ });
881
+ };
882
+
883
+ /**
884
+ * Update comment action
885
+ * 'PATCH /api/comment-actions/:id': 'comment-actions/update'
886
+ * @param options
887
+ */
888
+ export const updateCommentAction = <ThrowOnError extends boolean = false>(
889
+ options: Options<UpdateCommentActionRequest, ThrowOnError>,
890
+ ) => {
891
+ return (options?.client ?? client).patch<UpdateCommentActionResponse, HttpError, ThrowOnError>({
892
+ ...options,
893
+ url: '/api/comment-actions/{id}',
894
+ });
895
+ };
896
+
897
+ /**
898
+ * Delete comment action
899
+ * 'DELETE /api/comment-actions/:id': 'comment-actions/delete'
900
+ * @param options
901
+ */
902
+ export const deleteCommentAction = <ThrowOnError extends boolean = false>(
903
+ options: Options<DeleteCommentActionRequest, ThrowOnError>,
904
+ ) => {
905
+ return (options?.client ?? client).delete<DeleteCommentActionResponse, HttpError, ThrowOnError>({
906
+ ...options,
907
+ url: '/api/comment-actions/{id}',
908
+ });
909
+ };
910
+
911
+ /**
912
+ * Get notifications
913
+ * 'GET /api/notifications': 'notifications/index'
914
+ * @param options
915
+ */
916
+ export const getNotifications = <ThrowOnError extends boolean = false>(
917
+ options?: Options<GetNotificationsRequest, ThrowOnError>,
918
+ ) => {
919
+ return (options?.client ?? client).get<GetNotificationsResponse, HttpError, ThrowOnError>({
920
+ ...options,
921
+ url: '/api/notifications',
922
+ });
923
+ };
924
+
925
+ /**
926
+ * Get notification
927
+ * 'GET /api/notifications/:id': 'notifications/show'
928
+ * @param options
929
+ */
930
+ export const getNotification = <ThrowOnError extends boolean = false>(
931
+ options: Options<GetNotificationRequest, ThrowOnError>,
932
+ ) => {
933
+ return (options?.client ?? client).get<GetNotificationResponse, HttpError, ThrowOnError>({
934
+ ...options,
935
+ url: '/api/notifications/{id}',
936
+ });
937
+ };
938
+
939
+ /**
940
+ * Update notifications
941
+ * 'PATCH /api/notifications/:ids': 'notifications/update'
942
+ * @param options
943
+ */
944
+ export const updateNotifications = <ThrowOnError extends boolean = false>(
945
+ options: Options<UpdateNotificationsRequest, ThrowOnError>,
946
+ ) => {
947
+ return (options?.client ?? client).patch<UpdateNotificationsResponse, HttpError, ThrowOnError>({
948
+ ...options,
949
+ url: '/api/notifications/{ids}',
950
+ });
951
+ };