@zilfu/sdk 0.0.1 → 0.1.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.
@@ -1,695 +0,0 @@
1
- // This file is auto-generated by @hey-api/openapi-ts
2
-
3
- import { type Client, formDataBodySerializer, type Options as Options2, type TDataShape } from './client';
4
- import { client } from './client.gen';
5
- import type { AccountsActivateData, AccountsActivateErrors, AccountsActivateResponses, AccountsBoardsData, AccountsBoardsErrors, AccountsBoardsResponses, AccountsDestroyData, AccountsDestroyErrors, AccountsDestroyManyData, AccountsDestroyManyErrors, AccountsDestroyManyResponses, AccountsDestroyResponses, AccountsIndexData, AccountsIndexErrors, AccountsIndexResponses, ApiTokensDestroyData, ApiTokensDestroyErrors, ApiTokensDestroyResponses, ApiTokensStoreData, ApiTokensStoreErrors, ApiTokensStoreResponses, BioAvatarData, BioAvatarErrors, BioAvatarResponses, BioBlocksDestroyData, BioBlocksDestroyErrors, BioBlocksDestroyResponses, BioBlocksIndexData, BioBlocksIndexErrors, BioBlocksIndexResponses, BioBlocksReorderData, BioBlocksReorderErrors, BioBlocksReorderResponses, BioBlocksStoreData, BioBlocksStoreErrors, BioBlocksStoreResponses, BioBlocksUpdateData, BioBlocksUpdateErrors, BioBlocksUpdateResponses, BioShowData, BioShowErrors, BioShowResponses, BioStoreData, BioStoreErrors, BioStoreResponses, BioUpdateData, BioUpdateErrors, BioUpdateResponses, ClustersUpdateData, ClustersUpdateErrors, ClustersUpdateResponses, MediaDestroyData, MediaDestroyErrors, MediaDestroyResponses, MediaStoreData, MediaStoreErrors, MediaStoreResponses, PostsDestroyData, PostsDestroyErrors, PostsDestroyResponses, PostsIndexData, PostsIndexErrors, PostsIndexResponses, PostsShowData, PostsShowErrors, PostsShowResponses, PostsStoreData, PostsStoreErrors, PostsStoreResponses, PostsUpdateData, PostsUpdateErrors, PostsUpdateResponses, QueueIndexData, QueueIndexErrors, QueueIndexResponses, SlotsDestroyData, SlotsDestroyErrors, SlotsDestroyResponses, SlotsIndexData, SlotsIndexErrors, SlotsIndexResponses, SlotsStoreData, SlotsStoreErrors, SlotsStoreResponses, SpacesDestroyData, SpacesDestroyErrors, SpacesDestroyResponses, SpacesIndexData, SpacesIndexErrors, SpacesIndexResponses, SpacesShowData, SpacesShowErrors, SpacesShowResponses, SpacesStoreData, SpacesStoreErrors, SpacesStoreResponses, SpacesUpdateData, SpacesUpdateErrors, SpacesUpdateResponses, SubscriptionShowData, SubscriptionShowErrors, SubscriptionShowResponses, WebhooksDestroyData, WebhooksDestroyErrors, WebhooksDestroyResponses, WebhooksIndexData, WebhooksIndexErrors, WebhooksIndexResponses, WebhooksStoreData, WebhooksStoreErrors, WebhooksStoreResponses, WebhooksUpdateData, WebhooksUpdateErrors, WebhooksUpdateResponses } from './types.gen';
6
-
7
- export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
8
- /**
9
- * You can provide a client instance returned by `createClient()` instead of
10
- * individual options. This might be also useful if you want to implement a
11
- * custom client.
12
- */
13
- client?: Client;
14
- /**
15
- * You can pass arbitrary values through the `meta` object. This can be
16
- * used to access values that aren't defined as part of the SDK function.
17
- */
18
- meta?: Record<string, unknown>;
19
- };
20
-
21
- /**
22
- * Disconnect multiple accounts
23
- * Removes several social account connections in a single request and dispatches a webhook event for each.
24
- */
25
- export const accountsDestroyMany = <ThrowOnError extends boolean = false>(options: Options<AccountsDestroyManyData, ThrowOnError>) => {
26
- return (options.client ?? client).delete<AccountsDestroyManyResponses, AccountsDestroyManyErrors, ThrowOnError>({
27
- security: [
28
- {
29
- scheme: 'bearer',
30
- type: 'http'
31
- }
32
- ],
33
- url: '/spaces/{space}/accounts',
34
- ...options
35
- });
36
- };
37
-
38
- /**
39
- * List accounts
40
- * Returns all connected social accounts for the given space.
41
- */
42
- export const accountsIndex = <ThrowOnError extends boolean = false>(options: Options<AccountsIndexData, ThrowOnError>) => {
43
- return (options.client ?? client).get<AccountsIndexResponses, AccountsIndexErrors, ThrowOnError>({
44
- security: [
45
- {
46
- scheme: 'bearer',
47
- type: 'http'
48
- }
49
- ],
50
- url: '/spaces/{space}/accounts',
51
- ...options
52
- });
53
- };
54
-
55
- /**
56
- * Activate an account
57
- * Activates the given account and deactivates all other accounts on the same platform within the space.
58
- */
59
- export const accountsActivate = <ThrowOnError extends boolean = false>(options: Options<AccountsActivateData, ThrowOnError>) => {
60
- return (options.client ?? client).patch<AccountsActivateResponses, AccountsActivateErrors, ThrowOnError>({
61
- security: [
62
- {
63
- scheme: 'bearer',
64
- type: 'http'
65
- }
66
- ],
67
- url: '/spaces/{space}/accounts/{account}/activate',
68
- ...options
69
- });
70
- };
71
-
72
- /**
73
- * List Pinterest boards
74
- * Returns the Pinterest boards available for the given account.
75
- */
76
- export const accountsBoards = <ThrowOnError extends boolean = false>(options: Options<AccountsBoardsData, ThrowOnError>) => {
77
- return (options.client ?? client).get<AccountsBoardsResponses, AccountsBoardsErrors, ThrowOnError>({
78
- security: [
79
- {
80
- scheme: 'bearer',
81
- type: 'http'
82
- }
83
- ],
84
- url: '/spaces/{space}/accounts/{account}/boards',
85
- ...options
86
- });
87
- };
88
-
89
- /**
90
- * Disconnect an account
91
- * Removes the social account connection and dispatches a webhook event.
92
- */
93
- export const accountsDestroy = <ThrowOnError extends boolean = false>(options: Options<AccountsDestroyData, ThrowOnError>) => {
94
- return (options.client ?? client).delete<AccountsDestroyResponses, AccountsDestroyErrors, ThrowOnError>({
95
- security: [
96
- {
97
- scheme: 'bearer',
98
- type: 'http'
99
- }
100
- ],
101
- url: '/spaces/{space}/accounts/{account}',
102
- ...options
103
- });
104
- };
105
-
106
- /**
107
- * Create an API token
108
- * Generates a new personal access token for the authenticated user.
109
- */
110
- export const apiTokensStore = <ThrowOnError extends boolean = false>(options: Options<ApiTokensStoreData, ThrowOnError>) => {
111
- return (options.client ?? client).post<ApiTokensStoreResponses, ApiTokensStoreErrors, ThrowOnError>({
112
- security: [
113
- {
114
- scheme: 'bearer',
115
- type: 'http'
116
- }
117
- ],
118
- url: '/api-tokens',
119
- ...options,
120
- headers: {
121
- 'Content-Type': 'application/json',
122
- ...options.headers
123
- }
124
- });
125
- };
126
-
127
- /**
128
- * Revoke an API token
129
- * Deletes the specified personal access token.
130
- */
131
- export const apiTokensDestroy = <ThrowOnError extends boolean = false>(options: Options<ApiTokensDestroyData, ThrowOnError>) => {
132
- return (options.client ?? client).delete<ApiTokensDestroyResponses, ApiTokensDestroyErrors, ThrowOnError>({
133
- security: [
134
- {
135
- scheme: 'bearer',
136
- type: 'http'
137
- }
138
- ],
139
- url: '/api-tokens/{tokenId}',
140
- ...options
141
- });
142
- };
143
-
144
- export const bioBlocksIndex = <ThrowOnError extends boolean = false>(options: Options<BioBlocksIndexData, ThrowOnError>) => {
145
- return (options.client ?? client).get<BioBlocksIndexResponses, BioBlocksIndexErrors, ThrowOnError>({
146
- security: [
147
- {
148
- scheme: 'bearer',
149
- type: 'http'
150
- }
151
- ],
152
- url: '/spaces/{space}/bio/blocks',
153
- ...options
154
- });
155
- };
156
-
157
- export const bioBlocksStore = <ThrowOnError extends boolean = false>(options: Options<BioBlocksStoreData, ThrowOnError>) => {
158
- return (options.client ?? client).post<BioBlocksStoreResponses, BioBlocksStoreErrors, ThrowOnError>({
159
- security: [
160
- {
161
- scheme: 'bearer',
162
- type: 'http'
163
- }
164
- ],
165
- url: '/spaces/{space}/bio/blocks',
166
- ...options,
167
- headers: {
168
- 'Content-Type': 'application/json',
169
- ...options.headers
170
- }
171
- });
172
- };
173
-
174
- export const bioBlocksDestroy = <ThrowOnError extends boolean = false>(options: Options<BioBlocksDestroyData, ThrowOnError>) => {
175
- return (options.client ?? client).delete<BioBlocksDestroyResponses, BioBlocksDestroyErrors, ThrowOnError>({
176
- security: [
177
- {
178
- scheme: 'bearer',
179
- type: 'http'
180
- }
181
- ],
182
- url: '/spaces/{space}/bio/blocks/{block}',
183
- ...options
184
- });
185
- };
186
-
187
- export const bioBlocksUpdate = <ThrowOnError extends boolean = false>(options: Options<BioBlocksUpdateData, ThrowOnError>) => {
188
- return (options.client ?? client).put<BioBlocksUpdateResponses, BioBlocksUpdateErrors, ThrowOnError>({
189
- security: [
190
- {
191
- scheme: 'bearer',
192
- type: 'http'
193
- }
194
- ],
195
- url: '/spaces/{space}/bio/blocks/{block}',
196
- ...options,
197
- headers: {
198
- 'Content-Type': 'application/json',
199
- ...options.headers
200
- }
201
- });
202
- };
203
-
204
- export const bioBlocksReorder = <ThrowOnError extends boolean = false>(options: Options<BioBlocksReorderData, ThrowOnError>) => {
205
- return (options.client ?? client).post<BioBlocksReorderResponses, BioBlocksReorderErrors, ThrowOnError>({
206
- security: [
207
- {
208
- scheme: 'bearer',
209
- type: 'http'
210
- }
211
- ],
212
- url: '/spaces/{space}/bio/blocks/{block}/reorder',
213
- ...options,
214
- headers: {
215
- 'Content-Type': 'application/json',
216
- ...options.headers
217
- }
218
- });
219
- };
220
-
221
- export const bioShow = <ThrowOnError extends boolean = false>(options: Options<BioShowData, ThrowOnError>) => {
222
- return (options.client ?? client).get<BioShowResponses, BioShowErrors, ThrowOnError>({
223
- security: [
224
- {
225
- scheme: 'bearer',
226
- type: 'http'
227
- }
228
- ],
229
- url: '/spaces/{space}/bio',
230
- ...options
231
- });
232
- };
233
-
234
- export const bioStore = <ThrowOnError extends boolean = false>(options: Options<BioStoreData, ThrowOnError>) => {
235
- return (options.client ?? client).post<BioStoreResponses, BioStoreErrors, ThrowOnError>({
236
- security: [
237
- {
238
- scheme: 'bearer',
239
- type: 'http'
240
- }
241
- ],
242
- url: '/spaces/{space}/bio',
243
- ...options,
244
- headers: {
245
- 'Content-Type': 'application/json',
246
- ...options.headers
247
- }
248
- });
249
- };
250
-
251
- export const bioUpdate = <ThrowOnError extends boolean = false>(options: Options<BioUpdateData, ThrowOnError>) => {
252
- return (options.client ?? client).put<BioUpdateResponses, BioUpdateErrors, ThrowOnError>({
253
- security: [
254
- {
255
- scheme: 'bearer',
256
- type: 'http'
257
- }
258
- ],
259
- url: '/spaces/{space}/bio',
260
- ...options,
261
- headers: {
262
- 'Content-Type': 'application/json',
263
- ...options.headers
264
- }
265
- });
266
- };
267
-
268
- export const bioAvatar = <ThrowOnError extends boolean = false>(options: Options<BioAvatarData, ThrowOnError>) => {
269
- return (options.client ?? client).post<BioAvatarResponses, BioAvatarErrors, ThrowOnError>({
270
- ...formDataBodySerializer,
271
- security: [
272
- {
273
- scheme: 'bearer',
274
- type: 'http'
275
- }
276
- ],
277
- url: '/spaces/{space}/bio/avatar',
278
- ...options,
279
- headers: {
280
- 'Content-Type': null,
281
- ...options.headers
282
- }
283
- });
284
- };
285
-
286
- /**
287
- * Upload a media file
288
- * Accepts images (JPEG, PNG, WebP) and videos (MP4, QuickTime). Images are auto-optimized.
289
- */
290
- export const mediaStore = <ThrowOnError extends boolean = false>(options: Options<MediaStoreData, ThrowOnError>) => {
291
- return (options.client ?? client).post<MediaStoreResponses, MediaStoreErrors, ThrowOnError>({
292
- ...formDataBodySerializer,
293
- security: [
294
- {
295
- scheme: 'bearer',
296
- type: 'http'
297
- }
298
- ],
299
- url: '/media',
300
- ...options,
301
- headers: {
302
- 'Content-Type': null,
303
- ...options.headers
304
- }
305
- });
306
- };
307
-
308
- /**
309
- * Delete a media file
310
- * Removes the media file from storage and deletes the record.
311
- */
312
- export const mediaDestroy = <ThrowOnError extends boolean = false>(options: Options<MediaDestroyData, ThrowOnError>) => {
313
- return (options.client ?? client).delete<MediaDestroyResponses, MediaDestroyErrors, ThrowOnError>({
314
- security: [
315
- {
316
- scheme: 'bearer',
317
- type: 'http'
318
- }
319
- ],
320
- url: '/media/{media}',
321
- ...options
322
- });
323
- };
324
-
325
- /**
326
- * List posts
327
- * Returns paginated posts for the space. Filterable by status, account, and date range via query parameters.
328
- */
329
- export const postsIndex = <ThrowOnError extends boolean = false>(options: Options<PostsIndexData, ThrowOnError>) => {
330
- return (options.client ?? client).get<PostsIndexResponses, PostsIndexErrors, ThrowOnError>({
331
- security: [
332
- {
333
- scheme: 'bearer',
334
- type: 'http'
335
- }
336
- ],
337
- url: '/spaces/{space}/posts',
338
- ...options
339
- });
340
- };
341
-
342
- /**
343
- * Create posts
344
- * Creates one or more posts as a cluster. Supports draft, scheduled, or immediate publishing modes.
345
- */
346
- export const postsStore = <ThrowOnError extends boolean = false>(options: Options<PostsStoreData, ThrowOnError>) => {
347
- return (options.client ?? client).post<PostsStoreResponses, PostsStoreErrors, ThrowOnError>({
348
- security: [
349
- {
350
- scheme: 'bearer',
351
- type: 'http'
352
- }
353
- ],
354
- url: '/spaces/{space}/posts',
355
- ...options,
356
- headers: {
357
- 'Content-Type': 'application/json',
358
- ...options.headers
359
- }
360
- });
361
- };
362
-
363
- /**
364
- * Delete a post
365
- * Permanently deletes the given post.
366
- */
367
- export const postsDestroy = <ThrowOnError extends boolean = false>(options: Options<PostsDestroyData, ThrowOnError>) => {
368
- return (options.client ?? client).delete<PostsDestroyResponses, PostsDestroyErrors, ThrowOnError>({
369
- security: [
370
- {
371
- scheme: 'bearer',
372
- type: 'http'
373
- }
374
- ],
375
- url: '/spaces/{space}/posts/{post}',
376
- ...options
377
- });
378
- };
379
-
380
- /**
381
- * Get a post
382
- * Returns a single post with its account, children, and media.
383
- */
384
- export const postsShow = <ThrowOnError extends boolean = false>(options: Options<PostsShowData, ThrowOnError>) => {
385
- return (options.client ?? client).get<PostsShowResponses, PostsShowErrors, ThrowOnError>({
386
- security: [
387
- {
388
- scheme: 'bearer',
389
- type: 'http'
390
- }
391
- ],
392
- url: '/spaces/{space}/posts/{post}',
393
- ...options
394
- });
395
- };
396
-
397
- /**
398
- * Update a post
399
- * Updates a single post's content, schedule, and media attachments.
400
- */
401
- export const postsUpdate = <ThrowOnError extends boolean = false>(options: Options<PostsUpdateData, ThrowOnError>) => {
402
- return (options.client ?? client).put<PostsUpdateResponses, PostsUpdateErrors, ThrowOnError>({
403
- security: [
404
- {
405
- scheme: 'bearer',
406
- type: 'http'
407
- }
408
- ],
409
- url: '/spaces/{space}/posts/{post}',
410
- ...options,
411
- headers: {
412
- 'Content-Type': 'application/json',
413
- ...options.headers
414
- }
415
- });
416
- };
417
-
418
- /**
419
- * Update a cluster of posts
420
- * Updates all posts sharing the given cluster ID. Handles adding/removing accounts and re-scheduling.
421
- */
422
- export const clustersUpdate = <ThrowOnError extends boolean = false>(options: Options<ClustersUpdateData, ThrowOnError>) => {
423
- return (options.client ?? client).put<ClustersUpdateResponses, ClustersUpdateErrors, ThrowOnError>({
424
- security: [
425
- {
426
- scheme: 'bearer',
427
- type: 'http'
428
- }
429
- ],
430
- url: '/spaces/{space}/clusters/{cluster_id}',
431
- ...options,
432
- headers: {
433
- 'Content-Type': 'application/json',
434
- ...options.headers
435
- }
436
- });
437
- };
438
-
439
- /**
440
- * Get next available queue slots
441
- * Returns up to 9 upcoming available time slots based on the space's scheduling configuration.
442
- */
443
- export const queueIndex = <ThrowOnError extends boolean = false>(options: Options<QueueIndexData, ThrowOnError>) => {
444
- return (options.client ?? client).get<QueueIndexResponses, QueueIndexErrors, ThrowOnError>({
445
- security: [
446
- {
447
- scheme: 'bearer',
448
- type: 'http'
449
- }
450
- ],
451
- url: '/spaces/{space}/queue',
452
- ...options
453
- });
454
- };
455
-
456
- /**
457
- * List slots
458
- * Returns all scheduling slots for the space, ordered by day and time.
459
- */
460
- export const slotsIndex = <ThrowOnError extends boolean = false>(options: Options<SlotsIndexData, ThrowOnError>) => {
461
- return (options.client ?? client).get<SlotsIndexResponses, SlotsIndexErrors, ThrowOnError>({
462
- security: [
463
- {
464
- scheme: 'bearer',
465
- type: 'http'
466
- }
467
- ],
468
- url: '/spaces/{space}/slots',
469
- ...options
470
- });
471
- };
472
-
473
- /**
474
- * Create slots
475
- * Creates scheduling slots for the given days of the week and time.
476
- */
477
- export const slotsStore = <ThrowOnError extends boolean = false>(options: Options<SlotsStoreData, ThrowOnError>) => {
478
- return (options.client ?? client).post<SlotsStoreResponses, SlotsStoreErrors, ThrowOnError>({
479
- security: [
480
- {
481
- scheme: 'bearer',
482
- type: 'http'
483
- }
484
- ],
485
- url: '/spaces/{space}/slots',
486
- ...options,
487
- headers: {
488
- 'Content-Type': 'application/json',
489
- ...options.headers
490
- }
491
- });
492
- };
493
-
494
- /**
495
- * Delete a slot
496
- * Removes a scheduling slot from the space.
497
- */
498
- export const slotsDestroy = <ThrowOnError extends boolean = false>(options: Options<SlotsDestroyData, ThrowOnError>) => {
499
- return (options.client ?? client).delete<SlotsDestroyResponses, SlotsDestroyErrors, ThrowOnError>({
500
- security: [
501
- {
502
- scheme: 'bearer',
503
- type: 'http'
504
- }
505
- ],
506
- url: '/spaces/{space}/slots/{slot}',
507
- ...options
508
- });
509
- };
510
-
511
- /**
512
- * List spaces
513
- * Returns all spaces belonging to the authenticated user, ordered by most recent.
514
- */
515
- export const spacesIndex = <ThrowOnError extends boolean = false>(options?: Options<SpacesIndexData, ThrowOnError>) => {
516
- return (options?.client ?? client).get<SpacesIndexResponses, SpacesIndexErrors, ThrowOnError>({
517
- security: [
518
- {
519
- scheme: 'bearer',
520
- type: 'http'
521
- }
522
- ],
523
- url: '/spaces',
524
- ...options
525
- });
526
- };
527
-
528
- /**
529
- * Create a space
530
- * Creates a new space for the authenticated user.
531
- */
532
- export const spacesStore = <ThrowOnError extends boolean = false>(options: Options<SpacesStoreData, ThrowOnError>) => {
533
- return (options.client ?? client).post<SpacesStoreResponses, SpacesStoreErrors, ThrowOnError>({
534
- security: [
535
- {
536
- scheme: 'bearer',
537
- type: 'http'
538
- }
539
- ],
540
- url: '/spaces',
541
- ...options,
542
- headers: {
543
- 'Content-Type': 'application/json',
544
- ...options.headers
545
- }
546
- });
547
- };
548
-
549
- /**
550
- * Delete a space
551
- * Permanently deletes the given space and all associated data.
552
- */
553
- export const spacesDestroy = <ThrowOnError extends boolean = false>(options: Options<SpacesDestroyData, ThrowOnError>) => {
554
- return (options.client ?? client).delete<SpacesDestroyResponses, SpacesDestroyErrors, ThrowOnError>({
555
- security: [
556
- {
557
- scheme: 'bearer',
558
- type: 'http'
559
- }
560
- ],
561
- url: '/spaces/{space}',
562
- ...options
563
- });
564
- };
565
-
566
- /**
567
- * Get a space
568
- * Returns a single space by ID.
569
- */
570
- export const spacesShow = <ThrowOnError extends boolean = false>(options: Options<SpacesShowData, ThrowOnError>) => {
571
- return (options.client ?? client).get<SpacesShowResponses, SpacesShowErrors, ThrowOnError>({
572
- security: [
573
- {
574
- scheme: 'bearer',
575
- type: 'http'
576
- }
577
- ],
578
- url: '/spaces/{space}',
579
- ...options
580
- });
581
- };
582
-
583
- /**
584
- * Update a space
585
- * Updates the given space's settings.
586
- */
587
- export const spacesUpdate = <ThrowOnError extends boolean = false>(options: Options<SpacesUpdateData, ThrowOnError>) => {
588
- return (options.client ?? client).put<SpacesUpdateResponses, SpacesUpdateErrors, ThrowOnError>({
589
- security: [
590
- {
591
- scheme: 'bearer',
592
- type: 'http'
593
- }
594
- ],
595
- url: '/spaces/{space}',
596
- ...options,
597
- headers: {
598
- 'Content-Type': 'application/json',
599
- ...options.headers
600
- }
601
- });
602
- };
603
-
604
- /**
605
- * Get subscription details
606
- * Returns the current plan, usage limits, trial status, and cancellation state.
607
- */
608
- export const subscriptionShow = <ThrowOnError extends boolean = false>(options?: Options<SubscriptionShowData, ThrowOnError>) => {
609
- return (options?.client ?? client).get<SubscriptionShowResponses, SubscriptionShowErrors, ThrowOnError>({
610
- security: [
611
- {
612
- scheme: 'bearer',
613
- type: 'http'
614
- }
615
- ],
616
- url: '/subscription',
617
- ...options
618
- });
619
- };
620
-
621
- /**
622
- * List webhooks
623
- * Returns all webhooks configured for the given space.
624
- */
625
- export const webhooksIndex = <ThrowOnError extends boolean = false>(options: Options<WebhooksIndexData, ThrowOnError>) => {
626
- return (options.client ?? client).get<WebhooksIndexResponses, WebhooksIndexErrors, ThrowOnError>({
627
- security: [
628
- {
629
- scheme: 'bearer',
630
- type: 'http'
631
- }
632
- ],
633
- url: '/spaces/{space}/webhooks',
634
- ...options
635
- });
636
- };
637
-
638
- /**
639
- * Create a webhook
640
- * Registers a new webhook endpoint with an auto-generated signing secret.
641
- */
642
- export const webhooksStore = <ThrowOnError extends boolean = false>(options: Options<WebhooksStoreData, ThrowOnError>) => {
643
- return (options.client ?? client).post<WebhooksStoreResponses, WebhooksStoreErrors, ThrowOnError>({
644
- security: [
645
- {
646
- scheme: 'bearer',
647
- type: 'http'
648
- }
649
- ],
650
- url: '/spaces/{space}/webhooks',
651
- ...options,
652
- headers: {
653
- 'Content-Type': 'application/json',
654
- ...options.headers
655
- }
656
- });
657
- };
658
-
659
- /**
660
- * Delete a webhook
661
- * Permanently removes the webhook endpoint.
662
- */
663
- export const webhooksDestroy = <ThrowOnError extends boolean = false>(options: Options<WebhooksDestroyData, ThrowOnError>) => {
664
- return (options.client ?? client).delete<WebhooksDestroyResponses, WebhooksDestroyErrors, ThrowOnError>({
665
- security: [
666
- {
667
- scheme: 'bearer',
668
- type: 'http'
669
- }
670
- ],
671
- url: '/spaces/{space}/webhooks/{webhook}',
672
- ...options
673
- });
674
- };
675
-
676
- /**
677
- * Update a webhook
678
- * Updates the webhook's URL, events, or active status.
679
- */
680
- export const webhooksUpdate = <ThrowOnError extends boolean = false>(options: Options<WebhooksUpdateData, ThrowOnError>) => {
681
- return (options.client ?? client).put<WebhooksUpdateResponses, WebhooksUpdateErrors, ThrowOnError>({
682
- security: [
683
- {
684
- scheme: 'bearer',
685
- type: 'http'
686
- }
687
- ],
688
- url: '/spaces/{space}/webhooks/{webhook}',
689
- ...options,
690
- headers: {
691
- 'Content-Type': 'application/json',
692
- ...options.headers
693
- }
694
- });
695
- };