@prezly/sdk 26.5.0 → 26.5.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/api/ApiClient.d.ts +4 -4
- package/dist/api/DeferredJobsApiClient.d.ts +4 -4
- package/dist/api/constants.cjs +2 -2
- package/dist/api/constants.js +2 -2
- package/dist/endpoints/Accounts/Client.d.ts +1 -1
- package/dist/endpoints/CampaignRecipients/Client.d.ts +1 -1
- package/dist/endpoints/Campaigns/Client.d.ts +8 -8
- package/dist/endpoints/ContactTags/Client.d.ts +4 -4
- package/dist/endpoints/Contacts/Client.d.ts +6 -6
- package/dist/endpoints/ContactsExports/Client.d.ts +2 -2
- package/dist/endpoints/CoverageIntegrations/Client.d.ts +3 -3
- package/dist/endpoints/NewsroomCategories/Client.d.ts +3 -3
- package/dist/endpoints/NewsroomGalleries/Client.d.ts +1 -1
- package/dist/endpoints/NewsroomLanguages/Client.d.ts +10 -10
- package/dist/endpoints/NewsroomLanguages/lib.cjs +1 -1
- package/dist/endpoints/NewsroomLanguages/lib.js +1 -1
- package/dist/endpoints/NewsroomPrivacyRequests/Client.d.ts +2 -2
- package/dist/endpoints/NewsroomThemes/Client.d.ts +2 -2
- package/dist/endpoints/NewsroomWebhooks/Client.d.ts +3 -3
- package/dist/endpoints/Newsrooms/Client.d.ts +11 -11
- package/dist/endpoints/SenderAddresses/Client.d.ts +3 -3
- package/dist/endpoints/Stories/Client.d.ts +102 -102
- package/dist/endpoints/Stories/types.d.ts +2 -35
- package/dist/endpoints/Subscriptions/Client.d.ts +2 -2
- package/dist/types/License.d.ts +12 -0
- package/dist/types/Newsroom.d.ts +1 -0
- package/dist/types/Story.d.ts +5 -0
- package/dist/types/common/Notification.cjs +1 -0
- package/dist/types/common/Notification.d.ts +2 -1
- package/dist/types/common/Notification.js +1 -0
- package/package.json +15 -11
package/dist/api/ApiClient.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ export interface Options {
|
|
|
6
6
|
export type ApiClient = ReturnType<typeof createApiClient>;
|
|
7
7
|
export declare function createApiClient(http: HttpClient, { accessToken, headers }: Options): {
|
|
8
8
|
get: <V = any>(url: string, { headers, query }?: Params) => Promise<ApiResponse<V>>;
|
|
9
|
-
post: <
|
|
10
|
-
put: <
|
|
11
|
-
patch: <
|
|
12
|
-
delete: <
|
|
9
|
+
post: <V_1 = any>(url: string, { headers, payload, query }?: ParamsWithPayload) => Promise<ApiResponse<V_1>>;
|
|
10
|
+
put: <V_2 = any>(url: string, { headers, payload, query }?: ParamsWithPayload) => Promise<ApiResponse<V_2>>;
|
|
11
|
+
patch: <V_3 = any>(url: string, { headers, payload, query }?: ParamsWithPayload) => Promise<ApiResponse<V_3>>;
|
|
12
|
+
delete: <V_4 = any>(url: string, { headers, payload, query }?: ParamsWithPayload) => Promise<ApiResponse<V_4>>;
|
|
13
13
|
};
|
|
@@ -4,8 +4,8 @@ import type { ApiClient } from './ApiClient';
|
|
|
4
4
|
export type DeferredJobsApiClient = ReturnType<typeof createDeferredJobsApiClient>;
|
|
5
5
|
export declare function createDeferredJobsApiClient(api: ApiClient): {
|
|
6
6
|
get: <V = any, P = any>(url: string, { headers, query }?: Params) => ProgressPromise<V, P>;
|
|
7
|
-
post: <
|
|
8
|
-
put: <
|
|
9
|
-
patch: <
|
|
10
|
-
delete: <
|
|
7
|
+
post: <V_1 = any, P_1 = any>(url: string, { headers, payload, query }?: ParamsWithPayload) => ProgressPromise<V_1, P_1>;
|
|
8
|
+
put: <V_2 = any, P_2 = any>(url: string, { headers, payload, query }?: ParamsWithPayload) => ProgressPromise<V_2, P_2>;
|
|
9
|
+
patch: <V_3 = any, P_3 = any>(url: string, { headers, payload, query }?: ParamsWithPayload) => ProgressPromise<V_3, P_3>;
|
|
10
|
+
delete: <V_4 = any, P_4 = any>(url: string, { headers, payload, query }?: ParamsWithPayload) => ProgressPromise<V_4, P_4>;
|
|
11
11
|
};
|
package/dist/api/constants.cjs
CHANGED
|
@@ -4,6 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.DEFAULT_USER_AGENT = void 0;
|
|
7
|
-
const VERSION = "26.5.
|
|
8
|
-
const URL = 'https://github.com/prezly/
|
|
7
|
+
const VERSION = typeof __PREZLY_SDK_VERSION__ === 'string' ? __PREZLY_SDK_VERSION__ : "26.5.1";
|
|
8
|
+
const URL = 'https://github.com/prezly/prezly.git';
|
|
9
9
|
const DEFAULT_USER_AGENT = exports.DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
|
package/dist/api/constants.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const VERSION = "26.5.
|
|
2
|
-
const URL = 'https://github.com/prezly/
|
|
1
|
+
const VERSION = typeof __PREZLY_SDK_VERSION__ === 'string' ? __PREZLY_SDK_VERSION__ : "26.5.1";
|
|
2
|
+
const URL = 'https://github.com/prezly/prezly.git';
|
|
3
3
|
export const DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
|
|
@@ -5,5 +5,5 @@ export type Client = ReturnType<typeof createClient>;
|
|
|
5
5
|
export declare function createClient(api: DeferredJobsApiClient): {
|
|
6
6
|
list: () => Promise<ListResponse>;
|
|
7
7
|
create: (payload: CreateRequest) => Promise<CreateResponse>;
|
|
8
|
-
update: (id: UserAccount[
|
|
8
|
+
update: (id: UserAccount['id'], payload: UpdateRequest) => Promise<UpdateResponse>;
|
|
9
9
|
};
|
|
@@ -22,6 +22,6 @@ export declare function createClient(api: DeferredJobsApiClient): {
|
|
|
22
22
|
removeRecipient: (campaignId: CampaignId, recipientId: EmailRecipientId) => Promise<RecipientsOperationResponse>;
|
|
23
23
|
removeRecipients: (campaignId: CampaignId, params?: {
|
|
24
24
|
query: Query;
|
|
25
|
-
}) => Promise<RecipientsOperationResponse>;
|
|
25
|
+
} | undefined) => Promise<RecipientsOperationResponse>;
|
|
26
26
|
};
|
|
27
27
|
export {};
|
|
@@ -6,17 +6,17 @@ export type Client = ReturnType<typeof createClient>;
|
|
|
6
6
|
export declare function createClient(api: DeferredJobsApiClient): {
|
|
7
7
|
list: (options: SearchOptions) => Promise<ListResponse>;
|
|
8
8
|
search: (options: SearchOptions) => Promise<ListResponse>;
|
|
9
|
-
get: (id: Campaign[
|
|
10
|
-
duplicate: (id: Campaign[
|
|
11
|
-
test: (id: Campaign[
|
|
12
|
-
send: (id: Campaign[
|
|
13
|
-
schedule: (id: Campaign[
|
|
14
|
-
unschedule: (id: Campaign[
|
|
9
|
+
get: (id: Campaign['id']) => Promise<CampaignResponse>;
|
|
10
|
+
duplicate: (id: Campaign['id'], options?: DuplicateOptions) => Promise<CampaignResponse>;
|
|
11
|
+
test: (id: Campaign['id'], emails: string[]) => Promise<void>;
|
|
12
|
+
send: (id: Campaign['id']) => Promise<void>;
|
|
13
|
+
schedule: (id: Campaign['id'], sendAt: Date) => Promise<Campaign>;
|
|
14
|
+
unschedule: (id: Campaign['id']) => Promise<Campaign>;
|
|
15
15
|
create: (payload: CreateRequest) => ProgressPromise<RecipientsOperationResponse, {
|
|
16
16
|
recipients_number: number;
|
|
17
17
|
}>;
|
|
18
|
-
update: (id: Campaign[
|
|
19
|
-
delete: (id: Campaign[
|
|
18
|
+
update: (id: Campaign['id'], payload: UpdateRequest) => Promise<CampaignResponse>;
|
|
19
|
+
delete: (id: Campaign['id']) => Promise<void>;
|
|
20
20
|
bulkDelete: (payload: BulkDeletePayload) => ProgressPromise<{
|
|
21
21
|
records_deleted_number: number;
|
|
22
22
|
}>;
|
|
@@ -5,14 +5,14 @@ export type Client = ReturnType<typeof createClient>;
|
|
|
5
5
|
export declare function createClient(api: DeferredJobsApiClient): {
|
|
6
6
|
list: (options?: ListOptions) => Promise<ListResponse>;
|
|
7
7
|
search: (options?: SearchOptions) => Promise<SearchResponse>;
|
|
8
|
-
get: (id: ContactTag[
|
|
8
|
+
get: (id: ContactTag['id']) => Promise<ContactTag>;
|
|
9
9
|
create: (payload: CreateRequest, { force }?: CreateOptions) => Promise<CreateResponse>;
|
|
10
|
-
update: (id: Contact[
|
|
10
|
+
update: (id: Contact['id'], payload: UpdateRequest, { force }?: UpdateOptions) => Promise<UpdateResponse>;
|
|
11
11
|
merge: ({ name, tags }: MergeRequest) => Promise<MergeResponse>;
|
|
12
|
-
delete: (id: ContactTag[
|
|
12
|
+
delete: (id: ContactTag['id']) => Promise<{
|
|
13
13
|
deleted: number[];
|
|
14
14
|
}>;
|
|
15
|
-
deleteMany: (ids: ContactTag[
|
|
15
|
+
deleteMany: (ids: ContactTag['id'][]) => Promise<{
|
|
16
16
|
deleted: number[];
|
|
17
17
|
}>;
|
|
18
18
|
deleteUnused: () => Promise<{
|
|
@@ -6,14 +6,14 @@ export type Client = ReturnType<typeof createClient>;
|
|
|
6
6
|
export declare function createClient(api: DeferredJobsApiClient): {
|
|
7
7
|
list: (options?: ListOptions) => Promise<ListResponse>;
|
|
8
8
|
search: (options?: SearchOptions) => Promise<SearchResponse>;
|
|
9
|
-
get: (id: Contact[
|
|
10
|
-
getMany: (ids: Contact[
|
|
9
|
+
get: (id: Contact['id']) => Promise<Contact>;
|
|
10
|
+
getMany: (ids: Contact['id'][]) => Promise<Contact[]>;
|
|
11
11
|
create: (payload: CreateRequest) => Promise<Contact>;
|
|
12
|
-
update: (id: Contact[
|
|
13
|
-
tag: (id: Contact[
|
|
14
|
-
untag: (id: Contact[
|
|
12
|
+
update: (id: Contact['id'], payload: UpdateRequest) => Promise<Contact>;
|
|
13
|
+
tag: (id: Contact['id'], tags: ContactTag.Identifier[]) => Promise<Contact>;
|
|
14
|
+
untag: (id: Contact['id'], tags: ContactTag.Identifier[]) => Promise<Contact>;
|
|
15
15
|
bulkTag: (selector: BulkSelector, tags: ContactTag.Identifier[]) => ProgressPromise<undefined>;
|
|
16
16
|
bulkUntag: (selector: BulkSelector, tags: ContactTag.Identifier[]) => ProgressPromise<undefined>;
|
|
17
|
-
delete: (id: Contact[
|
|
17
|
+
delete: (id: Contact['id']) => Promise<void>;
|
|
18
18
|
bulkDelete: (selector: BulkSelector) => Promise<BulkDeleteResponse>;
|
|
19
19
|
};
|
|
@@ -5,9 +5,9 @@ export type Client = ReturnType<typeof createClient>;
|
|
|
5
5
|
export declare function createClient(api: DeferredJobsApiClient): {
|
|
6
6
|
list: (options: ListOptions) => Promise<ListResponse>;
|
|
7
7
|
search: (options: SearchOptions) => Promise<ListResponse>;
|
|
8
|
-
get: (uuid: ContactsExport[
|
|
8
|
+
get: (uuid: ContactsExport['uuid']) => Promise<ContactsExport>;
|
|
9
9
|
create: (selector: ContactsBulkSelector) => Promise<ContactsExport>;
|
|
10
|
-
download: (uuid: ContactsExport[
|
|
10
|
+
download: (uuid: ContactsExport['uuid']) => Promise<{
|
|
11
11
|
downloadUrl: string;
|
|
12
12
|
}>;
|
|
13
13
|
};
|
|
@@ -14,9 +14,9 @@ export declare function createClient(api: DeferredJobsApiClient): {
|
|
|
14
14
|
delete: (integrationId: IntegrationId) => Promise<void>;
|
|
15
15
|
listRuns: (integrationId: IntegrationId, options?: ListRunsOptions) => Promise<ListRunsResponse>;
|
|
16
16
|
preview: (provider: CoverageEntry.Provider, options: {
|
|
17
|
-
input: CoverageIntegration[
|
|
18
|
-
oldest?: number;
|
|
19
|
-
limit?: number;
|
|
17
|
+
input: CoverageIntegration['input'];
|
|
18
|
+
oldest?: number | undefined;
|
|
19
|
+
limit?: number | undefined;
|
|
20
20
|
}) => Promise<PreviewResponse>;
|
|
21
21
|
};
|
|
22
22
|
export {};
|
|
@@ -5,9 +5,9 @@ type NewsroomId = Newsroom['uuid'] | Newsroom['id'];
|
|
|
5
5
|
export type Client = ReturnType<typeof createClient>;
|
|
6
6
|
export declare function createClient(api: DeferredJobsApiClient): {
|
|
7
7
|
list: (newsroomId: NewsroomId, { sortOrder }?: ListOptions) => Promise<Category[]>;
|
|
8
|
-
get: (newsroomId: NewsroomId, categoryId: Category[
|
|
8
|
+
get: (newsroomId: NewsroomId, categoryId: Category['id']) => Promise<Category>;
|
|
9
9
|
create: (newsroomId: NewsroomId, payload: CreateRequest) => Promise<Category>;
|
|
10
|
-
update: (newsroomId: NewsroomId, categoryId: Category[
|
|
11
|
-
delete: (newsroomId: NewsroomId, categoryId: Category[
|
|
10
|
+
update: (newsroomId: NewsroomId, categoryId: Category['id'], payload: UpdateRequest) => Promise<Category>;
|
|
11
|
+
delete: (newsroomId: NewsroomId, categoryId: Category['id']) => Promise<void>;
|
|
12
12
|
};
|
|
13
13
|
export {};
|
|
@@ -5,7 +5,7 @@ type NewsroomId = Newsroom['uuid'] | Newsroom['id'];
|
|
|
5
5
|
type GalleryId = NewsroomGallery['uuid'] | NewsroomGallery['id'];
|
|
6
6
|
export type Client = ReturnType<typeof createClient>;
|
|
7
7
|
export declare function createClient(api: DeferredJobsApiClient): {
|
|
8
|
-
get: (newsroomId: NewsroomId, id: NewsroomGallery[
|
|
8
|
+
get: (newsroomId: NewsroomId, id: NewsroomGallery['uuid']) => Promise<NewsroomGallery>;
|
|
9
9
|
list: (newsroomId: NewsroomId, options?: ListOptions) => Promise<ListResponse>;
|
|
10
10
|
search: (newsroomId: NewsroomId, options?: SearchOptions) => Promise<ListResponse>;
|
|
11
11
|
order: (newsroomId: NewsroomId, payload: ReorderRequest) => Promise<void>;
|
|
@@ -5,19 +5,19 @@ type NewsroomId = Newsroom['uuid'] | Newsroom['id'];
|
|
|
5
5
|
export type Client = ReturnType<typeof createClient>;
|
|
6
6
|
export declare function createClient(api: DeferredJobsApiClient): {
|
|
7
7
|
list: (newsroomId: NewsroomId, { sortOrder }?: ListOptions) => Promise<ListResponse>;
|
|
8
|
-
get: (newsroomId: NewsroomId, localeCode: CultureRef[
|
|
9
|
-
fallback?:
|
|
8
|
+
get: (newsroomId: NewsroomId, localeCode: CultureRef['code'], { fallback }?: {
|
|
9
|
+
fallback?: boolean | undefined;
|
|
10
10
|
}) => Promise<NewsroomLanguageSettings>;
|
|
11
|
-
enable: (newsroomId: NewsroomId, localeCode: CultureRef[
|
|
12
|
-
disable: (newsroomId: NewsroomId, localeCode: CultureRef[
|
|
13
|
-
replacement?:
|
|
11
|
+
enable: (newsroomId: NewsroomId, localeCode: CultureRef['code'], payload?: SettingsUpdateRequest) => Promise<NewsroomLanguageSettings>;
|
|
12
|
+
disable: (newsroomId: NewsroomId, localeCode: CultureRef['code'], { replacement }: {
|
|
13
|
+
replacement?: import("../../types").Culture.Code | undefined;
|
|
14
14
|
}) => Promise<void>;
|
|
15
|
-
update: (newsroomId: NewsroomId, localeCode: CultureRef[
|
|
16
|
-
force?: boolean;
|
|
15
|
+
update: (newsroomId: NewsroomId, localeCode: CultureRef['code'], payload: SettingsUpdateRequest, options?: {
|
|
16
|
+
force?: boolean | undefined;
|
|
17
17
|
}) => Promise<NewsroomLanguageSettings>;
|
|
18
|
-
makeDefault: (newsroomId: NewsroomId, localeCode: CultureRef[
|
|
19
|
-
switchDefaultLanguage: (newsroomId: NewsroomId, localeCode: CultureRef[
|
|
20
|
-
status:
|
|
18
|
+
makeDefault: (newsroomId: NewsroomId, localeCode: CultureRef['code']) => Promise<NewsroomLanguageSettings>;
|
|
19
|
+
switchDefaultLanguage: (newsroomId: NewsroomId, localeCode: CultureRef['code'], newLocaleCode: CultureRef['code'], forceUnsafeOperation?: boolean) => Promise<{
|
|
20
|
+
status: 'success';
|
|
21
21
|
language: NewsroomLanguageSettings;
|
|
22
22
|
} | UnsafeUpdateErrorResponse>;
|
|
23
23
|
};
|
|
@@ -5,5 +5,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.isUnsafeNewsroomUpdateErrorResponse = isUnsafeNewsroomUpdateErrorResponse;
|
|
7
7
|
function isUnsafeNewsroomUpdateErrorResponse(value) {
|
|
8
|
-
return value && value.status === 'error' && value.code === 'unsafe' && typeof value.message === 'string' && value.errors
|
|
8
|
+
return value && value.status === 'error' && value.code === 'unsafe' && typeof value.message === 'string' && value.errors?.[':global'] && Array.isArray(value.errors[':global']) && value.errors[':global'].every(error => error && typeof error.code === 'string' && typeof error.message === 'string');
|
|
9
9
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export function isUnsafeNewsroomUpdateErrorResponse(value) {
|
|
2
|
-
return value && value.status === 'error' && value.code === 'unsafe' && typeof value.message === 'string' && value.errors
|
|
2
|
+
return value && value.status === 'error' && value.code === 'unsafe' && typeof value.message === 'string' && value.errors?.[':global'] && Array.isArray(value.errors[':global']) && value.errors[':global'].every(error => error && typeof error.code === 'string' && typeof error.message === 'string');
|
|
3
3
|
}
|
|
@@ -3,6 +3,6 @@ import type { Newsroom, PrivacyRequest } from '../../types';
|
|
|
3
3
|
import type { DeletePrivacyRequestCreateRequest, ExportPrivacyRequestCreateRequest, CorrectPrivacyRequestCreateRequest, OtherPrivacyRequestCreateRequest } from './types';
|
|
4
4
|
export type Client = ReturnType<typeof createClient>;
|
|
5
5
|
export declare function createClient(api: DeferredJobsApiClient): {
|
|
6
|
-
create: (newsroomId: Newsroom[
|
|
7
|
-
confirm: (newsroomId: Newsroom[
|
|
6
|
+
create: (newsroomId: Newsroom['uuid'], payload: DeletePrivacyRequestCreateRequest | ExportPrivacyRequestCreateRequest | CorrectPrivacyRequestCreateRequest | OtherPrivacyRequestCreateRequest) => Promise<PrivacyRequest>;
|
|
7
|
+
confirm: (newsroomId: Newsroom['uuid'], privacyRequestId: PrivacyRequest['id']) => Promise<PrivacyRequest>;
|
|
8
8
|
};
|
|
@@ -4,10 +4,10 @@ type NewsroomId = Newsroom['uuid'] | Newsroom['id'];
|
|
|
4
4
|
type NewsroomThemeId = NewsroomTheme['id'];
|
|
5
5
|
export type Client = ReturnType<typeof createClient>;
|
|
6
6
|
export declare function createClient(api: DeferredJobsApiClient): {
|
|
7
|
-
apply: (newsroomId: NewsroomId, themeId: NewsroomThemeId, settings: NewsroomThemePreset[
|
|
7
|
+
apply: (newsroomId: NewsroomId, themeId: NewsroomThemeId, settings: NewsroomThemePreset['settings']) => Promise<NewsroomThemePreset>;
|
|
8
8
|
get: (newsroomId: NewsroomId, themeId: NewsroomThemeId) => Promise<NewsroomThemePreset>;
|
|
9
9
|
getActive: (newsroomId: NewsroomId) => Promise<NewsroomThemePreset>;
|
|
10
10
|
list: (newsroomId: NewsroomId) => Promise<NewsroomThemePreset[]>;
|
|
11
|
-
update: (newsroomId: NewsroomId, themeId: NewsroomThemeId, settings: NewsroomThemePreset[
|
|
11
|
+
update: (newsroomId: NewsroomId, themeId: NewsroomThemeId, settings: NewsroomThemePreset['settings']) => Promise<NewsroomThemePreset>;
|
|
12
12
|
};
|
|
13
13
|
export {};
|
|
@@ -6,8 +6,8 @@ export type Client = ReturnType<typeof createClient>;
|
|
|
6
6
|
export declare function createClient(api: DeferredJobsApiClient): {
|
|
7
7
|
list: (newsroomId: NewsroomId) => Promise<NewsroomWebhook[]>;
|
|
8
8
|
create: (newsroomId: NewsroomId, payload: CreateRequest) => Promise<NewsroomWebhook>;
|
|
9
|
-
get: (newsroomId: NewsroomId, webhookId: NewsroomWebhook[
|
|
10
|
-
update: (newsroomId: NewsroomId, webhookId: NewsroomWebhook[
|
|
11
|
-
delete: (newsroomId: NewsroomId, webhookId: NewsroomWebhook[
|
|
9
|
+
get: (newsroomId: NewsroomId, webhookId: NewsroomWebhook['id']) => Promise<NewsroomWebhook>;
|
|
10
|
+
update: (newsroomId: NewsroomId, webhookId: NewsroomWebhook['id'], payload: UpdateRequest) => Promise<NewsroomWebhook>;
|
|
11
|
+
delete: (newsroomId: NewsroomId, webhookId: NewsroomWebhook['id']) => Promise<void>;
|
|
12
12
|
};
|
|
13
13
|
export {};
|
|
@@ -9,16 +9,16 @@ type Exactly<Concrete, Abstract> = Concrete & Record<Exclude<keyof Concrete, key
|
|
|
9
9
|
type InferExtraFields<T> = T extends Required<IncludeOptions<infer I>> ? Pick<Newsroom.ExtraFields, I> : unknown;
|
|
10
10
|
export type Client = ReturnType<typeof createClient>;
|
|
11
11
|
export declare function createClient(api: DeferredJobsApiClient): {
|
|
12
|
-
list: <Options extends ListOptions
|
|
13
|
-
search: <
|
|
14
|
-
get: <
|
|
15
|
-
create: <
|
|
16
|
-
update: <
|
|
17
|
-
archive: <
|
|
18
|
-
unarchive: <
|
|
19
|
-
delete: (id: Newsroom[
|
|
20
|
-
takeOnline: <
|
|
21
|
-
takeOffline: <
|
|
22
|
-
convertToHub: <
|
|
12
|
+
list: <Options extends ListOptions<keyof Newsroom.ExtraFields>>(options?: Exactly<Options, ListOptions<keyof Newsroom.ExtraFields>> | undefined) => Promise<ListResponse<Newsroom & InferExtraFields<Options>>>;
|
|
13
|
+
search: <Options_1 extends SearchOptions<keyof Newsroom.ExtraFields>>(options?: Exactly<Options_1, SearchOptions<keyof Newsroom.ExtraFields>> | undefined) => Promise<ListResponse<Newsroom & InferExtraFields<Options_1>>>;
|
|
14
|
+
get: <Options_2 extends IncludeOptions<keyof Newsroom.ExtraFields>>(id: Newsroom['uuid'] | Newsroom['id'], options?: Exactly<Options_2, IncludeOptions<keyof Newsroom.ExtraFields>> | undefined) => Promise<Newsroom & InferExtraFields<Options_2>>;
|
|
15
|
+
create: <Options_3 extends IncludeOptions<keyof Newsroom.ExtraFields>>(payload: CreateRequest, options?: Exactly<Options_3, IncludeOptions<keyof Newsroom.ExtraFields>> | undefined) => Promise<Newsroom & InferExtraFields<Options_3>>;
|
|
16
|
+
update: <Options_4 extends IncludeOptions<keyof Newsroom.ExtraFields>>(id: Newsroom['uuid'] | Newsroom['id'], payload: UpdateRequest, options?: Exactly<Options_4, IncludeOptions<keyof Newsroom.ExtraFields>> | undefined) => Promise<Newsroom & InferExtraFields<Options_4>>;
|
|
17
|
+
archive: <Options_5 extends IncludeOptions<keyof Newsroom.ExtraFields>>(id: Newsroom['uuid'] | Newsroom['id'], options?: Exactly<Options_5, IncludeOptions<keyof Newsroom.ExtraFields>> | undefined) => Promise<Newsroom & InferExtraFields<Options_5>>;
|
|
18
|
+
unarchive: <Options_6 extends IncludeOptions<keyof Newsroom.ExtraFields>>(id: Newsroom['uuid'] | Newsroom['id'], options?: Exactly<Options_6, IncludeOptions<keyof Newsroom.ExtraFields>> | undefined) => Promise<Newsroom & InferExtraFields<Options_6>>;
|
|
19
|
+
delete: (id: Newsroom['uuid'] | Newsroom['id']) => Promise<void>;
|
|
20
|
+
takeOnline: <Options_7 extends IncludeOptions<keyof Newsroom.ExtraFields>>(id: Newsroom['uuid'] | Newsroom['id'], options?: Exactly<Options_7, IncludeOptions<keyof Newsroom.ExtraFields>> | undefined) => Promise<Newsroom & InferExtraFields<Options_7>>;
|
|
21
|
+
takeOffline: <Options_8 extends IncludeOptions<keyof Newsroom.ExtraFields>>(id: Newsroom['uuid'] | Newsroom['id'], options?: Exactly<Options_8, IncludeOptions<keyof Newsroom.ExtraFields>> | undefined) => Promise<Newsroom & InferExtraFields<Options_8>>;
|
|
22
|
+
convertToHub: <Options_9 extends IncludeOptions<keyof Newsroom.ExtraFields>>(id: Newsroom['uuid'] | Newsroom['id'], options?: Exactly<Options_9, IncludeOptions<keyof Newsroom.ExtraFields>> | undefined) => Promise<Newsroom & InferExtraFields<Options_9>>;
|
|
23
23
|
};
|
|
24
24
|
export {};
|
|
@@ -6,7 +6,7 @@ export type Client = ReturnType<typeof createClient>;
|
|
|
6
6
|
export declare function createClient(api: DeferredJobsApiClient): {
|
|
7
7
|
list: (scope?: Query) => Promise<SenderAddress[]>;
|
|
8
8
|
create: (payload: CreateRequest) => Promise<SenderAddress>;
|
|
9
|
-
get: (senderId: SenderAddress[
|
|
10
|
-
update: (senderId: SenderAddress[
|
|
11
|
-
delete: (senderId: SenderAddress[
|
|
9
|
+
get: (senderId: SenderAddress['id']) => Promise<SenderAddress>;
|
|
10
|
+
update: (senderId: SenderAddress['id'], payload: UpdateRequest) => Promise<SenderAddress>;
|
|
11
|
+
delete: (senderId: SenderAddress['id']) => Promise<void>;
|
|
12
12
|
};
|
|
@@ -15,110 +15,110 @@ type Exactly<Concrete, Abstract> = Concrete & Record<Exclude<keyof Concrete, key
|
|
|
15
15
|
type InferExtraFields<T> = T extends Required<IncludeOptions<infer I>> ? Pick<Story.ExtraFields, I> : unknown;
|
|
16
16
|
export type Client = ReturnType<typeof createClient>;
|
|
17
17
|
export declare function createClient(api: DeferredJobsApiClient): {
|
|
18
|
-
list: <Options extends ListOptions
|
|
19
|
-
search: <
|
|
18
|
+
list: <Options extends ListOptions<keyof Story.ExtraFields>>(options?: Exactly<Options, ListOptions<keyof Story.ExtraFields>> | undefined) => Promise<ListResponse<Story & InferExtraFields<Options>>>;
|
|
19
|
+
search: <Options_1 extends SearchOptions<keyof Story.ExtraFields>>(options?: Exactly<Options_1, SearchOptions<keyof Story.ExtraFields>> | undefined) => Promise<ListResponse<Story & InferExtraFields<Options_1>>>;
|
|
20
20
|
get: {
|
|
21
|
-
<
|
|
22
|
-
formats?: Formats;
|
|
23
|
-
}>(id: Story[
|
|
24
|
-
formats?: Formats;
|
|
25
|
-
}>): Promise<ExtendedStory & InferExtraFields<
|
|
26
|
-
<
|
|
27
|
-
formats?: Formats;
|
|
28
|
-
}>(ids: Story[
|
|
29
|
-
formats?: Formats;
|
|
30
|
-
}>): Promise<(ExtendedStory & InferExtraFields<
|
|
31
|
-
<
|
|
32
|
-
formats?: Formats;
|
|
33
|
-
}>(id: Story[
|
|
34
|
-
formats?: Formats;
|
|
35
|
-
}>): Promise<ExtendedStory & InferExtraFields<
|
|
36
|
-
<
|
|
37
|
-
formats?: Formats;
|
|
38
|
-
}>(ids: Story[
|
|
39
|
-
formats?: Formats;
|
|
40
|
-
}>): Promise<(ExtendedStory & InferExtraFields<
|
|
21
|
+
<Options_2 extends IncludeOptions<keyof Story.ExtraFields> & {
|
|
22
|
+
formats?: Formats | undefined;
|
|
23
|
+
}>(id: Story['uuid'], options?: Exactly<Options_2, IncludeOptions<keyof Story.ExtraFields> & {
|
|
24
|
+
formats?: Formats | undefined;
|
|
25
|
+
}> | undefined): Promise<ExtendedStory & InferExtraFields<Options_2>>;
|
|
26
|
+
<Options_3 extends IncludeOptions<keyof Story.ExtraFields> & {
|
|
27
|
+
formats?: Formats | undefined;
|
|
28
|
+
}>(ids: Story['uuid'][], options?: Exactly<Options_3, IncludeOptions<keyof Story.ExtraFields> & {
|
|
29
|
+
formats?: Formats | undefined;
|
|
30
|
+
}> | undefined): Promise<(ExtendedStory & InferExtraFields<Options_3>)[]>;
|
|
31
|
+
<Options_4 extends IncludeOptions<keyof Story.ExtraFields> & {
|
|
32
|
+
formats?: Formats | undefined;
|
|
33
|
+
}>(id: Story['id'] | Story['uuid'], options?: Exactly<Options_4, IncludeOptions<keyof Story.ExtraFields> & {
|
|
34
|
+
formats?: Formats | undefined;
|
|
35
|
+
}> | undefined): Promise<ExtendedStory & InferExtraFields<Options_4>>;
|
|
36
|
+
<Options_5 extends IncludeOptions<keyof Story.ExtraFields> & {
|
|
37
|
+
formats?: Formats | undefined;
|
|
38
|
+
}>(ids: Story['id'][], options?: Exactly<Options_5, IncludeOptions<keyof Story.ExtraFields> & {
|
|
39
|
+
formats?: Formats | undefined;
|
|
40
|
+
}> | undefined): Promise<(ExtendedStory & InferExtraFields<Options_5>)[]>;
|
|
41
41
|
};
|
|
42
|
-
getBySlug: <
|
|
43
|
-
formats?: Formats;
|
|
44
|
-
query?: Query;
|
|
45
|
-
}>(slug: Story[
|
|
46
|
-
formats?: Formats;
|
|
47
|
-
query?: Query;
|
|
48
|
-
}>) => Promise<ExtendedStory & InferExtraFields<
|
|
49
|
-
create: <
|
|
50
|
-
formats?: Formats;
|
|
51
|
-
force?: boolean;
|
|
52
|
-
}>(payload: CreateRequest, options?: Exactly<
|
|
53
|
-
formats?: Formats;
|
|
54
|
-
force?: boolean;
|
|
55
|
-
}>) => Promise<ExtendedStory & InferExtraFields<
|
|
56
|
-
duplicate: <
|
|
57
|
-
formats?: Formats;
|
|
58
|
-
}>(id: StoryId, options?: Exactly<
|
|
59
|
-
formats?: Formats;
|
|
60
|
-
}>) => Promise<ExtendedStory & InferExtraFields<
|
|
61
|
-
translate: <
|
|
62
|
-
formats?: Formats;
|
|
63
|
-
}>(id: StoryId, payload?: TranslateRequest, options?: Exactly<
|
|
64
|
-
formats?: Formats;
|
|
65
|
-
}>) => Promise<ExtendedStory & InferExtraFields<
|
|
66
|
-
move: <
|
|
67
|
-
formats?: Formats;
|
|
68
|
-
force?: boolean;
|
|
69
|
-
}>(id: StoryId, payload: MoveRequest, options?: Exactly<
|
|
70
|
-
formats?: Formats;
|
|
71
|
-
force?: boolean;
|
|
72
|
-
}>) => Promise<ChangeNewsroomSuccessResponse<ExtendedStory & InferExtraFields<
|
|
73
|
-
update: <
|
|
74
|
-
formats?: Formats;
|
|
75
|
-
force?: boolean;
|
|
76
|
-
}>(id: StoryId, payload: UpdateRequest, options?: Exactly<
|
|
77
|
-
formats?: Formats;
|
|
78
|
-
force?: boolean;
|
|
79
|
-
}>) => Promise<ExtendedStory & InferExtraFields<
|
|
80
|
-
autosave: <
|
|
81
|
-
formats?: Formats;
|
|
82
|
-
}>(id: StoryId, payload: AutosaveRequest, options?: Exactly<
|
|
83
|
-
formats?: Formats;
|
|
84
|
-
}>) => Promise<ExtendedStory & InferExtraFields<
|
|
85
|
-
revert: <
|
|
86
|
-
formats?: Formats;
|
|
87
|
-
}>(id: StoryId, payload?: RevertRequest, options?: Exactly<
|
|
88
|
-
formats?: Formats;
|
|
89
|
-
}>) => Promise<ExtendedStory & InferExtraFields<
|
|
90
|
-
publish: <
|
|
91
|
-
formats?: Formats;
|
|
92
|
-
}>(id: StoryId, payload?: PublishRequest, options?: Exactly<
|
|
93
|
-
formats?: Formats;
|
|
94
|
-
}>) => Promise<ExtendedStory & InferExtraFields<
|
|
95
|
-
unpublish: <
|
|
96
|
-
formats?: Formats;
|
|
97
|
-
}>(id: StoryId, payload?: UnpublishRequest, options?: Exactly<
|
|
98
|
-
formats?: Formats;
|
|
99
|
-
}>) => Promise<ExtendedStory & InferExtraFields<
|
|
100
|
-
schedule: <
|
|
101
|
-
formats?: Formats;
|
|
102
|
-
}>(id: StoryId, payload?: ScheduleRequest, options?: Exactly<
|
|
103
|
-
formats?: Formats;
|
|
104
|
-
}>) => Promise<ExtendedStory & InferExtraFields<
|
|
105
|
-
unschedule: <
|
|
106
|
-
formats?: Formats;
|
|
107
|
-
}>(id: StoryId, payload?: UnscheduleRequest, options?: Exactly<
|
|
108
|
-
formats?: Formats;
|
|
109
|
-
}>) => Promise<ExtendedStory & InferExtraFields<
|
|
110
|
-
pin: <
|
|
111
|
-
formats?: Formats;
|
|
112
|
-
force?: boolean;
|
|
113
|
-
}>(id: StoryId, options?: Exactly<
|
|
114
|
-
formats?: Formats;
|
|
115
|
-
force?: boolean;
|
|
116
|
-
}>) => Promise<ExtendedStory & InferExtraFields<
|
|
117
|
-
unpin: <
|
|
118
|
-
formats?: Formats;
|
|
119
|
-
}>(id: StoryId, options?: Exactly<
|
|
120
|
-
formats?: Formats;
|
|
121
|
-
}>) => Promise<ExtendedStory & InferExtraFields<
|
|
42
|
+
getBySlug: <Options_6 extends IncludeOptions<keyof Story.ExtraFields> & {
|
|
43
|
+
formats?: Formats | undefined;
|
|
44
|
+
query?: Query | undefined;
|
|
45
|
+
}>(slug: Story['slug'], options?: Exactly<Options_6, IncludeOptions<keyof Story.ExtraFields> & {
|
|
46
|
+
formats?: Formats | undefined;
|
|
47
|
+
query?: Query | undefined;
|
|
48
|
+
}> | undefined) => Promise<ExtendedStory & InferExtraFields<Options_6>>;
|
|
49
|
+
create: <Options_7 extends IncludeOptions<keyof Story.ExtraFields> & {
|
|
50
|
+
formats?: Formats | undefined;
|
|
51
|
+
force?: boolean | undefined;
|
|
52
|
+
}>(payload: CreateRequest, options?: Exactly<Options_7, IncludeOptions<keyof Story.ExtraFields> & {
|
|
53
|
+
formats?: Formats | undefined;
|
|
54
|
+
force?: boolean | undefined;
|
|
55
|
+
}> | undefined) => Promise<ExtendedStory & InferExtraFields<Options_7>>;
|
|
56
|
+
duplicate: <Options_8 extends IncludeOptions<keyof Story.ExtraFields> & {
|
|
57
|
+
formats?: Formats | undefined;
|
|
58
|
+
}>(id: StoryId, options?: Exactly<Options_8, IncludeOptions<keyof Story.ExtraFields> & {
|
|
59
|
+
formats?: Formats | undefined;
|
|
60
|
+
}> | undefined) => Promise<ExtendedStory & InferExtraFields<Options_8>>;
|
|
61
|
+
translate: <Options_9 extends IncludeOptions<keyof Story.ExtraFields> & {
|
|
62
|
+
formats?: Formats | undefined;
|
|
63
|
+
}>(id: StoryId, payload?: TranslateRequest, options?: Exactly<Options_9, IncludeOptions<keyof Story.ExtraFields> & {
|
|
64
|
+
formats?: Formats | undefined;
|
|
65
|
+
}> | undefined) => Promise<ExtendedStory & InferExtraFields<Options_9>>;
|
|
66
|
+
move: <Options_10 extends IncludeOptions<keyof Story.ExtraFields> & {
|
|
67
|
+
formats?: Formats | undefined;
|
|
68
|
+
force?: boolean | undefined;
|
|
69
|
+
}>(id: StoryId, payload: MoveRequest, options?: Exactly<Options_10, IncludeOptions<keyof Story.ExtraFields> & {
|
|
70
|
+
formats?: Formats | undefined;
|
|
71
|
+
force?: boolean | undefined;
|
|
72
|
+
}> | undefined) => Promise<ChangeNewsroomUnsafeResponse | ChangeNewsroomSuccessResponse<ExtendedStory & InferExtraFields<Options_10>>>;
|
|
73
|
+
update: <Options_11 extends IncludeOptions<keyof Story.ExtraFields> & {
|
|
74
|
+
formats?: Formats | undefined;
|
|
75
|
+
force?: boolean | undefined;
|
|
76
|
+
}>(id: StoryId, payload: UpdateRequest, options?: Exactly<Options_11, IncludeOptions<keyof Story.ExtraFields> & {
|
|
77
|
+
formats?: Formats | undefined;
|
|
78
|
+
force?: boolean | undefined;
|
|
79
|
+
}> | undefined) => Promise<ExtendedStory & InferExtraFields<Options_11>>;
|
|
80
|
+
autosave: <Options_12 extends IncludeOptions<keyof Story.ExtraFields> & {
|
|
81
|
+
formats?: Formats | undefined;
|
|
82
|
+
}>(id: StoryId, payload: AutosaveRequest, options?: Exactly<Options_12, IncludeOptions<keyof Story.ExtraFields> & {
|
|
83
|
+
formats?: Formats | undefined;
|
|
84
|
+
}> | undefined) => Promise<ExtendedStory & InferExtraFields<Options_12>>;
|
|
85
|
+
revert: <Options_13 extends IncludeOptions<keyof Story.ExtraFields> & {
|
|
86
|
+
formats?: Formats | undefined;
|
|
87
|
+
}>(id: StoryId, payload?: RevertRequest, options?: Exactly<Options_13, IncludeOptions<keyof Story.ExtraFields> & {
|
|
88
|
+
formats?: Formats | undefined;
|
|
89
|
+
}> | undefined) => Promise<ExtendedStory & InferExtraFields<Options_13>>;
|
|
90
|
+
publish: <Options_14 extends IncludeOptions<keyof Story.ExtraFields> & {
|
|
91
|
+
formats?: Formats | undefined;
|
|
92
|
+
}>(id: StoryId, payload?: PublishRequest, options?: Exactly<Options_14, IncludeOptions<keyof Story.ExtraFields> & {
|
|
93
|
+
formats?: Formats | undefined;
|
|
94
|
+
}> | undefined) => Promise<ExtendedStory & InferExtraFields<Options_14>>;
|
|
95
|
+
unpublish: <Options_15 extends IncludeOptions<keyof Story.ExtraFields> & {
|
|
96
|
+
formats?: Formats | undefined;
|
|
97
|
+
}>(id: StoryId, payload?: UnpublishRequest, options?: Exactly<Options_15, IncludeOptions<keyof Story.ExtraFields> & {
|
|
98
|
+
formats?: Formats | undefined;
|
|
99
|
+
}> | undefined) => Promise<ExtendedStory & InferExtraFields<Options_15>>;
|
|
100
|
+
schedule: <Options_16 extends IncludeOptions<keyof Story.ExtraFields> & {
|
|
101
|
+
formats?: Formats | undefined;
|
|
102
|
+
}>(id: StoryId, payload?: ScheduleRequest, options?: Exactly<Options_16, IncludeOptions<keyof Story.ExtraFields> & {
|
|
103
|
+
formats?: Formats | undefined;
|
|
104
|
+
}> | undefined) => Promise<ExtendedStory & InferExtraFields<Options_16>>;
|
|
105
|
+
unschedule: <Options_17 extends IncludeOptions<keyof Story.ExtraFields> & {
|
|
106
|
+
formats?: Formats | undefined;
|
|
107
|
+
}>(id: StoryId, payload?: UnscheduleRequest, options?: Exactly<Options_17, IncludeOptions<keyof Story.ExtraFields> & {
|
|
108
|
+
formats?: Formats | undefined;
|
|
109
|
+
}> | undefined) => Promise<ExtendedStory & InferExtraFields<Options_17>>;
|
|
110
|
+
pin: <Options_18 extends IncludeOptions<keyof Story.ExtraFields> & {
|
|
111
|
+
formats?: Formats | undefined;
|
|
112
|
+
force?: boolean | undefined;
|
|
113
|
+
}>(id: StoryId, options?: Exactly<Options_18, IncludeOptions<keyof Story.ExtraFields> & {
|
|
114
|
+
formats?: Formats | undefined;
|
|
115
|
+
force?: boolean | undefined;
|
|
116
|
+
}> | undefined) => Promise<ExtendedStory & InferExtraFields<Options_18>>;
|
|
117
|
+
unpin: <Options_19 extends IncludeOptions<keyof Story.ExtraFields> & {
|
|
118
|
+
formats?: Formats | undefined;
|
|
119
|
+
}>(id: StoryId, options?: Exactly<Options_19, IncludeOptions<keyof Story.ExtraFields> & {
|
|
120
|
+
formats?: Formats | undefined;
|
|
121
|
+
}> | undefined) => Promise<ExtendedStory & InferExtraFields<Options_19>>;
|
|
122
122
|
delete: (id: StoryId) => Promise<void>;
|
|
123
123
|
bulkDelete: (payload: BulkDeletePayload) => ProgressPromise<{
|
|
124
124
|
records_deleted_number: number;
|
|
@@ -255,39 +255,6 @@ export interface ChangeNewsroomUnsafeResponse {
|
|
|
255
255
|
message: string;
|
|
256
256
|
warnings: ChangeNewsroomWarning[];
|
|
257
257
|
}
|
|
258
|
-
declare const
|
|
259
|
-
|
|
260
|
-
header_image: true;
|
|
261
|
-
preview_image: true;
|
|
262
|
-
social_image: true;
|
|
263
|
-
social_text: true;
|
|
264
|
-
tag_names: true;
|
|
265
|
-
content: true;
|
|
266
|
-
attached_gallery_content: true;
|
|
267
|
-
referenced_entities: true;
|
|
268
|
-
};
|
|
269
|
-
declare const ALL_EXTRA_FIELDS_SHAPE: {
|
|
270
|
-
thumbnail_image: true;
|
|
271
|
-
header_image: true;
|
|
272
|
-
preview_image: true;
|
|
273
|
-
social_image: true;
|
|
274
|
-
social_text: true;
|
|
275
|
-
tag_names: true;
|
|
276
|
-
content: true;
|
|
277
|
-
autosaved_content: true;
|
|
278
|
-
content_version: true;
|
|
279
|
-
last_modifying_user: true;
|
|
280
|
-
attached_gallery_content: true;
|
|
281
|
-
attached_videos_content: true;
|
|
282
|
-
attached_bookmarks_content: true;
|
|
283
|
-
attached_attachments_content: true;
|
|
284
|
-
attached_contacts_content: true;
|
|
285
|
-
referenced_entities: true;
|
|
286
|
-
'campaigns.count': true;
|
|
287
|
-
'pitches.count': true;
|
|
288
|
-
'coverage.count': true;
|
|
289
|
-
cross_site_translations: true;
|
|
290
|
-
};
|
|
291
|
-
export declare const ALL_EXTRA_FIELDS: (keyof typeof ALL_EXTRA_FIELDS_SHAPE)[];
|
|
292
|
-
export declare const EXTENDED_STORY_INCLUDED_EXTRA_FIELDS: (keyof typeof EXTENDED_STORY_INCLUDED_EXTRA_FIELDS_SHAPE)[];
|
|
258
|
+
export declare const ALL_EXTRA_FIELDS: ("content" | "preview_image" | "cross_site_translations" | "thumbnail_image" | "header_image" | "social_image" | "social_text" | "tag_names" | "attached_gallery_content" | "referenced_entities" | "autosaved_content" | "content_version" | "last_modifying_user" | "attached_videos_content" | "attached_bookmarks_content" | "attached_attachments_content" | "attached_contacts_content" | "campaigns.count" | "pitches.count" | "coverage.count")[];
|
|
259
|
+
export declare const EXTENDED_STORY_INCLUDED_EXTRA_FIELDS: ("content" | "preview_image" | "thumbnail_image" | "header_image" | "social_image" | "social_text" | "tag_names" | "attached_gallery_content" | "referenced_entities")[];
|
|
293
260
|
export {};
|
|
@@ -7,7 +7,7 @@ export declare function createClient(api: DeferredJobsApiClient): {
|
|
|
7
7
|
subscribeToNewsroom: <Type extends Contact.Type>(newsroomId: NewsroomId, payload: SubscribeRequest<Type>) => Promise<EmailSubscription>;
|
|
8
8
|
unsubscribeFromNewsroom: (newsroomId: NewsroomId, payload: UnsubscribeRequest) => Promise<EmailSubscription>;
|
|
9
9
|
unsubscribeFromLicense: (payload: UnsubscribeRequest) => Promise<EmailSubscription>;
|
|
10
|
-
updateNewsroomUnsubscribeDetails: (newsroomId: NewsroomId, subscriptionId: EmailSubscription[
|
|
11
|
-
updateLicenseUnsubscribeDetails: (subscriptionId: EmailSubscription[
|
|
10
|
+
updateNewsroomUnsubscribeDetails: (newsroomId: NewsroomId, subscriptionId: EmailSubscription['id'], payload: UpdateUnsubscribeDetailsRequest) => Promise<EmailSubscription>;
|
|
11
|
+
updateLicenseUnsubscribeDetails: (subscriptionId: EmailSubscription['id'], payload: UpdateUnsubscribeDetailsRequest) => Promise<EmailSubscription>;
|
|
12
12
|
};
|
|
13
13
|
export {};
|
package/dist/types/License.d.ts
CHANGED
|
@@ -21,6 +21,10 @@ export interface License extends LicenseRef {
|
|
|
21
21
|
* it will be null (no data about billing cycle).
|
|
22
22
|
*/
|
|
23
23
|
billing_cycle: number | null;
|
|
24
|
+
/**
|
|
25
|
+
* Number of days before renewal when cancellation must be requested.
|
|
26
|
+
*/
|
|
27
|
+
cancellation_notice: number | null;
|
|
24
28
|
has_credit_card: boolean;
|
|
25
29
|
/**
|
|
26
30
|
* Date when subscription will be automatically canceled.
|
|
@@ -34,6 +38,14 @@ export interface License extends LicenseRef {
|
|
|
34
38
|
company_address_city: string;
|
|
35
39
|
company_address_country: string;
|
|
36
40
|
company_address_zip: string;
|
|
41
|
+
/**
|
|
42
|
+
* Contract cycle in months.
|
|
43
|
+
*/
|
|
44
|
+
contract_cycle: number | null;
|
|
45
|
+
/**
|
|
46
|
+
* Date when the current contract renews.
|
|
47
|
+
*/
|
|
48
|
+
contract_renewal_at: string | null;
|
|
37
49
|
created_at: string;
|
|
38
50
|
/**
|
|
39
51
|
* When there are no subscriptions yet, the currency is null (we do not set a default value).
|
package/dist/types/Newsroom.d.ts
CHANGED
|
@@ -116,6 +116,7 @@ export interface Newsroom extends NewsroomRef {
|
|
|
116
116
|
auto_create_contacts_from_subscribers: boolean;
|
|
117
117
|
is_white_labeled: boolean;
|
|
118
118
|
redirect_to_canonical_url: boolean;
|
|
119
|
+
suggested_opoint_search_params?: Record<string, unknown> | null;
|
|
119
120
|
is_plausible_enabled: boolean;
|
|
120
121
|
plausible_site_id: string;
|
|
121
122
|
/**
|
package/dist/types/Story.d.ts
CHANGED
|
@@ -78,6 +78,11 @@ export interface Story {
|
|
|
78
78
|
newsroom: NewsroomRef;
|
|
79
79
|
categories: Category[];
|
|
80
80
|
translations: StoryRef[];
|
|
81
|
+
/**
|
|
82
|
+
* Translations of this story that exist in other newsrooms (cross-site translations).
|
|
83
|
+
* Only present when requested via the `cross_site_translations` include.
|
|
84
|
+
*/
|
|
85
|
+
cross_site_translations?: StoryRef[];
|
|
81
86
|
oembed: OEmbedInfo;
|
|
82
87
|
coverage_number: number;
|
|
83
88
|
auto_matched_coverage_number: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prezly/sdk",
|
|
3
|
-
"version": "26.5.
|
|
3
|
+
"version": "26.5.1",
|
|
4
4
|
"description": "Prezly API SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -18,16 +18,17 @@
|
|
|
18
18
|
],
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
21
|
-
"url": "https://github.com/prezly/
|
|
21
|
+
"url": "https://github.com/prezly/prezly.git",
|
|
22
|
+
"directory": "apps/backend/packages/prezly-sdk"
|
|
22
23
|
},
|
|
23
24
|
"author": "Prezly Team <hello@prezly.com> (https://www.prezly.com)",
|
|
24
25
|
"license": "MIT",
|
|
25
26
|
"engines": {
|
|
26
|
-
"node": ">=
|
|
27
|
+
"node": ">=22"
|
|
27
28
|
},
|
|
28
29
|
"dependencies": {
|
|
29
30
|
"@prezly/progress-promise": "^2.0.1",
|
|
30
|
-
"@prezly/uploads": "^0.2
|
|
31
|
+
"@prezly/uploads": "^0.3.2",
|
|
31
32
|
"query-string": "^6.14.1"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
@@ -49,22 +50,25 @@
|
|
|
49
50
|
"vitest-fetch-mock": "^0.2.2"
|
|
50
51
|
},
|
|
51
52
|
"scripts": {
|
|
52
|
-
"clean": "rimraf dist
|
|
53
|
-
"
|
|
54
|
-
"build": "
|
|
53
|
+
"clean": "rimraf dist",
|
|
54
|
+
"clean:all": "rimraf dist node_modules",
|
|
55
|
+
"build": "pnpm run build:types && pnpm run build:es && pnpm run build:cjs",
|
|
56
|
+
"build:fresh": "pnpm run clean:all && pnpm install && pnpm run build",
|
|
55
57
|
"build:types": "tsc --project .",
|
|
56
58
|
"build:es": "babel ./src --ignore='**/*.test.ts' --config-file=./babel.config.json --extensions=.ts,.cts --source-root=./src --out-dir=./dist",
|
|
57
59
|
"build:cjs": "babel ./src --ignore='**/*.test.ts' --config-file=./babel.config.cjs.json --extensions=.ts,.cts --source-root=./src --out-dir=./dist --out-file-extension .cjs",
|
|
58
60
|
"watch": "tsc --watch --preserveWatchOutput --project .",
|
|
59
|
-
"start": "
|
|
61
|
+
"start": "pnpm run build --incremental --watch",
|
|
60
62
|
"lint": "biome ci",
|
|
61
63
|
"lint:fix": "biome lint --write",
|
|
62
|
-
"test": "
|
|
64
|
+
"test": "pnpm run test:build && pnpm run test:unit",
|
|
63
65
|
"test:unit": "vitest run",
|
|
64
|
-
"test:build": "node dist/index.js && tsc --noEmit dist/index.d.ts",
|
|
66
|
+
"test:build": "node dist/index.js && tsc --noEmit --types node --target es2015 --skipLibCheck dist/index.d.ts",
|
|
67
|
+
"pack:dry-run": "npm pack --dry-run --json",
|
|
68
|
+
"test:package": "pnpm run build && pnpm run pack:dry-run",
|
|
65
69
|
"format:check": "biome format",
|
|
66
70
|
"format": "biome format --write",
|
|
67
|
-
"prerelease": "
|
|
71
|
+
"prerelease": "pnpm run build",
|
|
68
72
|
"release": "np"
|
|
69
73
|
},
|
|
70
74
|
"np": {
|