@mx-space/byline-api-client 0.2.1 → 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 +11 -0
- package/dist/index.d.cts +22 -1
- package/dist/index.d.ts +22 -1
- package/dist/index.js +11 -0
- package/package.json +1 -1
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
|
@@ -358,6 +358,21 @@ interface Translation {
|
|
|
358
358
|
updatedAt: string | null;
|
|
359
359
|
[key: string]: unknown;
|
|
360
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
|
+
}
|
|
361
376
|
interface ManualTranslationInput {
|
|
362
377
|
title: string;
|
|
363
378
|
content: string | LexicalEditorState;
|
|
@@ -475,6 +490,11 @@ declare class CategoriesResource {
|
|
|
475
490
|
}): Promise<ApiResponse<Category, Record<string, unknown>>>;
|
|
476
491
|
delete(id: string): Promise<ApiResponse<void, Record<string, unknown>>>;
|
|
477
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
|
+
}
|
|
478
498
|
declare class TranslationsResource {
|
|
479
499
|
private readonly http;
|
|
480
500
|
constructor(http: HttpCore);
|
|
@@ -631,6 +651,7 @@ export declare class BylineClient {
|
|
|
631
651
|
readonly tasks: TasksResource;
|
|
632
652
|
readonly categories: CategoriesResource;
|
|
633
653
|
readonly translations: TranslationsResource;
|
|
654
|
+
readonly summaries: SummariesResource;
|
|
634
655
|
readonly users: UsersResource;
|
|
635
656
|
readonly authors: AuthorsResource;
|
|
636
657
|
readonly invites: InvitesResource;
|
|
@@ -648,4 +669,4 @@ export declare class BylineApiError extends Error {
|
|
|
648
669
|
constructor(status: number, code: string, message: string, path: string, details?: unknown | undefined);
|
|
649
670
|
}
|
|
650
671
|
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 };
|
|
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
|
@@ -358,6 +358,21 @@ interface Translation {
|
|
|
358
358
|
updatedAt: string | null;
|
|
359
359
|
[key: string]: unknown;
|
|
360
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
|
+
}
|
|
361
376
|
interface ManualTranslationInput {
|
|
362
377
|
title: string;
|
|
363
378
|
content: string | LexicalEditorState;
|
|
@@ -475,6 +490,11 @@ declare class CategoriesResource {
|
|
|
475
490
|
}): Promise<ApiResponse<Category, Record<string, unknown>>>;
|
|
476
491
|
delete(id: string): Promise<ApiResponse<void, Record<string, unknown>>>;
|
|
477
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
|
+
}
|
|
478
498
|
declare class TranslationsResource {
|
|
479
499
|
private readonly http;
|
|
480
500
|
constructor(http: HttpCore);
|
|
@@ -631,6 +651,7 @@ export declare class BylineClient {
|
|
|
631
651
|
readonly tasks: TasksResource;
|
|
632
652
|
readonly categories: CategoriesResource;
|
|
633
653
|
readonly translations: TranslationsResource;
|
|
654
|
+
readonly summaries: SummariesResource;
|
|
634
655
|
readonly users: UsersResource;
|
|
635
656
|
readonly authors: AuthorsResource;
|
|
636
657
|
readonly invites: InvitesResource;
|
|
@@ -648,4 +669,4 @@ export declare class BylineApiError extends Error {
|
|
|
648
669
|
constructor(status: number, code: string, message: string, path: string, details?: unknown | undefined);
|
|
649
670
|
}
|
|
650
671
|
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 };
|
|
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);
|