@mx-space/byline-api-client 0.2.1 → 0.3.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.
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
@@ -20,6 +20,7 @@ interface ArticleTranslationMeta {
20
20
  translatedAt?: string;
21
21
  model?: string;
22
22
  availableTranslations?: string[];
23
+ localizedTags?: string[];
23
24
  }
24
25
  interface EntryTranslationMeta {
25
26
  article?: ArticleTranslationMeta;
@@ -358,6 +359,21 @@ interface Translation {
358
359
  updatedAt: string | null;
359
360
  [key: string]: unknown;
360
361
  }
362
+ interface Summary {
363
+ id: string;
364
+ refId: string;
365
+ lang: string | null;
366
+ summary: string;
367
+ hash: string;
368
+ isTranslation: boolean;
369
+ isLocked: boolean;
370
+ sourceLang: string | null;
371
+ createdAt: string;
372
+ [key: string]: unknown;
373
+ }
374
+ interface ManualSummaryInput {
375
+ summary: string;
376
+ }
361
377
  interface ManualTranslationInput {
362
378
  title: string;
363
379
  content: string | LexicalEditorState;
@@ -475,6 +491,11 @@ declare class CategoriesResource {
475
491
  }): Promise<ApiResponse<Category, Record<string, unknown>>>;
476
492
  delete(id: string): Promise<ApiResponse<void, Record<string, unknown>>>;
477
493
  }
494
+ declare class SummariesResource {
495
+ private readonly http;
496
+ constructor(http: HttpCore);
497
+ writeManual(articleId: string, lang: string, input: ManualSummaryInput): Promise<ApiResponse<Summary, Record<string, unknown>>>;
498
+ }
478
499
  declare class TranslationsResource {
479
500
  private readonly http;
480
501
  constructor(http: HttpCore);
@@ -631,6 +652,7 @@ export declare class BylineClient {
631
652
  readonly tasks: TasksResource;
632
653
  readonly categories: CategoriesResource;
633
654
  readonly translations: TranslationsResource;
655
+ readonly summaries: SummariesResource;
634
656
  readonly users: UsersResource;
635
657
  readonly authors: AuthorsResource;
636
658
  readonly invites: InvitesResource;
@@ -648,4 +670,4 @@ export declare class BylineApiError extends Error {
648
670
  constructor(status: number, code: string, message: string, path: string, details?: unknown | undefined);
649
671
  }
650
672
  export declare const isBylineApiError: (error: unknown, code?: string) => error is BylineApiError;
651
- 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 };
673
+ 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
@@ -20,6 +20,7 @@ interface ArticleTranslationMeta {
20
20
  translatedAt?: string;
21
21
  model?: string;
22
22
  availableTranslations?: string[];
23
+ localizedTags?: string[];
23
24
  }
24
25
  interface EntryTranslationMeta {
25
26
  article?: ArticleTranslationMeta;
@@ -358,6 +359,21 @@ interface Translation {
358
359
  updatedAt: string | null;
359
360
  [key: string]: unknown;
360
361
  }
362
+ interface Summary {
363
+ id: string;
364
+ refId: string;
365
+ lang: string | null;
366
+ summary: string;
367
+ hash: string;
368
+ isTranslation: boolean;
369
+ isLocked: boolean;
370
+ sourceLang: string | null;
371
+ createdAt: string;
372
+ [key: string]: unknown;
373
+ }
374
+ interface ManualSummaryInput {
375
+ summary: string;
376
+ }
361
377
  interface ManualTranslationInput {
362
378
  title: string;
363
379
  content: string | LexicalEditorState;
@@ -475,6 +491,11 @@ declare class CategoriesResource {
475
491
  }): Promise<ApiResponse<Category, Record<string, unknown>>>;
476
492
  delete(id: string): Promise<ApiResponse<void, Record<string, unknown>>>;
477
493
  }
494
+ declare class SummariesResource {
495
+ private readonly http;
496
+ constructor(http: HttpCore);
497
+ writeManual(articleId: string, lang: string, input: ManualSummaryInput): Promise<ApiResponse<Summary, Record<string, unknown>>>;
498
+ }
478
499
  declare class TranslationsResource {
479
500
  private readonly http;
480
501
  constructor(http: HttpCore);
@@ -631,6 +652,7 @@ export declare class BylineClient {
631
652
  readonly tasks: TasksResource;
632
653
  readonly categories: CategoriesResource;
633
654
  readonly translations: TranslationsResource;
655
+ readonly summaries: SummariesResource;
634
656
  readonly users: UsersResource;
635
657
  readonly authors: AuthorsResource;
636
658
  readonly invites: InvitesResource;
@@ -648,4 +670,4 @@ export declare class BylineApiError extends Error {
648
670
  constructor(status: number, code: string, message: string, path: string, details?: unknown | undefined);
649
671
  }
650
672
  export declare const isBylineApiError: (error: unknown, code?: string) => error is BylineApiError;
651
- 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 };
673
+ 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.1",
3
+ "version": "0.3.1",
4
4
  "description": "Typed fetch client for the Byline headless CMS API",
5
5
  "keywords": [
6
6
  "byline",