@prezly/sdk 19.6.2 → 19.7.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/Client.cjs CHANGED
@@ -43,6 +43,7 @@ function createClient({
43
43
  newsroomDomains: new _index2.NewsroomDomains.Client(apiClient),
44
44
  newsroomGalleries: new _index2.NewsroomGalleries.Client(apiClient),
45
45
  newsroomHub: new _index2.NewsroomHub.Client(apiClient),
46
+ newsroomSubscriptions: new _index2.NewsroomSubscriptions.Client(apiClient),
46
47
  pricingTables: new _index2.PricingTables.Client(apiClient),
47
48
  senderAddresses: new _index2.SenderAddresses.Client(apiClient),
48
49
  stories: new _index2.Stories.Client(apiClient),
package/dist/Client.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DeferredJobsApiClient, type Fetch } from './api';
2
2
  import { Contacts } from './endpoints';
3
- import { Accounts, Billing, Campaigns, CampaignRecipients, ContactsExports, Coverage, Jobs, Licenses, Newsrooms, NewsroomCategories, NewsroomContacts, NewsroomLanguages, NewsroomThemes, NewsroomWebhooks, NewsroomPrivacyRequests, NewsroomDomains, NewsroomGalleries, NewsroomHub, PricingTables, SenderAddresses, Stories, Snippets, Subscriptions, NotificationSubscriptions } from './endpoints';
3
+ import { Accounts, Billing, NewsroomSubscriptions, Campaigns, CampaignRecipients, ContactsExports, Coverage, Jobs, Licenses, Newsrooms, NewsroomCategories, NewsroomContacts, NewsroomLanguages, NewsroomThemes, NewsroomWebhooks, NewsroomPrivacyRequests, NewsroomDomains, NewsroomGalleries, NewsroomHub, PricingTables, SenderAddresses, Stories, Snippets, Subscriptions, NotificationSubscriptions } from './endpoints';
4
4
  import type { HeadersMap } from './http';
5
5
  export interface ClientOptions {
6
6
  accessToken: string;
@@ -29,6 +29,7 @@ export interface Client {
29
29
  newsroomDomains: NewsroomDomains.Client;
30
30
  newsroomGalleries: NewsroomGalleries.Client;
31
31
  newsroomHub: NewsroomHub.Client;
32
+ newsroomSubscriptions: NewsroomSubscriptions.Client;
32
33
  pricingTables: PricingTables.Client;
33
34
  senderAddresses: SenderAddresses.Client;
34
35
  stories: Stories.Client;
package/dist/Client.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ApiClient, DeferredJobsApiClient } from "./api/index.js";
2
2
  import { Contacts } from "./endpoints/index.js";
3
- import { Accounts, Billing, Campaigns, CampaignRecipients, ContactsExports, Coverage, Jobs, Licenses, Newsrooms, NewsroomCategories, NewsroomContacts, NewsroomLanguages, NewsroomThemes, NewsroomWebhooks, NewsroomPrivacyRequests, NewsroomDomains, NewsroomGalleries, NewsroomHub, PricingTables, SenderAddresses, Stories, Snippets, Subscriptions, NotificationSubscriptions } from "./endpoints/index.js";
3
+ import { Accounts, Billing, NewsroomSubscriptions, Campaigns, CampaignRecipients, ContactsExports, Coverage, Jobs, Licenses, Newsrooms, NewsroomCategories, NewsroomContacts, NewsroomLanguages, NewsroomThemes, NewsroomWebhooks, NewsroomPrivacyRequests, NewsroomDomains, NewsroomGalleries, NewsroomHub, PricingTables, SenderAddresses, Stories, Snippets, Subscriptions, NotificationSubscriptions } from "./endpoints/index.js";
4
4
  import { createHttpClient } from "./http/index.js";
5
5
  const DEFAULT_BASE_URL = 'https://api.prezly.com';
6
6
  export function createClient({
@@ -38,6 +38,7 @@ export function createClient({
38
38
  newsroomDomains: new NewsroomDomains.Client(apiClient),
39
39
  newsroomGalleries: new NewsroomGalleries.Client(apiClient),
40
40
  newsroomHub: new NewsroomHub.Client(apiClient),
41
+ newsroomSubscriptions: new NewsroomSubscriptions.Client(apiClient),
41
42
  pricingTables: new PricingTables.Client(apiClient),
42
43
  senderAddresses: new SenderAddresses.Client(apiClient),
43
44
  stories: new Stories.Client(apiClient),
@@ -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 = "19.6.1";
7
+ const VERSION = "19.7.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 = "19.6.1";
1
+ const VERSION = "19.7.0";
2
2
  const URL = 'https://github.com/prezly/javascript-sdk';
3
3
  export const DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
@@ -6,13 +6,14 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.Client = void 0;
7
7
  var _routing = require("../../routing.cjs");
8
8
  var _index = require("../../types/index.cjs");
9
- /**
10
- * @deprecated Use Subscriptions instead
11
- */
12
9
  class Client {
13
10
  constructor(apiClient) {
14
11
  this.apiClient = apiClient;
15
12
  }
13
+
14
+ /**
15
+ * @deprecated Use `subscribeToNewsroom` from `Subscriptions` instead
16
+ */
16
17
  async subscribe(newsroomId, payload) {
17
18
  const url = _routing.routing.newsroomSubscriptionsUrl.replace(':newsroom_id', String(newsroomId));
18
19
  return this.apiClient.post(url, {
@@ -2,12 +2,12 @@ import type { DeferredJobsApiClient } from '../../api';
2
2
  import type { Newsroom } from '../../types';
3
3
  import type { CreateRequest, ListOptions, ListResponse } from './types';
4
4
  type NewsroomId = Newsroom['uuid'] | Newsroom['id'];
5
- /**
6
- * @deprecated Use Subscriptions instead
7
- */
8
5
  export declare class Client {
9
6
  private readonly apiClient;
10
7
  constructor(apiClient: DeferredJobsApiClient);
8
+ /**
9
+ * @deprecated Use `subscribeToNewsroom` from `Subscriptions` instead
10
+ */
11
11
  subscribe(newsroomId: NewsroomId, payload: CreateRequest): Promise<void>;
12
12
  list(newsroomId: NewsroomId, { limit, offset, search, sortOrder }?: ListOptions): Promise<ListResponse>;
13
13
  }
@@ -1,12 +1,13 @@
1
1
  import { routing } from "../../routing.js";
2
2
  import { SortOrder } from "../../types/index.js";
3
- /**
4
- * @deprecated Use Subscriptions instead
5
- */
6
3
  export class Client {
7
4
  constructor(apiClient) {
8
5
  this.apiClient = apiClient;
9
6
  }
7
+
8
+ /**
9
+ * @deprecated Use `subscribeToNewsroom` from `Subscriptions` instead
10
+ */
10
11
  async subscribe(newsroomId, payload) {
11
12
  const url = routing.newsroomSubscriptionsUrl.replace(':newsroom_id', String(newsroomId));
12
13
  return this.apiClient.post(url, {
@@ -14,11 +14,16 @@ interface Organisation {
14
14
  }
15
15
  export interface SubscribeRequest<Type extends Contact.Type> {
16
16
  email_address: string;
17
+ first_name?: string | null;
18
+ last_name?: string | null;
17
19
  locale?: string;
18
20
  url?: string;
19
21
  visitor_uid?: string;
20
22
  session_uid?: string;
21
23
  comment?: string;
24
+ /**
25
+ * @deprecated Please use Contacts instead
26
+ */
22
27
  contact?: (Type extends Contact.Type.PERSON ? Person : Organisation) & {
23
28
  avatar_image?: UploadedImage | null;
24
29
  languages?: string[];
@@ -1,5 +1,7 @@
1
1
  export interface EmailSubscription {
2
2
  id: string;
3
3
  email_address: string;
4
+ first_name: string | null;
5
+ last_name: string | null;
4
6
  number_of_contacts: number;
5
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prezly/sdk",
3
- "version": "19.6.2",
3
+ "version": "19.7.1",
4
4
  "description": "Prezly API SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",