@prezly/sdk 21.10.1 → 21.12.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/api/ApiClient.d.ts +4 -4
- package/dist/api/DeferredJobsApiClient.d.ts +4 -4
- package/dist/api/constants.cjs +1 -1
- package/dist/api/constants.js +1 -1
- 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/Contacts/types.d.ts +2 -0
- package/dist/endpoints/ContactsExports/Client.d.ts +2 -2
- 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/NewsroomPrivacyRequests/Client.d.ts +2 -2
- package/dist/endpoints/NewsroomThemes/Client.d.ts +1 -1
- package/dist/endpoints/NewsroomWebhooks/Client.d.ts +3 -3
- package/dist/endpoints/SenderAddresses/Client.d.ts +3 -3
- package/dist/endpoints/Stories/Client.d.ts +102 -102
- package/dist/endpoints/Stories/types.cjs +8 -4
- package/dist/endpoints/Stories/types.d.ts +10 -5
- package/dist/endpoints/Stories/types.js +3 -3
- package/dist/endpoints/Subscriptions/Client.d.ts +2 -2
- package/dist/endpoints/index.cjs +1 -1
- package/dist/http/lib.cjs +1 -1
- package/dist/types/Contact.d.ts +1 -0
- package/dist/types/Story.cjs +1 -5
- package/dist/types/Story.d.ts +4 -1
- package/dist/types/Story.js +1 -5
- package/package.json +1 -1
package/dist/api/ApiClient.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ export interface Options {
|
|
|
7
7
|
export type ApiClient = ReturnType<typeof createApiClient>;
|
|
8
8
|
export declare function createApiClient(http: HttpClient, { accessToken, baseUrl, headers }: Options): {
|
|
9
9
|
get: <V = any>(endpointUri: string, { headers, query }?: Params) => Promise<ApiResponse<V>>;
|
|
10
|
-
post: <
|
|
11
|
-
put: <
|
|
12
|
-
patch: <
|
|
13
|
-
delete: <
|
|
10
|
+
post: <V = any>(endpointUri: string, { headers, payload, query }?: ParamsWithPayload) => Promise<ApiResponse<V>>;
|
|
11
|
+
put: <V = any>(endpointUri: string, { headers, payload, query }?: ParamsWithPayload) => Promise<ApiResponse<V>>;
|
|
12
|
+
patch: <V = any>(endpointUri: string, { headers, payload, query }?: ParamsWithPayload) => Promise<ApiResponse<V>>;
|
|
13
|
+
delete: <V = any>(endpointUri: string, { headers, payload, query }?: ParamsWithPayload) => Promise<ApiResponse<V>>;
|
|
14
14
|
};
|
|
@@ -4,8 +4,8 @@ import type { ApiClient } from './ApiClient';
|
|
|
4
4
|
export type DeferredJobsApiClient = ReturnType<typeof createDeferredJobsApiClient>;
|
|
5
5
|
export declare function createDeferredJobsApiClient(http: HttpClient, api: ApiClient): {
|
|
6
6
|
get: <V = any, P = any>(endpointUri: string, { headers, query }?: Params) => ProgressPromise<V, P>;
|
|
7
|
-
post: <
|
|
8
|
-
put: <
|
|
9
|
-
patch: <
|
|
10
|
-
delete: <
|
|
7
|
+
post: <V = any, P = any>(endpointUri: string, { headers, payload, query }?: ParamsWithPayload) => ProgressPromise<V, P>;
|
|
8
|
+
put: <V = any, P = any>(endpointUri: string, { headers, payload, query }?: ParamsWithPayload) => ProgressPromise<V, P>;
|
|
9
|
+
patch: <V = any, P = any>(endpointUri: string, { headers, payload, query }?: ParamsWithPayload) => ProgressPromise<V, P>;
|
|
10
|
+
delete: <V = any, P = any>(endpointUri: string, { headers, payload, query }?: ParamsWithPayload) => ProgressPromise<V, P>;
|
|
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 = "21.
|
|
7
|
+
const VERSION = "21.11.0";
|
|
8
8
|
const URL = 'https://github.com/prezly/javascript-sdk';
|
|
9
9
|
const DEFAULT_USER_AGENT = exports.DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
|
package/dist/api/constants.js
CHANGED
|
@@ -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
|
-
}
|
|
25
|
+
}) => Promise<RecipientsOperationResponse>;
|
|
26
26
|
};
|
|
27
27
|
export {};
|
|
@@ -6,15 +6,15 @@ 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"]) => 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
|
};
|
|
@@ -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
|
};
|
|
@@ -41,10 +41,12 @@ interface BaseContactPayload {
|
|
|
41
41
|
}
|
|
42
42
|
export interface OrganisationUpdateRequest extends BaseContactPayload {
|
|
43
43
|
company_name?: string;
|
|
44
|
+
domain?: string | null;
|
|
44
45
|
}
|
|
45
46
|
export interface OrganisationCreateRequest extends BaseContactPayload {
|
|
46
47
|
contact_type: `${Contact.Type.ORGANISATION}`;
|
|
47
48
|
company_name: string;
|
|
49
|
+
domain?: string | null;
|
|
48
50
|
}
|
|
49
51
|
export interface PersonUpdateRequest extends BaseContactPayload {
|
|
50
52
|
first_name?: string;
|
|
@@ -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
|
};
|
|
@@ -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?: true | false;
|
|
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?: CultureRef["code"];
|
|
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;
|
|
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
|
};
|
|
@@ -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,7 +4,7 @@ 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[]>;
|
|
@@ -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 {};
|
|
@@ -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
|
};
|
|
@@ -14,110 +14,110 @@ type Exactly<Concrete, Abstract> = Concrete & Record<Exclude<keyof Concrete, key
|
|
|
14
14
|
type InferExtraFields<T> = T extends Required<IncludeOptions<infer I>> ? Pick<Story.ExtraFields, I> : unknown;
|
|
15
15
|
export type Client = ReturnType<typeof createClient>;
|
|
16
16
|
export declare function createClient(api: DeferredJobsApiClient): {
|
|
17
|
-
list: <Options extends ListOptions
|
|
18
|
-
search: <
|
|
17
|
+
list: <Options extends ListOptions>(options?: Exactly<Options, ListOptions>) => Promise<ListResponse<Story & InferExtraFields<Options>>>;
|
|
18
|
+
search: <Options extends SearchOptions>(options?: Exactly<Options, SearchOptions>) => Promise<ListResponse<Story & InferExtraFields<Options>>>;
|
|
19
19
|
get: {
|
|
20
|
-
<
|
|
21
|
-
formats?: Formats
|
|
22
|
-
}>(id: Story[
|
|
23
|
-
formats?: Formats
|
|
24
|
-
}>
|
|
25
|
-
<
|
|
26
|
-
formats?: Formats
|
|
27
|
-
}>(ids: Story[
|
|
28
|
-
formats?: Formats
|
|
29
|
-
}>
|
|
30
|
-
<
|
|
31
|
-
formats?: Formats
|
|
32
|
-
}>(id: Story[
|
|
33
|
-
formats?: Formats
|
|
34
|
-
}>
|
|
35
|
-
<
|
|
36
|
-
formats?: Formats
|
|
37
|
-
}>(ids: Story[
|
|
38
|
-
formats?: Formats
|
|
39
|
-
}>
|
|
20
|
+
<Options extends IncludeOptions & {
|
|
21
|
+
formats?: Formats;
|
|
22
|
+
}>(id: Story["uuid"], options?: Exactly<Options, IncludeOptions & {
|
|
23
|
+
formats?: Formats;
|
|
24
|
+
}>): Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
25
|
+
<Options extends IncludeOptions & {
|
|
26
|
+
formats?: Formats;
|
|
27
|
+
}>(ids: Story["uuid"][], options?: Exactly<Options, IncludeOptions & {
|
|
28
|
+
formats?: Formats;
|
|
29
|
+
}>): Promise<(ExtendedStory & InferExtraFields<Options>)[]>;
|
|
30
|
+
<Options extends IncludeOptions & {
|
|
31
|
+
formats?: Formats;
|
|
32
|
+
}>(id: Story["id"] | Story["uuid"], options?: Exactly<Options, IncludeOptions & {
|
|
33
|
+
formats?: Formats;
|
|
34
|
+
}>): Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
35
|
+
<Options extends IncludeOptions & {
|
|
36
|
+
formats?: Formats;
|
|
37
|
+
}>(ids: Story["id"][], options?: Exactly<Options, IncludeOptions & {
|
|
38
|
+
formats?: Formats;
|
|
39
|
+
}>): Promise<(ExtendedStory & InferExtraFields<Options>)[]>;
|
|
40
40
|
};
|
|
41
|
-
getBySlug: <
|
|
42
|
-
formats?: Formats
|
|
43
|
-
query?: Query
|
|
44
|
-
}>(slug: Story[
|
|
45
|
-
formats?: Formats
|
|
46
|
-
query?: Query
|
|
47
|
-
}>
|
|
48
|
-
create: <
|
|
49
|
-
formats?: Formats
|
|
50
|
-
force?: boolean
|
|
51
|
-
}>(payload: CreateRequest, options?: Exactly<
|
|
52
|
-
formats?: Formats
|
|
53
|
-
force?: boolean
|
|
54
|
-
}>
|
|
55
|
-
duplicate: <
|
|
56
|
-
formats?: Formats
|
|
57
|
-
}>(id: StoryId, options?: Exactly<
|
|
58
|
-
formats?: Formats
|
|
59
|
-
}>
|
|
60
|
-
translate: <
|
|
61
|
-
formats?: Formats
|
|
62
|
-
}>(id: StoryId, payload?: TranslateRequest, options?: Exactly<
|
|
63
|
-
formats?: Formats
|
|
64
|
-
}>
|
|
65
|
-
move: <
|
|
66
|
-
formats?: Formats
|
|
67
|
-
force?: boolean
|
|
68
|
-
}>(id: StoryId, payload: MoveRequest, options?: Exactly<
|
|
69
|
-
formats?: Formats
|
|
70
|
-
force?: boolean
|
|
71
|
-
}>
|
|
72
|
-
update: <
|
|
73
|
-
formats?: Formats
|
|
74
|
-
force?: boolean
|
|
75
|
-
}>(id: StoryId, payload: UpdateRequest, options?: Exactly<
|
|
76
|
-
formats?: Formats
|
|
77
|
-
force?: boolean
|
|
78
|
-
}>
|
|
79
|
-
autosave: <
|
|
80
|
-
formats?: Formats
|
|
81
|
-
}>(id: StoryId, payload: AutosaveRequest, options?: Exactly<
|
|
82
|
-
formats?: Formats
|
|
83
|
-
}>
|
|
84
|
-
revert: <
|
|
85
|
-
formats?: Formats
|
|
86
|
-
}>(id: StoryId, payload?: RevertRequest, options?: Exactly<
|
|
87
|
-
formats?: Formats
|
|
88
|
-
}>
|
|
89
|
-
publish: <
|
|
90
|
-
formats?: Formats
|
|
91
|
-
}>(id: StoryId, payload?: PublishRequest, options?: Exactly<
|
|
92
|
-
formats?: Formats
|
|
93
|
-
}>
|
|
94
|
-
unpublish: <
|
|
95
|
-
formats?: Formats
|
|
96
|
-
}>(id: StoryId, payload?: UnpublishRequest, options?: Exactly<
|
|
97
|
-
formats?: Formats
|
|
98
|
-
}>
|
|
99
|
-
schedule: <
|
|
100
|
-
formats?: Formats
|
|
101
|
-
}>(id: StoryId, payload?: ScheduleRequest, options?: Exactly<
|
|
102
|
-
formats?: Formats
|
|
103
|
-
}>
|
|
104
|
-
unschedule: <
|
|
105
|
-
formats?: Formats
|
|
106
|
-
}>(id: StoryId, payload?: UnscheduleRequest, options?: Exactly<
|
|
107
|
-
formats?: Formats
|
|
108
|
-
}>
|
|
109
|
-
pin: <
|
|
110
|
-
formats?: Formats
|
|
111
|
-
force?: boolean
|
|
112
|
-
}>(id: StoryId, options?: Exactly<
|
|
113
|
-
formats?: Formats
|
|
114
|
-
force?: boolean
|
|
115
|
-
}>
|
|
116
|
-
unpin: <
|
|
117
|
-
formats?: Formats
|
|
118
|
-
}>(id: StoryId, options?: Exactly<
|
|
119
|
-
formats?: Formats
|
|
120
|
-
}>
|
|
41
|
+
getBySlug: <Options extends IncludeOptions & {
|
|
42
|
+
formats?: Formats;
|
|
43
|
+
query?: Query;
|
|
44
|
+
}>(slug: Story["slug"], options?: Exactly<Options, IncludeOptions & {
|
|
45
|
+
formats?: Formats;
|
|
46
|
+
query?: Query;
|
|
47
|
+
}>) => Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
48
|
+
create: <Options extends IncludeOptions & {
|
|
49
|
+
formats?: Formats;
|
|
50
|
+
force?: boolean;
|
|
51
|
+
}>(payload: CreateRequest, options?: Exactly<Options, IncludeOptions & {
|
|
52
|
+
formats?: Formats;
|
|
53
|
+
force?: boolean;
|
|
54
|
+
}>) => Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
55
|
+
duplicate: <Options extends IncludeOptions & {
|
|
56
|
+
formats?: Formats;
|
|
57
|
+
}>(id: StoryId, options?: Exactly<Options, IncludeOptions & {
|
|
58
|
+
formats?: Formats;
|
|
59
|
+
}>) => Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
60
|
+
translate: <Options extends IncludeOptions & {
|
|
61
|
+
formats?: Formats;
|
|
62
|
+
}>(id: StoryId, payload?: TranslateRequest, options?: Exactly<Options, IncludeOptions & {
|
|
63
|
+
formats?: Formats;
|
|
64
|
+
}>) => Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
65
|
+
move: <Options extends IncludeOptions & {
|
|
66
|
+
formats?: Formats;
|
|
67
|
+
force?: boolean;
|
|
68
|
+
}>(id: StoryId, payload: MoveRequest, options?: Exactly<Options, IncludeOptions & {
|
|
69
|
+
formats?: Formats;
|
|
70
|
+
force?: boolean;
|
|
71
|
+
}>) => Promise<ChangeNewsroomSuccessResponse<ExtendedStory & InferExtraFields<Options>> | ChangeNewsroomUnsafeResponse>;
|
|
72
|
+
update: <Options extends IncludeOptions & {
|
|
73
|
+
formats?: Formats;
|
|
74
|
+
force?: boolean;
|
|
75
|
+
}>(id: StoryId, payload: UpdateRequest, options?: Exactly<Options, IncludeOptions & {
|
|
76
|
+
formats?: Formats;
|
|
77
|
+
force?: boolean;
|
|
78
|
+
}>) => Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
79
|
+
autosave: <Options extends IncludeOptions & {
|
|
80
|
+
formats?: Formats;
|
|
81
|
+
}>(id: StoryId, payload: AutosaveRequest, options?: Exactly<Options, IncludeOptions & {
|
|
82
|
+
formats?: Formats;
|
|
83
|
+
}>) => Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
84
|
+
revert: <Options extends IncludeOptions & {
|
|
85
|
+
formats?: Formats;
|
|
86
|
+
}>(id: StoryId, payload?: RevertRequest, options?: Exactly<Options, IncludeOptions & {
|
|
87
|
+
formats?: Formats;
|
|
88
|
+
}>) => Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
89
|
+
publish: <Options extends IncludeOptions & {
|
|
90
|
+
formats?: Formats;
|
|
91
|
+
}>(id: StoryId, payload?: PublishRequest, options?: Exactly<Options, IncludeOptions & {
|
|
92
|
+
formats?: Formats;
|
|
93
|
+
}>) => Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
94
|
+
unpublish: <Options extends IncludeOptions & {
|
|
95
|
+
formats?: Formats;
|
|
96
|
+
}>(id: StoryId, payload?: UnpublishRequest, options?: Exactly<Options, IncludeOptions & {
|
|
97
|
+
formats?: Formats;
|
|
98
|
+
}>) => Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
99
|
+
schedule: <Options extends IncludeOptions & {
|
|
100
|
+
formats?: Formats;
|
|
101
|
+
}>(id: StoryId, payload?: ScheduleRequest, options?: Exactly<Options, IncludeOptions & {
|
|
102
|
+
formats?: Formats;
|
|
103
|
+
}>) => Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
104
|
+
unschedule: <Options extends IncludeOptions & {
|
|
105
|
+
formats?: Formats;
|
|
106
|
+
}>(id: StoryId, payload?: UnscheduleRequest, options?: Exactly<Options, IncludeOptions & {
|
|
107
|
+
formats?: Formats;
|
|
108
|
+
}>) => Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
109
|
+
pin: <Options extends IncludeOptions & {
|
|
110
|
+
formats?: Formats;
|
|
111
|
+
force?: boolean;
|
|
112
|
+
}>(id: StoryId, options?: Exactly<Options, IncludeOptions & {
|
|
113
|
+
formats?: Formats;
|
|
114
|
+
force?: boolean;
|
|
115
|
+
}>) => Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
116
|
+
unpin: <Options extends IncludeOptions & {
|
|
117
|
+
formats?: Formats;
|
|
118
|
+
}>(id: StoryId, options?: Exactly<Options, IncludeOptions & {
|
|
119
|
+
formats?: Formats;
|
|
120
|
+
}>) => Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
121
121
|
delete: (id: StoryId) => Promise<void>;
|
|
122
122
|
preview: (id: StoryId, options?: PreviewOptions) => Promise<PreviewResponse>;
|
|
123
123
|
};
|
|
@@ -3,23 +3,27 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.EXTENDED_STORY_INCLUDED_EXTRA_FIELDS = exports.ALL_EXTRA_FIELDS = void 0;
|
|
6
|
+
exports.HeaderFooter = exports.EXTENDED_STORY_INCLUDED_EXTRA_FIELDS = exports.Appearance = exports.Alignment = exports.ALL_EXTRA_FIELDS = void 0;
|
|
7
7
|
var _index = require("../../types/index.cjs");
|
|
8
8
|
/**
|
|
9
9
|
* Uploadcare image JSON string.
|
|
10
10
|
*/
|
|
11
|
+
|
|
11
12
|
/**
|
|
12
13
|
* Raw HTML string.
|
|
13
14
|
*/
|
|
15
|
+
|
|
14
16
|
/**
|
|
15
17
|
* String-serialized JSON object.
|
|
16
18
|
*/
|
|
19
|
+
|
|
17
20
|
/**
|
|
18
21
|
* String containing Prezly Content Format JSON structure.
|
|
19
22
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
|
|
24
|
+
const Alignment = exports.Alignment = _index.Campaign.StoryAlignment;
|
|
25
|
+
const Appearance = exports.Appearance = _index.Campaign.StoryAppearance;
|
|
26
|
+
const HeaderFooter = exports.HeaderFooter = _index.Campaign.StoryHeaderFooter;
|
|
23
27
|
const EXTENDED_STORY_INCLUDED_EXTRA_FIELDS_SHAPE = {
|
|
24
28
|
thumbnail_image: true,
|
|
25
29
|
header_image: true,
|
|
@@ -210,9 +210,12 @@ export interface PreviewOptions {
|
|
|
210
210
|
appearance?: Appearance;
|
|
211
211
|
headerFooter?: HeaderFooter;
|
|
212
212
|
}
|
|
213
|
-
export
|
|
214
|
-
export
|
|
215
|
-
export
|
|
213
|
+
export declare const Alignment: typeof Campaign.StoryAlignment;
|
|
214
|
+
export type Alignment = Campaign.StoryAlignment;
|
|
215
|
+
export declare const Appearance: typeof Campaign.StoryAppearance;
|
|
216
|
+
export type Appearance = Campaign.StoryAppearance;
|
|
217
|
+
export declare const HeaderFooter: typeof Campaign.StoryHeaderFooter;
|
|
218
|
+
export type HeaderFooter = Campaign.StoryHeaderFooter;
|
|
216
219
|
export type CreateRequest = HtmlStoryCreateRequest | SlateV3StoryCreateRequest | SlateV4StoryCreateRequest | SlateV5StoryCreateRequest;
|
|
217
220
|
export type UpdateRequest = HtmlStoryUpdateRequest | SlateV3StoryUpdateRequest | SlateV4StoryUpdateRequest | SlateV5StoryUpdateRequest;
|
|
218
221
|
export interface AutosaveRequest {
|
|
@@ -250,6 +253,8 @@ export interface ChangeNewsroomUnsafeResponse {
|
|
|
250
253
|
message: string;
|
|
251
254
|
warnings: ChangeNewsroomWarning[];
|
|
252
255
|
}
|
|
253
|
-
|
|
254
|
-
|
|
256
|
+
declare const EXTENDED_STORY_INCLUDED_EXTRA_FIELDS_SHAPE: Record<keyof Omit<ExtendedStory, keyof Story>, boolean>;
|
|
257
|
+
declare const ALL_EXTRA_FIELDS_SHAPE: Record<keyof Story.ExtraFields, boolean>;
|
|
258
|
+
export declare const ALL_EXTRA_FIELDS: (keyof typeof ALL_EXTRA_FIELDS_SHAPE)[];
|
|
259
|
+
export declare const EXTENDED_STORY_INCLUDED_EXTRA_FIELDS: (keyof typeof EXTENDED_STORY_INCLUDED_EXTRA_FIELDS_SHAPE)[];
|
|
255
260
|
export {};
|
|
@@ -11,9 +11,9 @@ import { Campaign } from "../../types/index.js";
|
|
|
11
11
|
/**
|
|
12
12
|
* String containing Prezly Content Format JSON structure.
|
|
13
13
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
export const Alignment = Campaign.StoryAlignment;
|
|
15
|
+
export const Appearance = Campaign.StoryAppearance;
|
|
16
|
+
export const HeaderFooter = Campaign.StoryHeaderFooter;
|
|
17
17
|
const EXTENDED_STORY_INCLUDED_EXTRA_FIELDS_SHAPE = {
|
|
18
18
|
thumbnail_image: true,
|
|
19
19
|
header_image: true,
|
|
@@ -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/endpoints/index.cjs
CHANGED
|
@@ -61,4 +61,4 @@ exports.Subscriptions = _Subscriptions;
|
|
|
61
61
|
var _NotificationSubscriptions = _interopRequireWildcard(require("./NotificationSubscriptions/index.cjs"));
|
|
62
62
|
exports.NotificationSubscriptions = _NotificationSubscriptions;
|
|
63
63
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
64
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
64
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
package/dist/http/lib.cjs
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.createUrlWithQuery = createUrlWithQuery;
|
|
7
7
|
exports.isDeferredJobResponse = isDeferredJobResponse;
|
|
8
8
|
var _queryString = _interopRequireDefault(require("query-string"));
|
|
9
|
-
function _interopRequireDefault(
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
function parseUrlParams(query) {
|
|
11
11
|
return _queryString.default.parse(query, {
|
|
12
12
|
arrayFormat: 'bracket'
|
package/dist/types/Contact.d.ts
CHANGED
package/dist/types/Story.cjs
CHANGED
|
@@ -25,11 +25,7 @@ let Story = exports.Story = void 0;
|
|
|
25
25
|
return Status;
|
|
26
26
|
}({});
|
|
27
27
|
_Story.Status = Status;
|
|
28
|
-
|
|
29
|
-
* @deprecated Please use `Status` instead.
|
|
30
|
-
* @see Status
|
|
31
|
-
*/
|
|
32
|
-
var LifecycleStatus = Status;
|
|
28
|
+
const LifecycleStatus = _Story.LifecycleStatus = Status;
|
|
33
29
|
/**
|
|
34
30
|
* @deprecated Please use `Status` instead.
|
|
35
31
|
* @see Status
|
package/dist/types/Story.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Category } from './Category';
|
|
2
2
|
import type { OEmbedInfo } from './common';
|
|
3
|
+
import type { CoverageEntry } from './CoverageEntry';
|
|
3
4
|
import type { CultureRef } from './Culture';
|
|
4
5
|
import { type NewsroomRef } from './Newsroom';
|
|
5
6
|
import type { SEOSettings } from './SEOSettings';
|
|
@@ -167,7 +168,8 @@ export declare namespace Story {
|
|
|
167
168
|
* @deprecated Please use `Status` instead.
|
|
168
169
|
* @see Status
|
|
169
170
|
*/
|
|
170
|
-
|
|
171
|
+
const LifecycleStatus: typeof Status;
|
|
172
|
+
type LifecycleStatus = Status;
|
|
171
173
|
/**
|
|
172
174
|
* @deprecated Please use `Status` instead.
|
|
173
175
|
* @see Status
|
|
@@ -248,6 +250,7 @@ export declare namespace Story {
|
|
|
248
250
|
attached_contacts_content: Json | null;
|
|
249
251
|
referenced_entities: {
|
|
250
252
|
stories: Record<string, OEmbedInfo>;
|
|
253
|
+
coverages: Record<number, CoverageEntry>;
|
|
251
254
|
};
|
|
252
255
|
/**
|
|
253
256
|
* Number of campaigns linked to this story.
|
package/dist/types/Story.js
CHANGED
|
@@ -19,11 +19,7 @@ export let Story;
|
|
|
19
19
|
return Status;
|
|
20
20
|
}({});
|
|
21
21
|
_Story.Status = Status;
|
|
22
|
-
|
|
23
|
-
* @deprecated Please use `Status` instead.
|
|
24
|
-
* @see Status
|
|
25
|
-
*/
|
|
26
|
-
var LifecycleStatus = Status;
|
|
22
|
+
const LifecycleStatus = _Story.LifecycleStatus = Status;
|
|
27
23
|
/**
|
|
28
24
|
* @deprecated Please use `Status` instead.
|
|
29
25
|
* @see Status
|