@mx-space/byline-api-client 0.0.0-stage → 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.
@@ -0,0 +1,653 @@
1
+ //#region src/case.d.ts
2
+ declare const camelcaseKeys: <T>(value: unknown, preservePaths?: readonly string[]) => T;
3
+ //#endregion
4
+ //#region src/types.d.ts
5
+ interface ApiResponse<T, M = Record<string, unknown>> {
6
+ data: T;
7
+ meta?: M;
8
+ }
9
+ interface Pagination {
10
+ page: number;
11
+ size: number;
12
+ total: number;
13
+ totalPages: number;
14
+ }
15
+ interface PaginatedMeta {
16
+ pagination: Pagination;
17
+ [key: string]: unknown;
18
+ }
19
+ interface ArticleTranslationMeta {
20
+ isTranslated: boolean;
21
+ sourceLang?: string | null;
22
+ targetLang?: string | null;
23
+ translatedAt?: string;
24
+ model?: string;
25
+ availableTranslations?: string[];
26
+ }
27
+ interface EntryTranslationMeta {
28
+ article?: ArticleTranslationMeta;
29
+ }
30
+ interface PostResponseMeta {
31
+ view?: string;
32
+ pagination?: Pagination;
33
+ translation?: EntryTranslationMeta | Record<string, EntryTranslationMeta>;
34
+ glossary?: {
35
+ tags?: Array<{
36
+ source: string;
37
+ translated: string;
38
+ }>;
39
+ };
40
+ insights?: {
41
+ hasInLocale: boolean;
42
+ };
43
+ summary?: {
44
+ id: string;
45
+ text: string;
46
+ lang: string;
47
+ createdAt: string;
48
+ };
49
+ tts?: {
50
+ available: boolean;
51
+ lang?: string;
52
+ blockCount?: number;
53
+ stale?: boolean;
54
+ updatedAt?: string | null;
55
+ };
56
+ }
57
+ interface LexicalEditorState {
58
+ root: {
59
+ type: 'root';
60
+ children: unknown[];
61
+ [key: string]: unknown;
62
+ };
63
+ }
64
+ interface PublicAuthor {
65
+ id: string;
66
+ displayName: string;
67
+ avatar: string | null;
68
+ bio: string | null;
69
+ url: string | null;
70
+ }
71
+ interface Author extends PublicAuthor {
72
+ username: string | null;
73
+ }
74
+ interface AuthorListQuery {
75
+ page?: number;
76
+ size?: number;
77
+ }
78
+ interface UserDetail extends PublicAuthor {
79
+ email: string | null;
80
+ username: string | null;
81
+ permissions: number;
82
+ isProfileOnly: boolean;
83
+ deactivatedAt: string | null;
84
+ createdAt: string;
85
+ updatedAt: string | null;
86
+ lastLoginAt?: string | null;
87
+ }
88
+ interface UserProfileInput {
89
+ displayName?: string;
90
+ avatar?: string | null;
91
+ bio?: string | null;
92
+ url?: string | null;
93
+ email?: string | null;
94
+ username?: string;
95
+ }
96
+ interface ProfileOnlyUserInput extends UserProfileInput {
97
+ displayName: string;
98
+ }
99
+ type UserListStatus = 'all' | 'active' | 'deactivated' | 'profile_only';
100
+ interface UserListQuery {
101
+ page?: number;
102
+ size?: number;
103
+ search?: string;
104
+ status?: UserListStatus;
105
+ }
106
+ interface Invite {
107
+ id: string;
108
+ email: string;
109
+ displayName: string | null;
110
+ invitedBy: string | null;
111
+ userId: string | null;
112
+ expiresAt: string;
113
+ acceptedAt: string | null;
114
+ createdAt: string;
115
+ }
116
+ interface CreatedInvite extends Invite {
117
+ token: string;
118
+ acceptUrl: string;
119
+ emailQueued: boolean;
120
+ }
121
+ interface CreateInviteInput {
122
+ email: string;
123
+ displayName?: string;
124
+ }
125
+ interface InviteUserInput {
126
+ email?: string;
127
+ displayName?: string;
128
+ }
129
+ interface PublicInvite {
130
+ email: string;
131
+ displayName: string | null;
132
+ expiresAt: string;
133
+ }
134
+ interface AcceptInviteInput {
135
+ username: string;
136
+ password: string;
137
+ displayName?: string;
138
+ }
139
+ interface InitUserInput {
140
+ username: string;
141
+ password: string;
142
+ mail: string;
143
+ name?: string;
144
+ url?: string;
145
+ avatar?: string;
146
+ bio?: string;
147
+ }
148
+ interface AllowLoginResult {
149
+ password: boolean;
150
+ passkey: boolean;
151
+ [provider: string]: boolean;
152
+ }
153
+ interface CategorySummary {
154
+ id: string;
155
+ name: string;
156
+ slug: string;
157
+ type: number;
158
+ }
159
+ interface Category extends CategorySummary {
160
+ createdAt?: string;
161
+ count?: number;
162
+ [key: string]: unknown;
163
+ }
164
+ interface PostSeo {
165
+ title?: string | null;
166
+ description?: string | null;
167
+ image?: string | null;
168
+ }
169
+ interface PostImage {
170
+ src: string;
171
+ alt?: string;
172
+ [key: string]: unknown;
173
+ }
174
+ interface Post {
175
+ id: string;
176
+ title: string;
177
+ slug: string;
178
+ text: string;
179
+ content: string | null;
180
+ contentFormat: string;
181
+ summary: string | null;
182
+ images: PostImage[] | null;
183
+ meta: Record<string, unknown> | null;
184
+ tags: string[];
185
+ categoryId: string;
186
+ category?: CategorySummary;
187
+ isPublished: boolean;
188
+ pinAt: string | null;
189
+ pinOrder: number | null;
190
+ createdAt: string;
191
+ modifiedAt: string | null;
192
+ authors: PublicAuthor[];
193
+ sourceLang: string | null;
194
+ image: string | null;
195
+ seo: PostSeo | null;
196
+ [key: string]: unknown;
197
+ }
198
+ type PostSortKey = 'createdAt' | 'modifiedAt' | 'pinAt';
199
+ interface PostListQuery {
200
+ page?: number;
201
+ size?: number;
202
+ sortBy?: PostSortKey;
203
+ sortOrder?: 'asc' | 'desc';
204
+ categoryIds?: string[];
205
+ authorId?: string;
206
+ year?: number;
207
+ truncate?: number;
208
+ lang?: string;
209
+ }
210
+ interface PostPatch {
211
+ categoryId?: string;
212
+ pinAt?: string | null;
213
+ authors?: string[];
214
+ sourceLang?: string | null;
215
+ image?: string | null;
216
+ seo?: PostSeo | null;
217
+ }
218
+ interface PostWriteInput {
219
+ title: string;
220
+ content: string | LexicalEditorState;
221
+ text?: string;
222
+ slug?: string;
223
+ categoryId?: string;
224
+ summary?: string | null;
225
+ tags?: string[];
226
+ authors?: string[];
227
+ sourceLang?: string | null;
228
+ image?: string | null;
229
+ seo?: PostSeo | null;
230
+ images?: PostImage[] | null;
231
+ meta?: Record<string, unknown> | null;
232
+ pin?: boolean;
233
+ pinOrder?: number | null;
234
+ createdAt?: string;
235
+ }
236
+ type DraftRefType = 'post';
237
+ type RevisionRelation = 'same' | 'ancestor' | 'descendant' | 'diverged';
238
+ interface RevisionSnapshot {
239
+ content: string | null;
240
+ contentFormat: string;
241
+ images: unknown[] | null;
242
+ meta: Record<string, unknown> | null;
243
+ text: string;
244
+ title: string;
245
+ typeSpecificData: Record<string, unknown> | null;
246
+ }
247
+ interface ContentRevision extends RevisionSnapshot {
248
+ id: string;
249
+ documentId: string;
250
+ parentRevisionId: string | null;
251
+ createdAt: string;
252
+ }
253
+ interface ContentDocument {
254
+ id: string;
255
+ refId: string | null;
256
+ refType: DraftRefType;
257
+ publishedRevisionId: string | null;
258
+ publishAiResources: PublishAiResourceRequest[] | null;
259
+ createdAt: string;
260
+ updatedAt: string | null;
261
+ }
262
+ interface DraftBranch {
263
+ id: string;
264
+ documentId: string;
265
+ baseRevisionId: string;
266
+ headRevisionId: string;
267
+ status: 'active' | 'archived';
268
+ document: ContentDocument;
269
+ headRevision: ContentRevision;
270
+ baseRevision: ContentRevision;
271
+ publishedRevision: ContentRevision | null;
272
+ relationToPublished: RevisionRelation | null;
273
+ createdAt: string;
274
+ updatedAt: string | null;
275
+ }
276
+ interface VersionContext {
277
+ document: ContentDocument;
278
+ branches: DraftBranch[];
279
+ publishedRevision: ContentRevision | null;
280
+ [key: string]: unknown;
281
+ }
282
+ interface DraftWriteData {
283
+ title?: string;
284
+ text?: string;
285
+ content?: string;
286
+ contentFormat?: 'lexical';
287
+ images?: PostImage[] | null;
288
+ meta?: Record<string, unknown> | null;
289
+ typeSpecificData?: Record<string, unknown> | null;
290
+ }
291
+ interface CreateDraftInput {
292
+ refType: DraftRefType;
293
+ refId?: string;
294
+ baseRevisionId?: string | null;
295
+ data: DraftWriteData;
296
+ }
297
+ type PublishAiResource = 'insights' | 'summary' | 'translation' | 'tts';
298
+ interface PublishAiResourceRequest {
299
+ resource: PublishAiResource;
300
+ mode: 'sync' | 'async';
301
+ }
302
+ interface CreatePublishJobInput {
303
+ branchId: string;
304
+ revisionId: string;
305
+ expectedPublishedRevisionId?: string | null;
306
+ confirmDiverged?: boolean;
307
+ aiResources?: Array<PublishAiResource | PublishAiResourceRequest>;
308
+ regenerateLockedTranslations?: boolean;
309
+ }
310
+ interface TaskRef {
311
+ taskId: string;
312
+ created: boolean;
313
+ }
314
+ type TaskStatus = 'pending' | 'running' | 'completed' | 'partial_failed' | 'failed' | 'cancelled';
315
+ interface Task<TResult = unknown> {
316
+ id: string;
317
+ type: string;
318
+ status: TaskStatus;
319
+ progress?: number;
320
+ progressMessage?: string;
321
+ result?: TResult;
322
+ error?: string;
323
+ createdAt: number;
324
+ completedAt?: number;
325
+ [key: string]: unknown;
326
+ }
327
+ interface PublishTaskResult {
328
+ articleCommitted: boolean;
329
+ articleId: string;
330
+ newerDraftChanges: boolean;
331
+ publishedRevisionId: string;
332
+ resources: Partial<Record<PublishAiResource, string>>;
333
+ }
334
+ interface Translation {
335
+ id: string;
336
+ refId: string;
337
+ refType: string;
338
+ lang: string;
339
+ sourceLang: string;
340
+ title: string;
341
+ text: string;
342
+ subtitle: string | null;
343
+ summary: string | null;
344
+ tags: string[];
345
+ content: string | null;
346
+ contentFormat: string | null;
347
+ isLocked: boolean;
348
+ aiModel: string | null;
349
+ aiProvider: string | null;
350
+ seo: PostSeo | null;
351
+ createdAt: string;
352
+ updatedAt: string | null;
353
+ [key: string]: unknown;
354
+ }
355
+ interface ManualTranslationInput {
356
+ title: string;
357
+ content: string | LexicalEditorState;
358
+ text?: string;
359
+ subtitle?: string | null;
360
+ summary?: string | null;
361
+ tags?: string[];
362
+ sourceLang?: string;
363
+ seo?: PostSeo | null;
364
+ }
365
+ interface TranslationPatch {
366
+ title?: string;
367
+ text?: string;
368
+ subtitle?: string | null;
369
+ summary?: string;
370
+ tags?: string[];
371
+ content?: string | null;
372
+ isLocked?: boolean;
373
+ seo?: PostSeo | null;
374
+ }
375
+ interface TranslationTaskInput {
376
+ refId: string;
377
+ targetLanguages?: string[];
378
+ force?: boolean;
379
+ regenerateLocked?: boolean;
380
+ }
381
+ interface TranslationTaskResult {
382
+ translations: unknown[];
383
+ skippedLocked: string[];
384
+ }
385
+ interface DynamicComponent {
386
+ name: string;
387
+ description: string;
388
+ url: string;
389
+ initialHeight: number;
390
+ propsSchema: Record<string, unknown>;
391
+ parentUrl?: string;
392
+ }
393
+ interface DynamicComponentCatalog {
394
+ version: 1;
395
+ components: DynamicComponent[];
396
+ }
397
+ interface RegisterDynamicComponentInput {
398
+ name: string;
399
+ url: string;
400
+ description?: string;
401
+ initialHeight: number;
402
+ propsSchema?: Record<string, unknown>;
403
+ parentUrl?: string;
404
+ }
405
+ type FileType = 'image' | 'file' | 'avatar' | 'icon' | 'video' | 'audio';
406
+ interface UploadedFile {
407
+ url: string;
408
+ name: string;
409
+ storageBackend?: string;
410
+ storageKey?: string;
411
+ }
412
+ //#endregion
413
+ //#region src/http.d.ts
414
+ type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
415
+ type QueryValue = string | number | boolean | null | undefined | ReadonlyArray<string | number>;
416
+ interface ClientOptions {
417
+ endpoint: string;
418
+ apiKey?: string;
419
+ token?: string;
420
+ lang?: string;
421
+ headers?: Record<string, string>;
422
+ fetch?: typeof globalThis.fetch;
423
+ camelCase?: boolean;
424
+ }
425
+ interface RequestOptions {
426
+ query?: Record<string, QueryValue>;
427
+ body?: unknown;
428
+ headers?: Record<string, string>;
429
+ preserve?: readonly string[];
430
+ signal?: AbortSignal;
431
+ }
432
+ declare class HttpCore {
433
+ private readonly options;
434
+ readonly endpoint: string;
435
+ private readonly fetchImpl;
436
+ constructor(options: ClientOptions);
437
+ get lang(): string | undefined;
438
+ buildUrl(path: string, query?: Record<string, QueryValue>): string;
439
+ request<T, M = Record<string, unknown>>(method: HttpMethod, path: string, options?: RequestOptions): Promise<ApiResponse<T, M>>;
440
+ private transform;
441
+ private toError;
442
+ }
443
+ //#endregion
444
+ //#region src/resources/authors.d.ts
445
+ declare class AuthorsResource {
446
+ private readonly http;
447
+ constructor(http: HttpCore);
448
+ list(query?: AuthorListQuery): Promise<ApiResponse<Author[], PaginatedMeta>>;
449
+ listAll(): Promise<Author[]>;
450
+ get(idOrUsername: string): Promise<ApiResponse<Author, Record<string, unknown>>>;
451
+ }
452
+ //#endregion
453
+ //#region src/resources/content.d.ts
454
+ declare class CategoriesResource {
455
+ private readonly http;
456
+ constructor(http: HttpCore);
457
+ list(options?: {
458
+ lang?: string;
459
+ }): Promise<ApiResponse<Category[], Record<string, unknown>>>;
460
+ get(slugOrId: string, options?: {
461
+ lang?: string;
462
+ }): Promise<ApiResponse<Category, Record<string, unknown>>>;
463
+ create(input: {
464
+ name: string;
465
+ slug?: string;
466
+ }): Promise<ApiResponse<Category, Record<string, unknown>>>;
467
+ update(id: string, input: {
468
+ name?: string;
469
+ slug?: string;
470
+ }): Promise<ApiResponse<Category, Record<string, unknown>>>;
471
+ delete(id: string): Promise<ApiResponse<void, Record<string, unknown>>>;
472
+ }
473
+ declare class TranslationsResource {
474
+ private readonly http;
475
+ constructor(http: HttpCore);
476
+ getForArticle(articleId: string, lang: string): Promise<ApiResponse<Translation, Record<string, unknown>>>;
477
+ languages(articleId: string): Promise<ApiResponse<string[], Record<string, unknown>>>;
478
+ listByRef(articleId: string): Promise<ApiResponse<{
479
+ translations: Translation[];
480
+ article: {
481
+ type: string;
482
+ document: Record<string, unknown>;
483
+ };
484
+ }, Record<string, unknown>>>;
485
+ writeManual(articleId: string, lang: string, input: ManualTranslationInput): Promise<ApiResponse<Translation, Record<string, unknown>>>;
486
+ update(id: string, patch: TranslationPatch): Promise<ApiResponse<Translation, Record<string, unknown>>>;
487
+ delete(id: string): Promise<ApiResponse<void, Record<string, unknown>>>;
488
+ createTask(input: TranslationTaskInput): Promise<ApiResponse<TaskRef, Record<string, unknown>>>;
489
+ }
490
+ declare class DynamicComponentsResource {
491
+ private readonly http;
492
+ constructor(http: HttpCore);
493
+ list(): Promise<ApiResponse<DynamicComponentCatalog, Record<string, unknown>>>;
494
+ register(input: RegisterDynamicComponentInput): Promise<ApiResponse<DynamicComponentCatalog, Record<string, unknown>>>;
495
+ }
496
+ declare class FilesResource {
497
+ private readonly http;
498
+ constructor(http: HttpCore);
499
+ upload(file: Blob, options?: {
500
+ type?: FileType;
501
+ filename?: string;
502
+ immutable?: boolean;
503
+ }): Promise<ApiResponse<UploadedFile, Record<string, unknown>>>;
504
+ }
505
+ //#endregion
506
+ //#region src/resources/drafts.d.ts
507
+ declare class DraftsResource {
508
+ private readonly http;
509
+ constructor(http: HttpCore);
510
+ list(query?: {
511
+ page?: number;
512
+ size?: number;
513
+ refType?: DraftRefType;
514
+ hasRef?: boolean;
515
+ search?: string;
516
+ }): Promise<ApiResponse<DraftBranch[], PaginatedMeta>>;
517
+ get(id: string): Promise<ApiResponse<DraftBranch, Record<string, unknown>>>;
518
+ context(refType: DraftRefType, refId: string): Promise<ApiResponse<VersionContext, Record<string, unknown>>>;
519
+ create(input: CreateDraftInput): Promise<ApiResponse<DraftBranch, Record<string, unknown>>>;
520
+ update(id: string, input: {
521
+ data: DraftWriteData;
522
+ expectedHeadRevisionId: string;
523
+ }): Promise<ApiResponse<DraftBranch, Record<string, unknown>>>;
524
+ delete(id: string): Promise<ApiResponse<void, Record<string, unknown>>>;
525
+ }
526
+ //#endregion
527
+ //#region src/resources/tasks.d.ts
528
+ interface WaitForTaskOptions {
529
+ intervalMs?: number;
530
+ timeoutMs?: number;
531
+ signal?: AbortSignal;
532
+ }
533
+ declare class TasksResource {
534
+ private readonly http;
535
+ constructor(http: HttpCore);
536
+ get<TResult = unknown>(id: string): Promise<ApiResponse<Task<TResult>, Record<string, unknown>>>;
537
+ cancel(id: string): Promise<ApiResponse<void, Record<string, unknown>>>;
538
+ wait<TResult = unknown>(id: string, options?: WaitForTaskOptions): Promise<Task<TResult>>;
539
+ }
540
+ declare class PublishJobsResource {
541
+ private readonly http;
542
+ private readonly tasks;
543
+ constructor(http: HttpCore, tasks: TasksResource);
544
+ create(input: CreatePublishJobInput): Promise<ApiResponse<TaskRef, Record<string, unknown>>>;
545
+ run(input: CreatePublishJobInput, options?: WaitForTaskOptions): Promise<Task<PublishTaskResult> & {
546
+ result: PublishTaskResult;
547
+ }>;
548
+ }
549
+ //#endregion
550
+ //#region src/resources/posts.d.ts
551
+ interface PostSaveOptions extends WaitForTaskOptions {
552
+ publish?: boolean;
553
+ aiResources?: Array<PublishAiResource | PublishAiResourceRequest>;
554
+ regenerateLockedTranslations?: boolean;
555
+ }
556
+ interface PostSaveResult {
557
+ draft: DraftBranch;
558
+ postId: string | null;
559
+ taskId: string | null;
560
+ }
561
+ declare const toDraftData: (input: Partial<PostWriteInput>) => DraftWriteData;
562
+ declare class PostsResource {
563
+ private readonly http;
564
+ private readonly drafts;
565
+ private readonly publishJobs;
566
+ constructor(http: HttpCore, drafts: DraftsResource, publishJobs: PublishJobsResource);
567
+ list(query?: PostListQuery): Promise<ApiResponse<Post[], PostResponseMeta>>;
568
+ get(id: string, options?: {
569
+ lang?: string;
570
+ }): Promise<ApiResponse<Post, PostResponseMeta>>;
571
+ getBySlug(categorySlug: string, slug: string, options?: {
572
+ lang?: string;
573
+ }): Promise<ApiResponse<Post, PostResponseMeta>>;
574
+ getPath(slug: string): Promise<ApiResponse<{
575
+ path: string;
576
+ }, Record<string, unknown>>>;
577
+ findBySlug(slug: string, options?: {
578
+ lang?: string;
579
+ }): Promise<ApiResponse<Post, PostResponseMeta> | null>;
580
+ latest(options?: {
581
+ lang?: string;
582
+ }): Promise<ApiResponse<Post, PostResponseMeta>>;
583
+ update(id: string, patch: PostPatch): Promise<ApiResponse<void, Record<string, unknown>>>;
584
+ setPublished(id: string, isPublished: boolean): Promise<ApiResponse<{
585
+ success: boolean;
586
+ }, Record<string, unknown>>>;
587
+ delete(id: string): Promise<ApiResponse<void, Record<string, unknown>>>;
588
+ create(input: PostWriteInput, options?: PostSaveOptions): Promise<PostSaveResult>;
589
+ revise(id: string, input: Partial<PostWriteInput>, options?: PostSaveOptions): Promise<PostSaveResult>;
590
+ private finish;
591
+ }
592
+ //#endregion
593
+ //#region src/resources/users.d.ts
594
+ declare class UsersResource {
595
+ private readonly http;
596
+ constructor(http: HttpCore);
597
+ allowLogin(): Promise<ApiResponse<AllowLoginResult, Record<string, unknown>>>;
598
+ checkLogged(): Promise<ApiResponse<{
599
+ ok: 0 | 1;
600
+ isGuest: boolean;
601
+ }, Record<string, unknown>>>;
602
+ me(): Promise<ApiResponse<UserDetail, Record<string, unknown>>>;
603
+ updateMe(input: UserProfileInput): Promise<ApiResponse<UserDetail, Record<string, unknown>>>;
604
+ list(query?: UserListQuery): Promise<ApiResponse<UserDetail[], PaginatedMeta>>;
605
+ listAll(query?: Omit<UserListQuery, 'page' | 'size'>): Promise<UserDetail[]>;
606
+ get(id: string): Promise<ApiResponse<UserDetail, Record<string, unknown>>>;
607
+ update(id: string, input: UserProfileInput): Promise<ApiResponse<UserDetail, Record<string, unknown>>>;
608
+ createProfileOnly(input: ProfileOnlyUserInput): Promise<ApiResponse<UserDetail, Record<string, unknown>>>;
609
+ deactivate(id: string): Promise<ApiResponse<UserDetail, Record<string, unknown>>>;
610
+ reactivate(id: string): Promise<ApiResponse<UserDetail, Record<string, unknown>>>;
611
+ invite(id: string, input?: InviteUserInput): Promise<ApiResponse<CreatedInvite, Record<string, unknown>>>;
612
+ initFirstUser(input: InitUserInput): Promise<ApiResponse<unknown, Record<string, unknown>>>;
613
+ }
614
+ declare class InvitesResource {
615
+ private readonly http;
616
+ constructor(http: HttpCore);
617
+ list(): Promise<ApiResponse<Invite[], Record<string, unknown>>>;
618
+ create(input: CreateInviteInput): Promise<ApiResponse<CreatedInvite, Record<string, unknown>>>;
619
+ revoke(id: string): Promise<ApiResponse<void, Record<string, unknown>>>;
620
+ get(token: string): Promise<ApiResponse<PublicInvite, Record<string, unknown>>>;
621
+ accept(token: string, input: AcceptInviteInput): Promise<ApiResponse<UserDetail, Record<string, unknown>>>;
622
+ }
623
+ //#endregion
624
+ //#region src/client.d.ts
625
+ declare class BylineClient {
626
+ readonly http: HttpCore;
627
+ readonly posts: PostsResource;
628
+ readonly drafts: DraftsResource;
629
+ readonly publishJobs: PublishJobsResource;
630
+ readonly tasks: TasksResource;
631
+ readonly categories: CategoriesResource;
632
+ readonly translations: TranslationsResource;
633
+ readonly users: UsersResource;
634
+ readonly authors: AuthorsResource;
635
+ readonly invites: InvitesResource;
636
+ readonly dynamicComponents: DynamicComponentsResource;
637
+ readonly files: FilesResource;
638
+ constructor(options: ClientOptions);
639
+ }
640
+ declare const createClient: (options: ClientOptions) => BylineClient;
641
+ //#endregion
642
+ //#region src/error.d.ts
643
+ declare class BylineApiError extends Error {
644
+ readonly status: number;
645
+ readonly code: string;
646
+ readonly path: string;
647
+ readonly details?: unknown | undefined;
648
+ readonly name = "BylineApiError";
649
+ constructor(status: number, code: string, message: string, path: string, details?: unknown | undefined);
650
+ }
651
+ declare const isBylineApiError: (error: unknown, code?: string) => error is BylineApiError;
652
+ //#endregion
653
+ export { type AcceptInviteInput, type AllowLoginResult, type ApiResponse, type ArticleTranslationMeta, type Author, type AuthorListQuery, type AuthorsResource, BylineApiError, BylineClient, type CategoriesResource, type Category, type CategorySummary, type ClientOptions, type ContentDocument, type ContentRevision, type CreateDraftInput, type CreateInviteInput, type CreatePublishJobInput, type CreatedInvite, type DraftBranch, type DraftRefType, type DraftWriteData, type DraftsResource, type DynamicComponent, type DynamicComponentCatalog, type DynamicComponentsResource, type EntryTranslationMeta, type FileType, type FilesResource, HttpCore, type HttpMethod, type InitUserInput, type Invite, type InviteUserInput, type InvitesResource, type LexicalEditorState, type ManualTranslationInput, type PaginatedMeta, type Pagination, type Post, type PostImage, type PostListQuery, type PostPatch, type PostResponseMeta, type PostSaveOptions, type PostSaveResult, type PostSeo, type PostSortKey, type PostWriteInput, type PostsResource, type ProfileOnlyUserInput, type PublicAuthor, type PublicInvite, type PublishAiResource, type PublishAiResourceRequest, type PublishJobsResource, type PublishTaskResult, type QueryValue, type RegisterDynamicComponentInput, type RequestOptions, type RevisionRelation, type RevisionSnapshot, type Task, type TaskRef, type TaskStatus, type TasksResource, type Translation, type TranslationPatch, type TranslationTaskInput, type TranslationTaskResult, type TranslationsResource, type UploadedFile, type UserDetail, type UserListQuery, type UserListStatus, type UserProfileInput, type UsersResource, type VersionContext, type WaitForTaskOptions, camelcaseKeys, createClient, isBylineApiError, toDraftData };