@prezly/sdk 10.4.0 → 11.0.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.
@@ -1,3 +1,3 @@
1
- const VERSION = "10.3.0";
1
+ const VERSION = "10.4.0";
2
2
  const URL = 'https://github.com/prezly/javascript-sdk';
3
3
  export const DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
@@ -1,9 +1,9 @@
1
1
  import type { DeferredJobsApiClient } from '../../api';
2
2
  import type { NotificationSubscription } from '../../types';
3
- import type { NotificationSubscriptionsUpdateRequest } from './types';
3
+ import type { UpdateRequest } from './types';
4
4
  export declare class Client {
5
5
  private readonly apiClient;
6
6
  constructor(apiClient: DeferredJobsApiClient);
7
7
  list(): Promise<NotificationSubscription[]>;
8
- update(payload: NotificationSubscriptionsUpdateRequest): Promise<NotificationSubscription[]>;
8
+ update(payload: UpdateRequest): Promise<NotificationSubscription[]>;
9
9
  }
@@ -1,6 +1,4 @@
1
- export interface NotificationSubscriptionsUpdateRequest {
2
- subscriptions: {
3
- notification_type: string;
4
- is_email_subscribed: boolean;
5
- }[];
1
+ import type { NotificationSubscription } from '../../types';
2
+ export interface UpdateRequest {
3
+ subscriptions: Pick<NotificationSubscription, 'notification_type' | 'is_email_subscribed'>[];
6
4
  }
@@ -1,8 +1,20 @@
1
- import type { NotificationType } from './NotificationType';
2
1
  export interface NotificationSubscription {
3
- notification_type: NotificationType;
2
+ notification_type: NotificationSubscription.Type;
4
3
  is_email_subscribed: boolean;
5
4
  is_receiving: boolean;
6
5
  missing_permissions: string[];
7
6
  missing_features: string[];
8
7
  }
8
+ export declare namespace NotificationSubscription {
9
+ interface Type {
10
+ id: string;
11
+ title: string;
12
+ description: string | null;
13
+ area: Area;
14
+ }
15
+ enum Area {
16
+ CAMPAIGNS = "Campaigns",
17
+ CONTACTS = "Contacts",
18
+ BILLING_AND_LEGAL = "Billing & Legal"
19
+ }
20
+ }
@@ -1 +1,10 @@
1
- export {};
1
+ export let NotificationSubscription;
2
+ (function (_NotificationSubscription) {
3
+ let Area;
4
+ (function (Area) {
5
+ Area["CAMPAIGNS"] = "Campaigns";
6
+ Area["CONTACTS"] = "Contacts";
7
+ Area["BILLING_AND_LEGAL"] = "Billing & Legal";
8
+ })(Area || (Area = {}));
9
+ _NotificationSubscription.Area = Area;
10
+ })(NotificationSubscription || (NotificationSubscription = {}));
@@ -28,5 +28,3 @@ export * from './Story';
28
28
  export * from './User';
29
29
  export * from './UserAccount';
30
30
  export * from './NotificationSubscription';
31
- export * from './NotificationType';
32
- export * from './NotificationTypeArea';
@@ -28,6 +28,4 @@ export * from "./Snippet.js";
28
28
  export * from "./Story.js";
29
29
  export * from "./User.js";
30
30
  export * from "./UserAccount.js";
31
- export * from "./NotificationSubscription.js";
32
- export * from "./NotificationType.js";
33
- export * from "./NotificationTypeArea.js";
31
+ export * from "./NotificationSubscription.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prezly/sdk",
3
- "version": "10.4.0",
3
+ "version": "11.0.0",
4
4
  "description": "Prezly API SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,7 +0,0 @@
1
- import type { NotificationTypeArea } from './NotificationTypeArea';
2
- export interface NotificationType {
3
- id: string;
4
- title: string;
5
- description: string | null;
6
- area: NotificationTypeArea;
7
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- export declare enum NotificationTypeArea {
2
- CAMPAIGNS = "Campaigns",
3
- CONTACTS = "Contacts",
4
- BILLING_AND_LEGAL = "Billing & Legal"
5
- }
@@ -1,6 +0,0 @@
1
- export let NotificationTypeArea;
2
- (function (NotificationTypeArea) {
3
- NotificationTypeArea["CAMPAIGNS"] = "Campaigns";
4
- NotificationTypeArea["CONTACTS"] = "Contacts";
5
- NotificationTypeArea["BILLING_AND_LEGAL"] = "Billing & Legal";
6
- })(NotificationTypeArea || (NotificationTypeArea = {}));