@zilfu/sdk 0.0.1 → 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.
@@ -2,9 +2,9 @@
2
2
 
3
3
  import { type Client, formDataBodySerializer, type Options as Options2, type TDataShape } from './client';
4
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';
5
+ import type { DeleteApiTokensByTokenIdData, DeleteApiTokensByTokenIdErrors, DeleteApiTokensByTokenIdResponses, DeleteMediaByMediaData, DeleteMediaByMediaErrors, DeleteMediaByMediaResponses, DeleteSpacesBySpaceAccountsByAccountData, DeleteSpacesBySpaceAccountsByAccountErrors, DeleteSpacesBySpaceAccountsByAccountResponses, DeleteSpacesBySpaceAccountsData, DeleteSpacesBySpaceAccountsErrors, DeleteSpacesBySpaceAccountsResponses, DeleteSpacesBySpaceBioBlocksByBlockData, DeleteSpacesBySpaceBioBlocksByBlockErrors, DeleteSpacesBySpaceBioBlocksByBlockResponses, DeleteSpacesBySpaceData, DeleteSpacesBySpaceErrors, DeleteSpacesBySpacePostsByPostData, DeleteSpacesBySpacePostsByPostErrors, DeleteSpacesBySpacePostsByPostResponses, DeleteSpacesBySpaceResponses, DeleteSpacesBySpaceSlotsBySlotData, DeleteSpacesBySpaceSlotsBySlotErrors, DeleteSpacesBySpaceSlotsBySlotResponses, DeleteSpacesBySpaceWebhooksByWebhookData, DeleteSpacesBySpaceWebhooksByWebhookErrors, DeleteSpacesBySpaceWebhooksByWebhookResponses, GetSpacesBySpaceAccountsByAccountBoardsData, GetSpacesBySpaceAccountsByAccountBoardsErrors, GetSpacesBySpaceAccountsByAccountBoardsResponses, GetSpacesBySpaceAccountsData, GetSpacesBySpaceAccountsErrors, GetSpacesBySpaceAccountsResponses, GetSpacesBySpaceBioBlocksData, GetSpacesBySpaceBioBlocksErrors, GetSpacesBySpaceBioBlocksResponses, GetSpacesBySpaceBioData, GetSpacesBySpaceBioErrors, GetSpacesBySpaceBioResponses, GetSpacesBySpaceData, GetSpacesBySpaceErrors, GetSpacesBySpacePostsByPostData, GetSpacesBySpacePostsByPostErrors, GetSpacesBySpacePostsByPostResponses, GetSpacesBySpacePostsData, GetSpacesBySpacePostsErrors, GetSpacesBySpacePostsResponses, GetSpacesBySpaceQueueData, GetSpacesBySpaceQueueErrors, GetSpacesBySpaceQueueResponses, GetSpacesBySpaceResponses, GetSpacesBySpaceSlotsData, GetSpacesBySpaceSlotsErrors, GetSpacesBySpaceSlotsResponses, GetSpacesBySpaceWebhooksData, GetSpacesBySpaceWebhooksErrors, GetSpacesBySpaceWebhooksResponses, GetSpacesData, GetSpacesErrors, GetSpacesResponses, GetSubscriptionData, GetSubscriptionErrors, GetSubscriptionResponses, PatchSpacesBySpaceAccountsByAccountActivateData, PatchSpacesBySpaceAccountsByAccountActivateErrors, PatchSpacesBySpaceAccountsByAccountActivateResponses, PostApiTokensData, PostApiTokensErrors, PostApiTokensResponses, PostMediaData, PostMediaErrors, PostMediaResponses, PostSpacesBySpaceBioAvatarData, PostSpacesBySpaceBioAvatarErrors, PostSpacesBySpaceBioAvatarResponses, PostSpacesBySpaceBioBlocksByBlockReorderData, PostSpacesBySpaceBioBlocksByBlockReorderErrors, PostSpacesBySpaceBioBlocksByBlockReorderResponses, PostSpacesBySpaceBioBlocksData, PostSpacesBySpaceBioBlocksErrors, PostSpacesBySpaceBioBlocksResponses, PostSpacesBySpaceBioData, PostSpacesBySpaceBioErrors, PostSpacesBySpaceBioResponses, PostSpacesBySpacePostsData, PostSpacesBySpacePostsErrors, PostSpacesBySpacePostsResponses, PostSpacesBySpaceSlotsData, PostSpacesBySpaceSlotsErrors, PostSpacesBySpaceSlotsResponses, PostSpacesBySpaceWebhooksData, PostSpacesBySpaceWebhooksErrors, PostSpacesBySpaceWebhooksResponses, PostSpacesData, PostSpacesErrors, PostSpacesResponses, PutSpacesBySpaceBioBlocksByBlockData, PutSpacesBySpaceBioBlocksByBlockErrors, PutSpacesBySpaceBioBlocksByBlockResponses, PutSpacesBySpaceBioData, PutSpacesBySpaceBioErrors, PutSpacesBySpaceBioResponses, PutSpacesBySpaceClustersByClusterIdData, PutSpacesBySpaceClustersByClusterIdErrors, PutSpacesBySpaceClustersByClusterIdResponses, PutSpacesBySpaceData, PutSpacesBySpaceErrors, PutSpacesBySpacePostsByPostData, PutSpacesBySpacePostsByPostErrors, PutSpacesBySpacePostsByPostResponses, PutSpacesBySpaceResponses, PutSpacesBySpaceWebhooksByWebhookData, PutSpacesBySpaceWebhooksByWebhookErrors, PutSpacesBySpaceWebhooksByWebhookResponses } from './types.gen';
6
6
 
7
- export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
7
+ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
8
8
  /**
9
9
  * You can provide a client instance returned by `createClient()` instead of
10
10
  * individual options. This might be also useful if you want to implement a
@@ -18,678 +18,641 @@ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends
18
18
  meta?: Record<string, unknown>;
19
19
  };
20
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
21
+ class HeyApiClient {
22
+ protected client: Client;
23
+
24
+ constructor(args?: {
25
+ client?: Client;
26
+ }) {
27
+ this.client = args?.client ?? client;
28
+ }
29
+ }
30
+
31
+ class HeyApiRegistry<T> {
32
+ private readonly defaultKey = 'default';
33
+
34
+ private readonly instances: Map<string, T> = new Map();
35
+
36
+ get(key?: string): T {
37
+ const instance = this.instances.get(key ?? this.defaultKey);
38
+ if (!instance) {
39
+ throw new Error(`No SDK client found. Create one with "new ZilfuClient()" to fix this error.`);
600
40
  }
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
- };
41
+ return instance;
42
+ }
43
+
44
+ set(value: T, key?: string): void {
45
+ this.instances.set(key ?? this.defaultKey, value);
46
+ }
47
+ }
48
+
49
+ export class Accounts extends HeyApiClient {
50
+ /**
51
+ * Disconnect multiple accounts
52
+ *
53
+ * Removes several social account connections in a single request and dispatches a webhook event for each.
54
+ */
55
+ public deleteMany<ThrowOnError extends boolean = false>(options: Options<DeleteSpacesBySpaceAccountsData, ThrowOnError>) {
56
+ return (options.client ?? this.client).delete<DeleteSpacesBySpaceAccountsResponses, DeleteSpacesBySpaceAccountsErrors, ThrowOnError>({
57
+ security: [{ scheme: 'bearer', type: 'http' }],
58
+ url: '/spaces/{space}/accounts',
59
+ ...options
60
+ });
61
+ }
62
+
63
+ /**
64
+ * List accounts
65
+ *
66
+ * Returns all connected social accounts for the given space.
67
+ */
68
+ public list<ThrowOnError extends boolean = false>(options: Options<GetSpacesBySpaceAccountsData, ThrowOnError>) {
69
+ return (options.client ?? this.client).get<GetSpacesBySpaceAccountsResponses, GetSpacesBySpaceAccountsErrors, ThrowOnError>({
70
+ security: [{ scheme: 'bearer', type: 'http' }],
71
+ url: '/spaces/{space}/accounts',
72
+ ...options
73
+ });
74
+ }
75
+
76
+ /**
77
+ * Activate an account
78
+ *
79
+ * Activates the given account and deactivates all other accounts on the same platform within the space.
80
+ */
81
+ public activate<ThrowOnError extends boolean = false>(options: Options<PatchSpacesBySpaceAccountsByAccountActivateData, ThrowOnError>) {
82
+ return (options.client ?? this.client).patch<PatchSpacesBySpaceAccountsByAccountActivateResponses, PatchSpacesBySpaceAccountsByAccountActivateErrors, ThrowOnError>({
83
+ security: [{ scheme: 'bearer', type: 'http' }],
84
+ url: '/spaces/{space}/accounts/{account}/activate',
85
+ ...options
86
+ });
87
+ }
88
+
89
+ /**
90
+ * List Pinterest boards
91
+ *
92
+ * Returns the Pinterest boards available for the given account.
93
+ */
94
+ public boards<ThrowOnError extends boolean = false>(options: Options<GetSpacesBySpaceAccountsByAccountBoardsData, ThrowOnError>) {
95
+ return (options.client ?? this.client).get<GetSpacesBySpaceAccountsByAccountBoardsResponses, GetSpacesBySpaceAccountsByAccountBoardsErrors, ThrowOnError>({
96
+ security: [{ scheme: 'bearer', type: 'http' }],
97
+ url: '/spaces/{space}/accounts/{account}/boards',
98
+ ...options
99
+ });
100
+ }
101
+
102
+ /**
103
+ * Disconnect an account
104
+ *
105
+ * Removes the social account connection and dispatches a webhook event.
106
+ */
107
+ public delete<ThrowOnError extends boolean = false>(options: Options<DeleteSpacesBySpaceAccountsByAccountData, ThrowOnError>) {
108
+ return (options.client ?? this.client).delete<DeleteSpacesBySpaceAccountsByAccountResponses, DeleteSpacesBySpaceAccountsByAccountErrors, ThrowOnError>({
109
+ security: [{ scheme: 'bearer', type: 'http' }],
110
+ url: '/spaces/{space}/accounts/{account}',
111
+ ...options
112
+ });
113
+ }
114
+ }
115
+
116
+ export class Tokens extends HeyApiClient {
117
+ /**
118
+ * Create an API token
119
+ *
120
+ * Generates a new personal access token for the authenticated user.
121
+ */
122
+ public create<ThrowOnError extends boolean = false>(options: Options<PostApiTokensData, ThrowOnError>) {
123
+ return (options.client ?? this.client).post<PostApiTokensResponses, PostApiTokensErrors, ThrowOnError>({
124
+ security: [{ scheme: 'bearer', type: 'http' }],
125
+ url: '/api-tokens',
126
+ ...options,
127
+ headers: {
128
+ 'Content-Type': 'application/json',
129
+ ...options.headers
130
+ }
131
+ });
132
+ }
133
+
134
+ /**
135
+ * Revoke an API token
136
+ *
137
+ * Deletes the specified personal access token.
138
+ */
139
+ public delete<ThrowOnError extends boolean = false>(options: Options<DeleteApiTokensByTokenIdData, ThrowOnError>) {
140
+ return (options.client ?? this.client).delete<DeleteApiTokensByTokenIdResponses, DeleteApiTokensByTokenIdErrors, ThrowOnError>({
141
+ security: [{ scheme: 'bearer', type: 'http' }],
142
+ url: '/api-tokens/{tokenId}',
143
+ ...options
144
+ });
145
+ }
146
+ }
147
+
148
+ export class BioBlocks extends HeyApiClient {
149
+ public list<ThrowOnError extends boolean = false>(options: Options<GetSpacesBySpaceBioBlocksData, ThrowOnError>) {
150
+ return (options.client ?? this.client).get<GetSpacesBySpaceBioBlocksResponses, GetSpacesBySpaceBioBlocksErrors, ThrowOnError>({
151
+ security: [{ scheme: 'bearer', type: 'http' }],
152
+ url: '/spaces/{space}/bio/blocks',
153
+ ...options
154
+ });
155
+ }
156
+
157
+ public create<ThrowOnError extends boolean = false>(options: Options<PostSpacesBySpaceBioBlocksData, ThrowOnError>) {
158
+ return (options.client ?? this.client).post<PostSpacesBySpaceBioBlocksResponses, PostSpacesBySpaceBioBlocksErrors, ThrowOnError>({
159
+ security: [{ scheme: 'bearer', type: 'http' }],
160
+ url: '/spaces/{space}/bio/blocks',
161
+ ...options,
162
+ headers: {
163
+ 'Content-Type': 'application/json',
164
+ ...options.headers
165
+ }
166
+ });
167
+ }
168
+
169
+ public delete<ThrowOnError extends boolean = false>(options: Options<DeleteSpacesBySpaceBioBlocksByBlockData, ThrowOnError>) {
170
+ return (options.client ?? this.client).delete<DeleteSpacesBySpaceBioBlocksByBlockResponses, DeleteSpacesBySpaceBioBlocksByBlockErrors, ThrowOnError>({
171
+ security: [{ scheme: 'bearer', type: 'http' }],
172
+ url: '/spaces/{space}/bio/blocks/{block}',
173
+ ...options
174
+ });
175
+ }
176
+
177
+ public update<ThrowOnError extends boolean = false>(options: Options<PutSpacesBySpaceBioBlocksByBlockData, ThrowOnError>) {
178
+ return (options.client ?? this.client).put<PutSpacesBySpaceBioBlocksByBlockResponses, PutSpacesBySpaceBioBlocksByBlockErrors, ThrowOnError>({
179
+ security: [{ scheme: 'bearer', type: 'http' }],
180
+ url: '/spaces/{space}/bio/blocks/{block}',
181
+ ...options,
182
+ headers: {
183
+ 'Content-Type': 'application/json',
184
+ ...options.headers
185
+ }
186
+ });
187
+ }
188
+
189
+ public reorder<ThrowOnError extends boolean = false>(options: Options<PostSpacesBySpaceBioBlocksByBlockReorderData, ThrowOnError>) {
190
+ return (options.client ?? this.client).post<PostSpacesBySpaceBioBlocksByBlockReorderResponses, PostSpacesBySpaceBioBlocksByBlockReorderErrors, ThrowOnError>({
191
+ security: [{ scheme: 'bearer', type: 'http' }],
192
+ url: '/spaces/{space}/bio/blocks/{block}/reorder',
193
+ ...options,
194
+ headers: {
195
+ 'Content-Type': 'application/json',
196
+ ...options.headers
197
+ }
198
+ });
199
+ }
200
+ }
201
+
202
+ export class Bio extends HeyApiClient {
203
+ public get<ThrowOnError extends boolean = false>(options: Options<GetSpacesBySpaceBioData, ThrowOnError>) {
204
+ return (options.client ?? this.client).get<GetSpacesBySpaceBioResponses, GetSpacesBySpaceBioErrors, ThrowOnError>({
205
+ security: [{ scheme: 'bearer', type: 'http' }],
206
+ url: '/spaces/{space}/bio',
207
+ ...options
208
+ });
209
+ }
210
+
211
+ public create<ThrowOnError extends boolean = false>(options: Options<PostSpacesBySpaceBioData, ThrowOnError>) {
212
+ return (options.client ?? this.client).post<PostSpacesBySpaceBioResponses, PostSpacesBySpaceBioErrors, ThrowOnError>({
213
+ security: [{ scheme: 'bearer', type: 'http' }],
214
+ url: '/spaces/{space}/bio',
215
+ ...options,
216
+ headers: {
217
+ 'Content-Type': 'application/json',
218
+ ...options.headers
219
+ }
220
+ });
221
+ }
222
+
223
+ public update<ThrowOnError extends boolean = false>(options: Options<PutSpacesBySpaceBioData, ThrowOnError>) {
224
+ return (options.client ?? this.client).put<PutSpacesBySpaceBioResponses, PutSpacesBySpaceBioErrors, ThrowOnError>({
225
+ security: [{ scheme: 'bearer', type: 'http' }],
226
+ url: '/spaces/{space}/bio',
227
+ ...options,
228
+ headers: {
229
+ 'Content-Type': 'application/json',
230
+ ...options.headers
231
+ }
232
+ });
233
+ }
234
+
235
+ public uploadAvatar<ThrowOnError extends boolean = false>(options: Options<PostSpacesBySpaceBioAvatarData, ThrowOnError>) {
236
+ return (options.client ?? this.client).post<PostSpacesBySpaceBioAvatarResponses, PostSpacesBySpaceBioAvatarErrors, ThrowOnError>({
237
+ ...formDataBodySerializer,
238
+ security: [{ scheme: 'bearer', type: 'http' }],
239
+ url: '/spaces/{space}/bio/avatar',
240
+ ...options,
241
+ headers: {
242
+ 'Content-Type': null,
243
+ ...options.headers
244
+ }
245
+ });
246
+ }
247
+ }
248
+
249
+ export class Media extends HeyApiClient {
250
+ /**
251
+ * Upload a media file
252
+ *
253
+ * Accepts images (JPEG, PNG, WebP) and videos (MP4, QuickTime). Images are auto-optimized.
254
+ */
255
+ public create<ThrowOnError extends boolean = false>(options: Options<PostMediaData, ThrowOnError>) {
256
+ return (options.client ?? this.client).post<PostMediaResponses, PostMediaErrors, ThrowOnError>({
257
+ ...formDataBodySerializer,
258
+ security: [{ scheme: 'bearer', type: 'http' }],
259
+ url: '/media',
260
+ ...options,
261
+ headers: {
262
+ 'Content-Type': null,
263
+ ...options.headers
264
+ }
265
+ });
266
+ }
267
+
268
+ /**
269
+ * Delete a media file
270
+ *
271
+ * Removes the media file from storage and deletes the record.
272
+ */
273
+ public delete<ThrowOnError extends boolean = false>(options: Options<DeleteMediaByMediaData, ThrowOnError>) {
274
+ return (options.client ?? this.client).delete<DeleteMediaByMediaResponses, DeleteMediaByMediaErrors, ThrowOnError>({
275
+ security: [{ scheme: 'bearer', type: 'http' }],
276
+ url: '/media/{media}',
277
+ ...options
278
+ });
279
+ }
280
+ }
281
+
282
+ export class Posts extends HeyApiClient {
283
+ /**
284
+ * List posts
285
+ *
286
+ * Returns paginated posts for the space. Filterable by status, account, and date range via query parameters.
287
+ */
288
+ public list<ThrowOnError extends boolean = false>(options: Options<GetSpacesBySpacePostsData, ThrowOnError>) {
289
+ return (options.client ?? this.client).get<GetSpacesBySpacePostsResponses, GetSpacesBySpacePostsErrors, ThrowOnError>({
290
+ security: [{ scheme: 'bearer', type: 'http' }],
291
+ url: '/spaces/{space}/posts',
292
+ ...options
293
+ });
294
+ }
295
+
296
+ /**
297
+ * Create posts
298
+ *
299
+ * Creates one or more posts as a cluster. Supports draft, scheduled, or immediate publishing modes.
300
+ */
301
+ public create<ThrowOnError extends boolean = false>(options: Options<PostSpacesBySpacePostsData, ThrowOnError>) {
302
+ return (options.client ?? this.client).post<PostSpacesBySpacePostsResponses, PostSpacesBySpacePostsErrors, ThrowOnError>({
303
+ security: [{ scheme: 'bearer', type: 'http' }],
304
+ url: '/spaces/{space}/posts',
305
+ ...options,
306
+ headers: {
307
+ 'Content-Type': 'application/json',
308
+ ...options.headers
309
+ }
310
+ });
311
+ }
312
+
313
+ /**
314
+ * Delete a post
315
+ *
316
+ * Permanently deletes the given post.
317
+ */
318
+ public delete<ThrowOnError extends boolean = false>(options: Options<DeleteSpacesBySpacePostsByPostData, ThrowOnError>) {
319
+ return (options.client ?? this.client).delete<DeleteSpacesBySpacePostsByPostResponses, DeleteSpacesBySpacePostsByPostErrors, ThrowOnError>({
320
+ security: [{ scheme: 'bearer', type: 'http' }],
321
+ url: '/spaces/{space}/posts/{post}',
322
+ ...options
323
+ });
324
+ }
325
+
326
+ /**
327
+ * Get a post
328
+ *
329
+ * Returns a single post with its account, children, and media.
330
+ */
331
+ public get<ThrowOnError extends boolean = false>(options: Options<GetSpacesBySpacePostsByPostData, ThrowOnError>) {
332
+ return (options.client ?? this.client).get<GetSpacesBySpacePostsByPostResponses, GetSpacesBySpacePostsByPostErrors, ThrowOnError>({
333
+ security: [{ scheme: 'bearer', type: 'http' }],
334
+ url: '/spaces/{space}/posts/{post}',
335
+ ...options
336
+ });
337
+ }
338
+
339
+ /**
340
+ * Update a post
341
+ *
342
+ * Updates a single post's content, schedule, and media attachments.
343
+ */
344
+ public update<ThrowOnError extends boolean = false>(options: Options<PutSpacesBySpacePostsByPostData, ThrowOnError>) {
345
+ return (options.client ?? this.client).put<PutSpacesBySpacePostsByPostResponses, PutSpacesBySpacePostsByPostErrors, ThrowOnError>({
346
+ security: [{ scheme: 'bearer', type: 'http' }],
347
+ url: '/spaces/{space}/posts/{post}',
348
+ ...options,
349
+ headers: {
350
+ 'Content-Type': 'application/json',
351
+ ...options.headers
352
+ }
353
+ });
354
+ }
355
+ }
356
+
357
+ export class Clusters extends HeyApiClient {
358
+ /**
359
+ * Update a cluster of posts
360
+ *
361
+ * Updates all posts sharing the given cluster ID. Handles adding/removing accounts and re-scheduling.
362
+ */
363
+ public update<ThrowOnError extends boolean = false>(options: Options<PutSpacesBySpaceClustersByClusterIdData, ThrowOnError>) {
364
+ return (options.client ?? this.client).put<PutSpacesBySpaceClustersByClusterIdResponses, PutSpacesBySpaceClustersByClusterIdErrors, ThrowOnError>({
365
+ security: [{ scheme: 'bearer', type: 'http' }],
366
+ url: '/spaces/{space}/clusters/{cluster_id}',
367
+ ...options,
368
+ headers: {
369
+ 'Content-Type': 'application/json',
370
+ ...options.headers
371
+ }
372
+ });
373
+ }
374
+ }
375
+
376
+ export class Queue extends HeyApiClient {
377
+ /**
378
+ * Get next available queue slots
379
+ *
380
+ * Returns up to 9 upcoming available time slots based on the space's scheduling configuration.
381
+ */
382
+ public list<ThrowOnError extends boolean = false>(options: Options<GetSpacesBySpaceQueueData, ThrowOnError>) {
383
+ return (options.client ?? this.client).get<GetSpacesBySpaceQueueResponses, GetSpacesBySpaceQueueErrors, ThrowOnError>({
384
+ security: [{ scheme: 'bearer', type: 'http' }],
385
+ url: '/spaces/{space}/queue',
386
+ ...options
387
+ });
388
+ }
389
+ }
390
+
391
+ export class Slots extends HeyApiClient {
392
+ /**
393
+ * List slots
394
+ *
395
+ * Returns all scheduling slots for the space, ordered by day and time.
396
+ */
397
+ public list<ThrowOnError extends boolean = false>(options: Options<GetSpacesBySpaceSlotsData, ThrowOnError>) {
398
+ return (options.client ?? this.client).get<GetSpacesBySpaceSlotsResponses, GetSpacesBySpaceSlotsErrors, ThrowOnError>({
399
+ security: [{ scheme: 'bearer', type: 'http' }],
400
+ url: '/spaces/{space}/slots',
401
+ ...options
402
+ });
403
+ }
404
+
405
+ /**
406
+ * Create slots
407
+ *
408
+ * Creates scheduling slots for the given days of the week and time.
409
+ */
410
+ public create<ThrowOnError extends boolean = false>(options: Options<PostSpacesBySpaceSlotsData, ThrowOnError>) {
411
+ return (options.client ?? this.client).post<PostSpacesBySpaceSlotsResponses, PostSpacesBySpaceSlotsErrors, ThrowOnError>({
412
+ security: [{ scheme: 'bearer', type: 'http' }],
413
+ url: '/spaces/{space}/slots',
414
+ ...options,
415
+ headers: {
416
+ 'Content-Type': 'application/json',
417
+ ...options.headers
418
+ }
419
+ });
420
+ }
421
+
422
+ /**
423
+ * Delete a slot
424
+ *
425
+ * Removes a scheduling slot from the space.
426
+ */
427
+ public delete<ThrowOnError extends boolean = false>(options: Options<DeleteSpacesBySpaceSlotsBySlotData, ThrowOnError>) {
428
+ return (options.client ?? this.client).delete<DeleteSpacesBySpaceSlotsBySlotResponses, DeleteSpacesBySpaceSlotsBySlotErrors, ThrowOnError>({
429
+ security: [{ scheme: 'bearer', type: 'http' }],
430
+ url: '/spaces/{space}/slots/{slot}',
431
+ ...options
432
+ });
433
+ }
434
+ }
435
+
436
+ export class Spaces extends HeyApiClient {
437
+ /**
438
+ * List spaces
439
+ *
440
+ * Returns all spaces belonging to the authenticated user, ordered by most recent.
441
+ */
442
+ public list<ThrowOnError extends boolean = false>(options?: Options<GetSpacesData, ThrowOnError>) {
443
+ return (options?.client ?? this.client).get<GetSpacesResponses, GetSpacesErrors, ThrowOnError>({
444
+ security: [{ scheme: 'bearer', type: 'http' }],
445
+ url: '/spaces',
446
+ ...options
447
+ });
448
+ }
449
+
450
+ /**
451
+ * Create a space
452
+ *
453
+ * Creates a new space for the authenticated user.
454
+ */
455
+ public create<ThrowOnError extends boolean = false>(options: Options<PostSpacesData, ThrowOnError>) {
456
+ return (options.client ?? this.client).post<PostSpacesResponses, PostSpacesErrors, ThrowOnError>({
457
+ security: [{ scheme: 'bearer', type: 'http' }],
458
+ url: '/spaces',
459
+ ...options,
460
+ headers: {
461
+ 'Content-Type': 'application/json',
462
+ ...options.headers
463
+ }
464
+ });
465
+ }
466
+
467
+ /**
468
+ * Delete a space
469
+ *
470
+ * Permanently deletes the given space and all associated data.
471
+ */
472
+ public delete<ThrowOnError extends boolean = false>(options: Options<DeleteSpacesBySpaceData, ThrowOnError>) {
473
+ return (options.client ?? this.client).delete<DeleteSpacesBySpaceResponses, DeleteSpacesBySpaceErrors, ThrowOnError>({
474
+ security: [{ scheme: 'bearer', type: 'http' }],
475
+ url: '/spaces/{space}',
476
+ ...options
477
+ });
478
+ }
479
+
480
+ /**
481
+ * Get a space
482
+ *
483
+ * Returns a single space by ID.
484
+ */
485
+ public get<ThrowOnError extends boolean = false>(options: Options<GetSpacesBySpaceData, ThrowOnError>) {
486
+ return (options.client ?? this.client).get<GetSpacesBySpaceResponses, GetSpacesBySpaceErrors, ThrowOnError>({
487
+ security: [{ scheme: 'bearer', type: 'http' }],
488
+ url: '/spaces/{space}',
489
+ ...options
490
+ });
491
+ }
492
+
493
+ /**
494
+ * Update a space
495
+ *
496
+ * Updates the given space's settings.
497
+ */
498
+ public update<ThrowOnError extends boolean = false>(options: Options<PutSpacesBySpaceData, ThrowOnError>) {
499
+ return (options.client ?? this.client).put<PutSpacesBySpaceResponses, PutSpacesBySpaceErrors, ThrowOnError>({
500
+ security: [{ scheme: 'bearer', type: 'http' }],
501
+ url: '/spaces/{space}',
502
+ ...options,
503
+ headers: {
504
+ 'Content-Type': 'application/json',
505
+ ...options.headers
506
+ }
507
+ });
508
+ }
509
+ }
510
+
511
+ export class Subscription extends HeyApiClient {
512
+ /**
513
+ * Get subscription details
514
+ *
515
+ * Returns the current plan, usage limits, trial status, and cancellation state.
516
+ */
517
+ public get<ThrowOnError extends boolean = false>(options?: Options<GetSubscriptionData, ThrowOnError>) {
518
+ return (options?.client ?? this.client).get<GetSubscriptionResponses, GetSubscriptionErrors, ThrowOnError>({
519
+ security: [{ scheme: 'bearer', type: 'http' }],
520
+ url: '/subscription',
521
+ ...options
522
+ });
523
+ }
524
+ }
525
+
526
+ export class Webhooks extends HeyApiClient {
527
+ /**
528
+ * List webhooks
529
+ *
530
+ * Returns all webhooks configured for the given space.
531
+ */
532
+ public list<ThrowOnError extends boolean = false>(options: Options<GetSpacesBySpaceWebhooksData, ThrowOnError>) {
533
+ return (options.client ?? this.client).get<GetSpacesBySpaceWebhooksResponses, GetSpacesBySpaceWebhooksErrors, ThrowOnError>({
534
+ security: [{ scheme: 'bearer', type: 'http' }],
535
+ url: '/spaces/{space}/webhooks',
536
+ ...options
537
+ });
538
+ }
539
+
540
+ /**
541
+ * Create a webhook
542
+ *
543
+ * Registers a new webhook endpoint with an auto-generated signing secret.
544
+ */
545
+ public create<ThrowOnError extends boolean = false>(options: Options<PostSpacesBySpaceWebhooksData, ThrowOnError>) {
546
+ return (options.client ?? this.client).post<PostSpacesBySpaceWebhooksResponses, PostSpacesBySpaceWebhooksErrors, ThrowOnError>({
547
+ security: [{ scheme: 'bearer', type: 'http' }],
548
+ url: '/spaces/{space}/webhooks',
549
+ ...options,
550
+ headers: {
551
+ 'Content-Type': 'application/json',
552
+ ...options.headers
553
+ }
554
+ });
555
+ }
556
+
557
+ /**
558
+ * Delete a webhook
559
+ *
560
+ * Permanently removes the webhook endpoint.
561
+ */
562
+ public delete<ThrowOnError extends boolean = false>(options: Options<DeleteSpacesBySpaceWebhooksByWebhookData, ThrowOnError>) {
563
+ return (options.client ?? this.client).delete<DeleteSpacesBySpaceWebhooksByWebhookResponses, DeleteSpacesBySpaceWebhooksByWebhookErrors, ThrowOnError>({
564
+ security: [{ scheme: 'bearer', type: 'http' }],
565
+ url: '/spaces/{space}/webhooks/{webhook}',
566
+ ...options
567
+ });
568
+ }
569
+
570
+ /**
571
+ * Update a webhook
572
+ *
573
+ * Updates the webhook's URL, events, or active status.
574
+ */
575
+ public update<ThrowOnError extends boolean = false>(options: Options<PutSpacesBySpaceWebhooksByWebhookData, ThrowOnError>) {
576
+ return (options.client ?? this.client).put<PutSpacesBySpaceWebhooksByWebhookResponses, PutSpacesBySpaceWebhooksByWebhookErrors, ThrowOnError>({
577
+ security: [{ scheme: 'bearer', type: 'http' }],
578
+ url: '/spaces/{space}/webhooks/{webhook}',
579
+ ...options,
580
+ headers: {
581
+ 'Content-Type': 'application/json',
582
+ ...options.headers
583
+ }
584
+ });
585
+ }
586
+ }
587
+
588
+ export class ZilfuClient extends HeyApiClient {
589
+ public static readonly __registry = new HeyApiRegistry<ZilfuClient>();
590
+
591
+ constructor(args?: {
592
+ client?: Client;
593
+ key?: string;
594
+ }) {
595
+ super(args);
596
+ ZilfuClient.__registry.set(this, args?.key);
597
+ }
598
+
599
+ private _accounts?: Accounts;
600
+ get accounts(): Accounts {
601
+ return this._accounts ??= new Accounts({ client: this.client });
602
+ }
603
+
604
+ private _tokens?: Tokens;
605
+ get tokens(): Tokens {
606
+ return this._tokens ??= new Tokens({ client: this.client });
607
+ }
608
+
609
+ private _bioBlocks?: BioBlocks;
610
+ get bioBlocks(): BioBlocks {
611
+ return this._bioBlocks ??= new BioBlocks({ client: this.client });
612
+ }
613
+
614
+ private _bio?: Bio;
615
+ get bio(): Bio {
616
+ return this._bio ??= new Bio({ client: this.client });
617
+ }
618
+
619
+ private _media?: Media;
620
+ get media(): Media {
621
+ return this._media ??= new Media({ client: this.client });
622
+ }
623
+
624
+ private _posts?: Posts;
625
+ get posts(): Posts {
626
+ return this._posts ??= new Posts({ client: this.client });
627
+ }
628
+
629
+ private _clusters?: Clusters;
630
+ get clusters(): Clusters {
631
+ return this._clusters ??= new Clusters({ client: this.client });
632
+ }
633
+
634
+ private _queue?: Queue;
635
+ get queue(): Queue {
636
+ return this._queue ??= new Queue({ client: this.client });
637
+ }
638
+
639
+ private _slots?: Slots;
640
+ get slots(): Slots {
641
+ return this._slots ??= new Slots({ client: this.client });
642
+ }
643
+
644
+ private _spaces?: Spaces;
645
+ get spaces(): Spaces {
646
+ return this._spaces ??= new Spaces({ client: this.client });
647
+ }
648
+
649
+ private _subscription?: Subscription;
650
+ get subscription(): Subscription {
651
+ return this._subscription ??= new Subscription({ client: this.client });
652
+ }
653
+
654
+ private _webhooks?: Webhooks;
655
+ get webhooks(): Webhooks {
656
+ return this._webhooks ??= new Webhooks({ client: this.client });
657
+ }
658
+ }