@prezly/sdk 24.0.0 → 24.1.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.
Files changed (32) hide show
  1. package/dist/api/ApiClient.d.ts +4 -4
  2. package/dist/api/DeferredJobsApiClient.d.ts +4 -4
  3. package/dist/api/constants.cjs +1 -1
  4. package/dist/api/constants.js +1 -1
  5. package/dist/endpoints/Accounts/Client.d.ts +1 -1
  6. package/dist/endpoints/CampaignRecipients/Client.d.ts +1 -1
  7. package/dist/endpoints/Campaigns/Client.d.ts +8 -8
  8. package/dist/endpoints/ContactTags/Client.d.ts +4 -4
  9. package/dist/endpoints/Contacts/Client.d.ts +6 -6
  10. package/dist/endpoints/ContactsExports/Client.d.ts +2 -2
  11. package/dist/endpoints/CoverageIntegrations/Client.d.ts +3 -3
  12. package/dist/endpoints/CoverageIntegrations/types.cjs +1 -2
  13. package/dist/endpoints/CoverageIntegrations/types.js +1 -2
  14. package/dist/endpoints/NewsroomCategories/Client.d.ts +3 -3
  15. package/dist/endpoints/NewsroomGalleries/Client.d.ts +1 -1
  16. package/dist/endpoints/NewsroomLanguages/Client.d.ts +10 -10
  17. package/dist/endpoints/NewsroomPrivacyRequests/Client.d.ts +2 -2
  18. package/dist/endpoints/NewsroomThemes/Client.d.ts +1 -1
  19. package/dist/endpoints/NewsroomWebhooks/Client.d.ts +3 -3
  20. package/dist/endpoints/SenderAddresses/Client.d.ts +3 -3
  21. package/dist/endpoints/Stories/Client.d.ts +102 -102
  22. package/dist/endpoints/Stories/types.d.ts +4 -2
  23. package/dist/endpoints/Subscriptions/Client.d.ts +2 -2
  24. package/dist/endpoints/index.cjs +1 -2
  25. package/dist/http/lib.cjs +1 -1
  26. package/dist/types/License.d.ts +1 -0
  27. package/dist/types/Newsroom.cjs +8 -0
  28. package/dist/types/Newsroom.d.ts +1 -0
  29. package/dist/types/Newsroom.js +8 -0
  30. package/dist/types/NewsroomTheme.cjs +4 -2
  31. package/dist/types/NewsroomTheme.js +4 -2
  32. package/package.json +1 -1
@@ -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: <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>>;
9
+ post: <V = any>(url: string, { headers, payload, query }?: ParamsWithPayload) => Promise<ApiResponse<V>>;
10
+ put: <V = any>(url: string, { headers, payload, query }?: ParamsWithPayload) => Promise<ApiResponse<V>>;
11
+ patch: <V = any>(url: string, { headers, payload, query }?: ParamsWithPayload) => Promise<ApiResponse<V>>;
12
+ delete: <V = any>(url: string, { headers, payload, query }?: ParamsWithPayload) => Promise<ApiResponse<V>>;
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: <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>;
7
+ post: <V = any, P = any>(url: string, { headers, payload, query }?: ParamsWithPayload) => ProgressPromise<V, P>;
8
+ put: <V = any, P = any>(url: string, { headers, payload, query }?: ParamsWithPayload) => ProgressPromise<V, P>;
9
+ patch: <V = any, P = any>(url: string, { headers, payload, query }?: ParamsWithPayload) => ProgressPromise<V, P>;
10
+ delete: <V = any, P = any>(url: string, { headers, payload, query }?: ParamsWithPayload) => ProgressPromise<V, P>;
11
11
  };
@@ -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 = "23.20.0";
7
+ const VERSION = "24.1.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})`;
@@ -1,3 +1,3 @@
1
- const VERSION = "23.20.0";
1
+ const VERSION = "24.1.0";
2
2
  const URL = 'https://github.com/prezly/javascript-sdk';
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['id'], payload: UpdateRequest) => Promise<UpdateResponse>;
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
- } | undefined) => Promise<RecipientsOperationResponse>;
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['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>;
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['id'], payload: UpdateRequest) => Promise<CampaignResponse>;
19
- delete: (id: Campaign['id']) => Promise<void>;
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['id']) => Promise<ContactTag>;
8
+ get: (id: ContactTag["id"]) => Promise<ContactTag>;
9
9
  create: (payload: CreateRequest, { force }?: CreateOptions) => Promise<CreateResponse>;
10
- update: (id: Contact['id'], payload: UpdateRequest, { force }?: UpdateOptions) => Promise<UpdateResponse>;
10
+ update: (id: Contact["id"], payload: UpdateRequest, { force }?: UpdateOptions) => Promise<UpdateResponse>;
11
11
  merge: ({ name, tags }: MergeRequest) => Promise<MergeResponse>;
12
- delete: (id: ContactTag['id']) => Promise<{
12
+ delete: (id: ContactTag["id"]) => Promise<{
13
13
  deleted: number[];
14
14
  }>;
15
- deleteMany: (ids: ContactTag['id'][]) => Promise<{
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['id']) => Promise<Contact>;
10
- getMany: (ids: Contact['id'][]) => Promise<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['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>;
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['id']) => Promise<void>;
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['uuid']) => Promise<ContactsExport>;
8
+ get: (uuid: ContactsExport["uuid"]) => Promise<ContactsExport>;
9
9
  create: (selector: ContactsBulkSelector) => Promise<ContactsExport>;
10
- download: (uuid: ContactsExport['uuid']) => Promise<{
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['input'];
18
- oldest?: number | undefined;
19
- limit?: number | undefined;
17
+ input: CoverageIntegration["input"];
18
+ oldest?: number;
19
+ limit?: number;
20
20
  }) => Promise<PreviewResponse>;
21
21
  };
22
22
  export {};
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
 
3
- var _index = require("../../types/index.cjs");
4
- var Provider = _index.CoverageEntry.Provider;
3
+ var _index = require("../../types/index.cjs");
@@ -1,2 +1 @@
1
- import { CoverageEntry } from "../../types/index.js";
2
- var Provider = CoverageEntry.Provider;
1
+ import { CoverageEntry } from "../../types/index.js";
@@ -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['id']) => Promise<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['id'], payload: UpdateRequest) => Promise<Category>;
11
- delete: (newsroomId: NewsroomId, categoryId: Category['id']) => Promise<void>;
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['uuid']) => Promise<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['code'], { fallback }?: {
9
- fallback?: boolean | undefined;
8
+ get: (newsroomId: NewsroomId, localeCode: CultureRef["code"], { fallback }?: {
9
+ fallback?: true | false;
10
10
  }) => Promise<NewsroomLanguageSettings>;
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;
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['code'], payload: SettingsUpdateRequest, options?: {
16
- force?: boolean | undefined;
15
+ update: (newsroomId: NewsroomId, localeCode: CultureRef["code"], payload: SettingsUpdateRequest, options?: {
16
+ force?: boolean;
17
17
  }) => Promise<NewsroomLanguageSettings>;
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';
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['uuid'], payload: DeletePrivacyRequestCreateRequest | ExportPrivacyRequestCreateRequest | CorrectPrivacyRequestCreateRequest | OtherPrivacyRequestCreateRequest) => Promise<PrivacyRequest>;
7
- confirm: (newsroomId: Newsroom['uuid'], privacyRequestId: PrivacyRequest['id']) => Promise<PrivacyRequest>;
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['settings']) => Promise<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['id']) => Promise<NewsroomWebhook>;
10
- update: (newsroomId: NewsroomId, webhookId: NewsroomWebhook['id'], payload: UpdateRequest) => Promise<NewsroomWebhook>;
11
- delete: (newsroomId: NewsroomId, webhookId: NewsroomWebhook['id']) => Promise<void>;
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['id']) => Promise<SenderAddress>;
10
- update: (senderId: SenderAddress['id'], payload: UpdateRequest) => Promise<SenderAddress>;
11
- delete: (senderId: SenderAddress['id']) => Promise<void>;
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<keyof Story.ExtraFields>>(options?: Exactly<Options, ListOptions<keyof Story.ExtraFields>> | undefined) => Promise<ListResponse<Story & InferExtraFields<Options>>>;
18
- search: <Options_1 extends SearchOptions<keyof Story.ExtraFields>>(options?: Exactly<Options_1, SearchOptions<keyof Story.ExtraFields>> | undefined) => Promise<ListResponse<Story & InferExtraFields<Options_1>>>;
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
- <Options_2 extends IncludeOptions<keyof Story.ExtraFields> & {
21
- formats?: Formats | undefined;
22
- }>(id: Story['uuid'], options?: Exactly<Options_2, IncludeOptions<keyof Story.ExtraFields> & {
23
- formats?: Formats | undefined;
24
- }> | undefined): Promise<ExtendedStory & InferExtraFields<Options_2>>;
25
- <Options_3 extends IncludeOptions<keyof Story.ExtraFields> & {
26
- formats?: Formats | undefined;
27
- }>(ids: Story['uuid'][], options?: Exactly<Options_3, IncludeOptions<keyof Story.ExtraFields> & {
28
- formats?: Formats | undefined;
29
- }> | undefined): Promise<(ExtendedStory & InferExtraFields<Options_3>)[]>;
30
- <Options_4 extends IncludeOptions<keyof Story.ExtraFields> & {
31
- formats?: Formats | undefined;
32
- }>(id: Story['id'] | Story['uuid'], options?: Exactly<Options_4, IncludeOptions<keyof Story.ExtraFields> & {
33
- formats?: Formats | undefined;
34
- }> | undefined): Promise<ExtendedStory & InferExtraFields<Options_4>>;
35
- <Options_5 extends IncludeOptions<keyof Story.ExtraFields> & {
36
- formats?: Formats | undefined;
37
- }>(ids: Story['id'][], options?: Exactly<Options_5, IncludeOptions<keyof Story.ExtraFields> & {
38
- formats?: Formats | undefined;
39
- }> | undefined): Promise<(ExtendedStory & InferExtraFields<Options_5>)[]>;
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: <Options_6 extends IncludeOptions<keyof Story.ExtraFields> & {
42
- formats?: Formats | undefined;
43
- query?: Query | undefined;
44
- }>(slug: Story['slug'], options?: Exactly<Options_6, IncludeOptions<keyof Story.ExtraFields> & {
45
- formats?: Formats | undefined;
46
- query?: Query | undefined;
47
- }> | undefined) => Promise<ExtendedStory & InferExtraFields<Options_6>>;
48
- create: <Options_7 extends IncludeOptions<keyof Story.ExtraFields> & {
49
- formats?: Formats | undefined;
50
- force?: boolean | undefined;
51
- }>(payload: CreateRequest, options?: Exactly<Options_7, IncludeOptions<keyof Story.ExtraFields> & {
52
- formats?: Formats | undefined;
53
- force?: boolean | undefined;
54
- }> | undefined) => Promise<ExtendedStory & InferExtraFields<Options_7>>;
55
- duplicate: <Options_8 extends IncludeOptions<keyof Story.ExtraFields> & {
56
- formats?: Formats | undefined;
57
- }>(id: StoryId, options?: Exactly<Options_8, IncludeOptions<keyof Story.ExtraFields> & {
58
- formats?: Formats | undefined;
59
- }> | undefined) => Promise<ExtendedStory & InferExtraFields<Options_8>>;
60
- translate: <Options_9 extends IncludeOptions<keyof Story.ExtraFields> & {
61
- formats?: Formats | undefined;
62
- }>(id: StoryId, payload?: TranslateRequest, options?: Exactly<Options_9, IncludeOptions<keyof Story.ExtraFields> & {
63
- formats?: Formats | undefined;
64
- }> | undefined) => Promise<ExtendedStory & InferExtraFields<Options_9>>;
65
- move: <Options_10 extends IncludeOptions<keyof Story.ExtraFields> & {
66
- formats?: Formats | undefined;
67
- force?: boolean | undefined;
68
- }>(id: StoryId, payload: MoveRequest, options?: Exactly<Options_10, IncludeOptions<keyof Story.ExtraFields> & {
69
- formats?: Formats | undefined;
70
- force?: boolean | undefined;
71
- }> | undefined) => Promise<ChangeNewsroomUnsafeResponse | ChangeNewsroomSuccessResponse<ExtendedStory & InferExtraFields<Options_10>>>;
72
- update: <Options_11 extends IncludeOptions<keyof Story.ExtraFields> & {
73
- formats?: Formats | undefined;
74
- force?: boolean | undefined;
75
- }>(id: StoryId, payload: UpdateRequest, options?: Exactly<Options_11, IncludeOptions<keyof Story.ExtraFields> & {
76
- formats?: Formats | undefined;
77
- force?: boolean | undefined;
78
- }> | undefined) => Promise<ExtendedStory & InferExtraFields<Options_11>>;
79
- autosave: <Options_12 extends IncludeOptions<keyof Story.ExtraFields> & {
80
- formats?: Formats | undefined;
81
- }>(id: StoryId, payload: AutosaveRequest, options?: Exactly<Options_12, IncludeOptions<keyof Story.ExtraFields> & {
82
- formats?: Formats | undefined;
83
- }> | undefined) => Promise<ExtendedStory & InferExtraFields<Options_12>>;
84
- revert: <Options_13 extends IncludeOptions<keyof Story.ExtraFields> & {
85
- formats?: Formats | undefined;
86
- }>(id: StoryId, payload?: RevertRequest, options?: Exactly<Options_13, IncludeOptions<keyof Story.ExtraFields> & {
87
- formats?: Formats | undefined;
88
- }> | undefined) => Promise<ExtendedStory & InferExtraFields<Options_13>>;
89
- publish: <Options_14 extends IncludeOptions<keyof Story.ExtraFields> & {
90
- formats?: Formats | undefined;
91
- }>(id: StoryId, payload?: PublishRequest, options?: Exactly<Options_14, IncludeOptions<keyof Story.ExtraFields> & {
92
- formats?: Formats | undefined;
93
- }> | undefined) => Promise<ExtendedStory & InferExtraFields<Options_14>>;
94
- unpublish: <Options_15 extends IncludeOptions<keyof Story.ExtraFields> & {
95
- formats?: Formats | undefined;
96
- }>(id: StoryId, payload?: UnpublishRequest, options?: Exactly<Options_15, IncludeOptions<keyof Story.ExtraFields> & {
97
- formats?: Formats | undefined;
98
- }> | undefined) => Promise<ExtendedStory & InferExtraFields<Options_15>>;
99
- schedule: <Options_16 extends IncludeOptions<keyof Story.ExtraFields> & {
100
- formats?: Formats | undefined;
101
- }>(id: StoryId, payload?: ScheduleRequest, options?: Exactly<Options_16, IncludeOptions<keyof Story.ExtraFields> & {
102
- formats?: Formats | undefined;
103
- }> | undefined) => Promise<ExtendedStory & InferExtraFields<Options_16>>;
104
- unschedule: <Options_17 extends IncludeOptions<keyof Story.ExtraFields> & {
105
- formats?: Formats | undefined;
106
- }>(id: StoryId, payload?: UnscheduleRequest, options?: Exactly<Options_17, IncludeOptions<keyof Story.ExtraFields> & {
107
- formats?: Formats | undefined;
108
- }> | undefined) => Promise<ExtendedStory & InferExtraFields<Options_17>>;
109
- pin: <Options_18 extends IncludeOptions<keyof Story.ExtraFields> & {
110
- formats?: Formats | undefined;
111
- force?: boolean | undefined;
112
- }>(id: StoryId, options?: Exactly<Options_18, IncludeOptions<keyof Story.ExtraFields> & {
113
- formats?: Formats | undefined;
114
- force?: boolean | undefined;
115
- }> | undefined) => Promise<ExtendedStory & InferExtraFields<Options_18>>;
116
- unpin: <Options_19 extends IncludeOptions<keyof Story.ExtraFields> & {
117
- formats?: Formats | undefined;
118
- }>(id: StoryId, options?: Exactly<Options_19, IncludeOptions<keyof Story.ExtraFields> & {
119
- formats?: Formats | undefined;
120
- }> | undefined) => Promise<ExtendedStory & InferExtraFields<Options_19>>;
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
  };
@@ -254,6 +254,8 @@ export interface ChangeNewsroomUnsafeResponse {
254
254
  message: string;
255
255
  warnings: ChangeNewsroomWarning[];
256
256
  }
257
- export declare const ALL_EXTRA_FIELDS: (keyof Story.ExtraFields)[];
258
- 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")[];
257
+ declare const EXTENDED_STORY_INCLUDED_EXTRA_FIELDS_SHAPE: Record<keyof Omit<ExtendedStory, keyof Story>, boolean>;
258
+ declare const ALL_EXTRA_FIELDS_SHAPE: Record<keyof Story.ExtraFields, boolean>;
259
+ export declare const ALL_EXTRA_FIELDS: (keyof typeof ALL_EXTRA_FIELDS_SHAPE)[];
260
+ export declare const EXTENDED_STORY_INCLUDED_EXTRA_FIELDS: (keyof typeof EXTENDED_STORY_INCLUDED_EXTRA_FIELDS_SHAPE)[];
259
261
  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['id'], payload: UpdateUnsubscribeDetailsRequest) => Promise<EmailSubscription>;
11
- updateLicenseUnsubscribeDetails: (subscriptionId: EmailSubscription['id'], payload: UpdateUnsubscribeDetailsRequest) => Promise<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 {};
@@ -62,5 +62,4 @@ var _Subscriptions = _interopRequireWildcard(require("./Subscriptions/index.cjs"
62
62
  exports.Subscriptions = _Subscriptions;
63
63
  var _NotificationSubscriptions = _interopRequireWildcard(require("./NotificationSubscriptions/index.cjs"));
64
64
  exports.NotificationSubscriptions = _NotificationSubscriptions;
65
- 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); }
66
- 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 && Object.prototype.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; }
65
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
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(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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'
@@ -44,6 +44,7 @@ export interface License extends LicenseRef {
44
44
  * At the end of this period, a new invoice will be created.
45
45
  */
46
46
  current_period_end: string | null;
47
+ demo_at: string | null;
47
48
  demo_content_created_at: string | null;
48
49
  demo_content_deleted_at: string | null;
49
50
  display_name: string;
@@ -8,7 +8,9 @@ let Newsroom = exports.Newsroom = void 0;
8
8
  (function (_Newsroom) {
9
9
  let Status = /*#__PURE__*/function (Status) {
10
10
  Status["ACTIVE"] = "active";
11
+ // i.e. "Live"
11
12
  Status["INACTIVE"] = "inactive";
13
+ // i.e. "Not live"
12
14
  Status["ARCHIVED"] = "archived";
13
15
  return Status;
14
16
  }({});
@@ -20,8 +22,14 @@ let Newsroom = exports.Newsroom = void 0;
20
22
  }({});
21
23
  _Newsroom.EmailBrandingMode = EmailBrandingMode;
22
24
  let TrackingPolicy = /*#__PURE__*/function (TrackingPolicy) {
25
+ /**
26
+ * @deprecated Please use `NORMAL` instead.
27
+ */
23
28
  TrackingPolicy["DEFAULT"] = "default";
24
29
  TrackingPolicy["DISABLED"] = "disabled";
30
+ /**
31
+ * @deprecated Please use `STRICT` instead.
32
+ */
25
33
  TrackingPolicy["CONSENT_TO_IDENTIFY"] = "consent-to-identify";
26
34
  TrackingPolicy["STRICT"] = "strict";
27
35
  TrackingPolicy["NORMAL"] = "normal";
@@ -68,6 +68,7 @@ export interface NewsroomRef {
68
68
  widget_settings: string;
69
69
  };
70
70
  active_theme?: NewroomThemeRef | null;
71
+ is_auto_created: boolean;
71
72
  }
72
73
  export interface Newsroom extends NewsroomRef {
73
74
  domain: string;
@@ -2,7 +2,9 @@ export let Newsroom;
2
2
  (function (_Newsroom) {
3
3
  let Status = /*#__PURE__*/function (Status) {
4
4
  Status["ACTIVE"] = "active";
5
+ // i.e. "Live"
5
6
  Status["INACTIVE"] = "inactive";
7
+ // i.e. "Not live"
6
8
  Status["ARCHIVED"] = "archived";
7
9
  return Status;
8
10
  }({});
@@ -14,8 +16,14 @@ export let Newsroom;
14
16
  }({});
15
17
  _Newsroom.EmailBrandingMode = EmailBrandingMode;
16
18
  let TrackingPolicy = /*#__PURE__*/function (TrackingPolicy) {
19
+ /**
20
+ * @deprecated Please use `NORMAL` instead.
21
+ */
17
22
  TrackingPolicy["DEFAULT"] = "default";
18
23
  TrackingPolicy["DISABLED"] = "disabled";
24
+ /**
25
+ * @deprecated Please use `STRICT` instead.
26
+ */
19
27
  TrackingPolicy["CONSENT_TO_IDENTIFY"] = "consent-to-identify";
20
28
  TrackingPolicy["STRICT"] = "strict";
21
29
  TrackingPolicy["NORMAL"] = "normal";
@@ -27,10 +27,12 @@ let NewsroomTheme = exports.NewsroomTheme = void 0;
27
27
  Feature["TITLE_FORMATTING"] = "title_formatting";
28
28
  Feature["CTA_BUTTONS"] = "cta_buttons";
29
29
  Feature["VIDEO_LAYOUT"] = "video_layout";
30
+ // DEV-7588
30
31
  Feature["EMBED_LAYOUT"] = "embed_layout";
31
- Feature["STRICT_TRACKING_POLICY"] = "strict_tracking_policy";
32
+ // DEV-11475
33
+ Feature["STRICT_TRACKING_POLICY"] = "strict_tracking_policy"; // DEV-19123
32
34
  return Feature;
33
- }({}); // DEV-19123
35
+ }({});
34
36
  _NewsroomTheme.Feature = Feature;
35
37
  function isFeatureSupported(theme, feature) {
36
38
  return theme.features.includes(feature);
@@ -21,10 +21,12 @@ export let NewsroomTheme;
21
21
  Feature["TITLE_FORMATTING"] = "title_formatting";
22
22
  Feature["CTA_BUTTONS"] = "cta_buttons";
23
23
  Feature["VIDEO_LAYOUT"] = "video_layout";
24
+ // DEV-7588
24
25
  Feature["EMBED_LAYOUT"] = "embed_layout";
25
- Feature["STRICT_TRACKING_POLICY"] = "strict_tracking_policy";
26
+ // DEV-11475
27
+ Feature["STRICT_TRACKING_POLICY"] = "strict_tracking_policy"; // DEV-19123
26
28
  return Feature;
27
- }({}); // DEV-19123
29
+ }({});
28
30
  _NewsroomTheme.Feature = Feature;
29
31
  function isFeatureSupported(theme, feature) {
30
32
  return theme.features.includes(feature);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prezly/sdk",
3
- "version": "24.0.0",
3
+ "version": "24.1.1",
4
4
  "description": "Prezly API SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",