@mx-space/byline-api-client 0.2.0 → 0.3.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.
package/dist/index.cjs CHANGED
@@ -171,6 +171,15 @@ var CategoriesResource = class {
171
171
  return this.http.request("DELETE", `/categories/${id}`);
172
172
  }
173
173
  };
174
+ var SummariesResource = class {
175
+ http;
176
+ constructor(http) {
177
+ this.http = http;
178
+ }
179
+ writeManual(articleId, lang, input) {
180
+ return this.http.request("PUT", `/ai/summaries/article/${articleId}/lang/${encodeURIComponent(lang)}`, { body: input });
181
+ }
182
+ };
174
183
  var TranslationsResource = class {
175
184
  http;
176
185
  constructor(http) {
@@ -548,6 +557,7 @@ var BylineClient = class {
548
557
  tasks;
549
558
  categories;
550
559
  translations;
560
+ summaries;
551
561
  users;
552
562
  authors;
553
563
  invites;
@@ -561,6 +571,7 @@ var BylineClient = class {
561
571
  this.posts = new PostsResource(this.http, this.drafts, this.publishJobs);
562
572
  this.categories = new CategoriesResource(this.http);
563
573
  this.translations = new TranslationsResource(this.http);
574
+ this.summaries = new SummariesResource(this.http);
564
575
  this.users = new UsersResource(this.http);
565
576
  this.authors = new AuthorsResource(this.http);
566
577
  this.invites = new InvitesResource(this.http);
package/dist/index.d.cts CHANGED
@@ -173,6 +173,7 @@ interface Post {
173
173
  id: string;
174
174
  title: string;
175
175
  slug: string;
176
+ url?: string;
176
177
  text: string;
177
178
  content: string | null;
178
179
  contentFormat: 'lexical';
@@ -357,6 +358,21 @@ interface Translation {
357
358
  updatedAt: string | null;
358
359
  [key: string]: unknown;
359
360
  }
361
+ interface Summary {
362
+ id: string;
363
+ refId: string;
364
+ lang: string | null;
365
+ summary: string;
366
+ hash: string;
367
+ isTranslation: boolean;
368
+ isLocked: boolean;
369
+ sourceLang: string | null;
370
+ createdAt: string;
371
+ [key: string]: unknown;
372
+ }
373
+ interface ManualSummaryInput {
374
+ summary: string;
375
+ }
360
376
  interface ManualTranslationInput {
361
377
  title: string;
362
378
  content: string | LexicalEditorState;
@@ -474,6 +490,11 @@ declare class CategoriesResource {
474
490
  }): Promise<ApiResponse<Category, Record<string, unknown>>>;
475
491
  delete(id: string): Promise<ApiResponse<void, Record<string, unknown>>>;
476
492
  }
493
+ declare class SummariesResource {
494
+ private readonly http;
495
+ constructor(http: HttpCore);
496
+ writeManual(articleId: string, lang: string, input: ManualSummaryInput): Promise<ApiResponse<Summary, Record<string, unknown>>>;
497
+ }
477
498
  declare class TranslationsResource {
478
499
  private readonly http;
479
500
  constructor(http: HttpCore);
@@ -576,6 +597,7 @@ declare class PostsResource {
576
597
  }): Promise<ApiResponse<Post, PostResponseMeta>>;
577
598
  getPath(slug: string): Promise<ApiResponse<{
578
599
  path: string;
600
+ url?: string;
579
601
  }, Record<string, unknown>>>;
580
602
  findBySlug(slug: string, options?: {
581
603
  lang?: string;
@@ -629,6 +651,7 @@ export declare class BylineClient {
629
651
  readonly tasks: TasksResource;
630
652
  readonly categories: CategoriesResource;
631
653
  readonly translations: TranslationsResource;
654
+ readonly summaries: SummariesResource;
632
655
  readonly users: UsersResource;
633
656
  readonly authors: AuthorsResource;
634
657
  readonly invites: InvitesResource;
@@ -646,4 +669,4 @@ export declare class BylineApiError extends Error {
646
669
  constructor(status: number, code: string, message: string, path: string, details?: unknown | undefined);
647
670
  }
648
671
  export declare const isBylineApiError: (error: unknown, code?: string) => error is BylineApiError;
649
- export type { AcceptInviteInput, AllowLoginResult, ApiResponse, ArticleTranslationMeta, Author, AuthorListQuery, AuthorsResource, CategoriesResource, Category, CategorySummary, ClientOptions, ContentDocument, ContentRevision, CreateDraftInput, CreateInviteInput, CreatePublishJobInput, CreatedInvite, DraftBranch, DraftRefType, DraftRelation, DraftWriteData, DraftsResource, DynamicComponent, DynamicComponentCatalog, DynamicComponentsResource, EntryTranslationMeta, FileType, FilesResource, HttpMethod, InitUserInput, Invite, InviteUserInput, InvitesResource, LexicalEditorState, ManualTranslationInput, PaginatedMeta, Pagination, Post, PostImage, PostListQuery, PostPatch, PostResponseMeta, PostSaveOptions, PostSaveResult, PostSeo, PostSortKey, PostWriteInput, PostsResource, ProfileOnlyUserInput, PublicAuthor, PublicInvite, PublishAiResource, PublishAiResourceRequest, PublishJobsResource, PublishTaskResult, QueryValue, RegisterDynamicComponentInput, RequestOptions, RevisionSnapshot, Task, TaskRef, TaskStatus, TasksResource, Translation, TranslationPatch, TranslationTaskInput, TranslationTaskResult, TranslationsResource, UpdateDynamicComponentInput, UploadedFile, UserDetail, UserListQuery, UserListStatus, UserProfileInput, UsersResource, VersionContext, WaitForTaskOptions };
672
+ export type { AcceptInviteInput, AllowLoginResult, ApiResponse, ArticleTranslationMeta, Author, AuthorListQuery, AuthorsResource, CategoriesResource, Category, CategorySummary, ClientOptions, ContentDocument, ContentRevision, CreateDraftInput, CreateInviteInput, CreatePublishJobInput, CreatedInvite, DraftBranch, DraftRefType, DraftRelation, DraftWriteData, DraftsResource, DynamicComponent, DynamicComponentCatalog, DynamicComponentsResource, EntryTranslationMeta, FileType, FilesResource, HttpMethod, InitUserInput, Invite, InviteUserInput, InvitesResource, LexicalEditorState, ManualSummaryInput, ManualTranslationInput, PaginatedMeta, Pagination, Post, PostImage, PostListQuery, PostPatch, PostResponseMeta, PostSaveOptions, PostSaveResult, PostSeo, PostSortKey, PostWriteInput, PostsResource, ProfileOnlyUserInput, PublicAuthor, PublicInvite, PublishAiResource, PublishAiResourceRequest, PublishJobsResource, PublishTaskResult, QueryValue, RegisterDynamicComponentInput, RequestOptions, RevisionSnapshot, SummariesResource, Summary, Task, TaskRef, TaskStatus, TasksResource, Translation, TranslationPatch, TranslationTaskInput, TranslationTaskResult, TranslationsResource, UpdateDynamicComponentInput, UploadedFile, UserDetail, UserListQuery, UserListStatus, UserProfileInput, UsersResource, VersionContext, WaitForTaskOptions };
package/dist/index.d.ts CHANGED
@@ -173,6 +173,7 @@ interface Post {
173
173
  id: string;
174
174
  title: string;
175
175
  slug: string;
176
+ url?: string;
176
177
  text: string;
177
178
  content: string | null;
178
179
  contentFormat: 'lexical';
@@ -357,6 +358,21 @@ interface Translation {
357
358
  updatedAt: string | null;
358
359
  [key: string]: unknown;
359
360
  }
361
+ interface Summary {
362
+ id: string;
363
+ refId: string;
364
+ lang: string | null;
365
+ summary: string;
366
+ hash: string;
367
+ isTranslation: boolean;
368
+ isLocked: boolean;
369
+ sourceLang: string | null;
370
+ createdAt: string;
371
+ [key: string]: unknown;
372
+ }
373
+ interface ManualSummaryInput {
374
+ summary: string;
375
+ }
360
376
  interface ManualTranslationInput {
361
377
  title: string;
362
378
  content: string | LexicalEditorState;
@@ -474,6 +490,11 @@ declare class CategoriesResource {
474
490
  }): Promise<ApiResponse<Category, Record<string, unknown>>>;
475
491
  delete(id: string): Promise<ApiResponse<void, Record<string, unknown>>>;
476
492
  }
493
+ declare class SummariesResource {
494
+ private readonly http;
495
+ constructor(http: HttpCore);
496
+ writeManual(articleId: string, lang: string, input: ManualSummaryInput): Promise<ApiResponse<Summary, Record<string, unknown>>>;
497
+ }
477
498
  declare class TranslationsResource {
478
499
  private readonly http;
479
500
  constructor(http: HttpCore);
@@ -576,6 +597,7 @@ declare class PostsResource {
576
597
  }): Promise<ApiResponse<Post, PostResponseMeta>>;
577
598
  getPath(slug: string): Promise<ApiResponse<{
578
599
  path: string;
600
+ url?: string;
579
601
  }, Record<string, unknown>>>;
580
602
  findBySlug(slug: string, options?: {
581
603
  lang?: string;
@@ -629,6 +651,7 @@ export declare class BylineClient {
629
651
  readonly tasks: TasksResource;
630
652
  readonly categories: CategoriesResource;
631
653
  readonly translations: TranslationsResource;
654
+ readonly summaries: SummariesResource;
632
655
  readonly users: UsersResource;
633
656
  readonly authors: AuthorsResource;
634
657
  readonly invites: InvitesResource;
@@ -646,4 +669,4 @@ export declare class BylineApiError extends Error {
646
669
  constructor(status: number, code: string, message: string, path: string, details?: unknown | undefined);
647
670
  }
648
671
  export declare const isBylineApiError: (error: unknown, code?: string) => error is BylineApiError;
649
- export type { AcceptInviteInput, AllowLoginResult, ApiResponse, ArticleTranslationMeta, Author, AuthorListQuery, AuthorsResource, CategoriesResource, Category, CategorySummary, ClientOptions, ContentDocument, ContentRevision, CreateDraftInput, CreateInviteInput, CreatePublishJobInput, CreatedInvite, DraftBranch, DraftRefType, DraftRelation, DraftWriteData, DraftsResource, DynamicComponent, DynamicComponentCatalog, DynamicComponentsResource, EntryTranslationMeta, FileType, FilesResource, HttpMethod, InitUserInput, Invite, InviteUserInput, InvitesResource, LexicalEditorState, ManualTranslationInput, PaginatedMeta, Pagination, Post, PostImage, PostListQuery, PostPatch, PostResponseMeta, PostSaveOptions, PostSaveResult, PostSeo, PostSortKey, PostWriteInput, PostsResource, ProfileOnlyUserInput, PublicAuthor, PublicInvite, PublishAiResource, PublishAiResourceRequest, PublishJobsResource, PublishTaskResult, QueryValue, RegisterDynamicComponentInput, RequestOptions, RevisionSnapshot, Task, TaskRef, TaskStatus, TasksResource, Translation, TranslationPatch, TranslationTaskInput, TranslationTaskResult, TranslationsResource, UpdateDynamicComponentInput, UploadedFile, UserDetail, UserListQuery, UserListStatus, UserProfileInput, UsersResource, VersionContext, WaitForTaskOptions };
672
+ export type { AcceptInviteInput, AllowLoginResult, ApiResponse, ArticleTranslationMeta, Author, AuthorListQuery, AuthorsResource, CategoriesResource, Category, CategorySummary, ClientOptions, ContentDocument, ContentRevision, CreateDraftInput, CreateInviteInput, CreatePublishJobInput, CreatedInvite, DraftBranch, DraftRefType, DraftRelation, DraftWriteData, DraftsResource, DynamicComponent, DynamicComponentCatalog, DynamicComponentsResource, EntryTranslationMeta, FileType, FilesResource, HttpMethod, InitUserInput, Invite, InviteUserInput, InvitesResource, LexicalEditorState, ManualSummaryInput, ManualTranslationInput, PaginatedMeta, Pagination, Post, PostImage, PostListQuery, PostPatch, PostResponseMeta, PostSaveOptions, PostSaveResult, PostSeo, PostSortKey, PostWriteInput, PostsResource, ProfileOnlyUserInput, PublicAuthor, PublicInvite, PublishAiResource, PublishAiResourceRequest, PublishJobsResource, PublishTaskResult, QueryValue, RegisterDynamicComponentInput, RequestOptions, RevisionSnapshot, SummariesResource, Summary, Task, TaskRef, TaskStatus, TasksResource, Translation, TranslationPatch, TranslationTaskInput, TranslationTaskResult, TranslationsResource, UpdateDynamicComponentInput, UploadedFile, UserDetail, UserListQuery, UserListStatus, UserProfileInput, UsersResource, VersionContext, WaitForTaskOptions };
package/dist/index.js CHANGED
@@ -170,6 +170,15 @@ var CategoriesResource = class {
170
170
  return this.http.request("DELETE", `/categories/${id}`);
171
171
  }
172
172
  };
173
+ var SummariesResource = class {
174
+ http;
175
+ constructor(http) {
176
+ this.http = http;
177
+ }
178
+ writeManual(articleId, lang, input) {
179
+ return this.http.request("PUT", `/ai/summaries/article/${articleId}/lang/${encodeURIComponent(lang)}`, { body: input });
180
+ }
181
+ };
173
182
  var TranslationsResource = class {
174
183
  http;
175
184
  constructor(http) {
@@ -547,6 +556,7 @@ var BylineClient = class {
547
556
  tasks;
548
557
  categories;
549
558
  translations;
559
+ summaries;
550
560
  users;
551
561
  authors;
552
562
  invites;
@@ -560,6 +570,7 @@ var BylineClient = class {
560
570
  this.posts = new PostsResource(this.http, this.drafts, this.publishJobs);
561
571
  this.categories = new CategoriesResource(this.http);
562
572
  this.translations = new TranslationsResource(this.http);
573
+ this.summaries = new SummariesResource(this.http);
563
574
  this.users = new UsersResource(this.http);
564
575
  this.authors = new AuthorsResource(this.http);
565
576
  this.invites = new InvitesResource(this.http);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-space/byline-api-client",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Typed fetch client for the Byline headless CMS API",
5
5
  "keywords": [
6
6
  "byline",