@zilfu/sdk 0.1.0 → 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,658 +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 { 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
-
7
- export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
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
- 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.`);
40
- }
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
- }