@prezly/sdk 10.0.0 → 10.1.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.
- package/dist/Client.d.ts +2 -1
- package/dist/Client.js +3 -2
- package/dist/api/constants.js +1 -1
- package/dist/endpoints/NotificationSubscriptions/Client.d.ts +9 -0
- package/dist/endpoints/NotificationSubscriptions/Client.js +22 -0
- package/dist/endpoints/NotificationSubscriptions/index.d.ts +2 -0
- package/dist/endpoints/NotificationSubscriptions/index.js +2 -0
- package/dist/endpoints/NotificationSubscriptions/types.d.ts +6 -0
- package/dist/endpoints/NotificationSubscriptions/types.js +1 -0
- package/dist/endpoints/index.d.ts +1 -0
- package/dist/endpoints/index.js +2 -1
- package/dist/routing.d.ts +1 -0
- package/dist/routing.js +1 -0
- package/dist/types/NotificationSubscription.d.ts +8 -0
- package/dist/types/NotificationSubscription.js +1 -0
- package/dist/types/NotificationType.d.ts +7 -0
- package/dist/types/NotificationType.js +1 -0
- package/dist/types/NotificationTypeArea.d.ts +5 -0
- package/dist/types/NotificationTypeArea.js +6 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +4 -1
- package/package.json +1 -1
package/dist/Client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Accounts, Campaigns, CampaignRecipients, Coverage, Jobs, Licenses, Newsrooms, NewsroomCategories, NewsroomContacts, NewsroomLanguages, NewsroomThemes, NewsroomWebhooks, NewsroomPrivacyRequests, NewsroomDomains, NewsroomGalleries, SenderAddresses, Stories, Snippets, Subscriptions } from './endpoints';
|
|
1
|
+
import { Accounts, Campaigns, CampaignRecipients, Coverage, Jobs, Licenses, Newsrooms, NewsroomCategories, NewsroomContacts, NewsroomLanguages, NewsroomThemes, NewsroomWebhooks, NewsroomPrivacyRequests, NewsroomDomains, NewsroomGalleries, SenderAddresses, Stories, Snippets, Subscriptions, NotificationSubscriptions } from './endpoints';
|
|
2
2
|
import type { HeadersMap } from './http';
|
|
3
3
|
export interface ClientOptions {
|
|
4
4
|
accessToken: string;
|
|
@@ -25,5 +25,6 @@ export interface Client {
|
|
|
25
25
|
stories: Stories.Client;
|
|
26
26
|
snippets: Snippets.Client;
|
|
27
27
|
subscriptions: Subscriptions.Client;
|
|
28
|
+
notificationSubscriptions: NotificationSubscriptions.Client;
|
|
28
29
|
}
|
|
29
30
|
export declare function createClient({ accessToken, baseUrl, headers, }: ClientOptions): Client;
|
package/dist/Client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiClient, DeferredJobsApiClient } from "./api/index.js";
|
|
2
|
-
import { Accounts, Campaigns, CampaignRecipients, Coverage, Jobs, Licenses, Newsrooms, NewsroomCategories, NewsroomContacts, NewsroomLanguages, NewsroomThemes, NewsroomWebhooks, NewsroomPrivacyRequests, NewsroomDomains, NewsroomGalleries, SenderAddresses, Stories, Snippets, Subscriptions } from "./endpoints/index.js";
|
|
2
|
+
import { Accounts, Campaigns, CampaignRecipients, Coverage, Jobs, Licenses, Newsrooms, NewsroomCategories, NewsroomContacts, NewsroomLanguages, NewsroomThemes, NewsroomWebhooks, NewsroomPrivacyRequests, NewsroomDomains, NewsroomGalleries, SenderAddresses, Stories, Snippets, Subscriptions, NotificationSubscriptions } from "./endpoints/index.js";
|
|
3
3
|
const DEFAULT_BASE_URL = 'https://api.prezly.com';
|
|
4
4
|
export function createClient({
|
|
5
5
|
accessToken,
|
|
@@ -30,6 +30,7 @@ export function createClient({
|
|
|
30
30
|
senderAddresses: new SenderAddresses.Client(apiClient),
|
|
31
31
|
stories: new Stories.Client(apiClient),
|
|
32
32
|
snippets: new Snippets.Client(apiClient),
|
|
33
|
-
subscriptions: new Subscriptions.Client(apiClient)
|
|
33
|
+
subscriptions: new Subscriptions.Client(apiClient),
|
|
34
|
+
notificationSubscriptions: new NotificationSubscriptions.Client(apiClient)
|
|
34
35
|
};
|
|
35
36
|
}
|
package/dist/api/constants.js
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DeferredJobsApiClient } from '../../api';
|
|
2
|
+
import type { NotificationSubscription } from '../../types';
|
|
3
|
+
import type { NotificationSubscriptionsUpdateRequest } from './types';
|
|
4
|
+
export declare class Client {
|
|
5
|
+
private readonly apiClient;
|
|
6
|
+
constructor(apiClient: DeferredJobsApiClient);
|
|
7
|
+
list(): Promise<NotificationSubscription[]>;
|
|
8
|
+
update(payload: NotificationSubscriptionsUpdateRequest): Promise<NotificationSubscription[]>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { routing } from "../../routing.js";
|
|
2
|
+
export class Client {
|
|
3
|
+
constructor(apiClient) {
|
|
4
|
+
this.apiClient = apiClient;
|
|
5
|
+
}
|
|
6
|
+
async list() {
|
|
7
|
+
const url = routing.notificationSubscriptionsUrl;
|
|
8
|
+
const {
|
|
9
|
+
subscriptions
|
|
10
|
+
} = await this.apiClient.get(url);
|
|
11
|
+
return subscriptions;
|
|
12
|
+
}
|
|
13
|
+
async update(payload) {
|
|
14
|
+
const url = routing.notificationSubscriptionsUrl;
|
|
15
|
+
const {
|
|
16
|
+
subscriptions
|
|
17
|
+
} = await this.apiClient.patch(url, {
|
|
18
|
+
payload
|
|
19
|
+
});
|
|
20
|
+
return subscriptions;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/endpoints/index.js
CHANGED
|
@@ -17,4 +17,5 @@ export * as NewsroomWebhooks from "./NewsroomWebhooks/index.js";
|
|
|
17
17
|
export * as SenderAddresses from "./SenderAddresses/index.js";
|
|
18
18
|
export * as Snippets from "./Snippets/index.js";
|
|
19
19
|
export * as Stories from "./Stories/index.js";
|
|
20
|
-
export * as Subscriptions from "./Subscriptions/index.js";
|
|
20
|
+
export * as Subscriptions from "./Subscriptions/index.js";
|
|
21
|
+
export * as NotificationSubscriptions from "./NotificationSubscriptions/index.js";
|
package/dist/routing.d.ts
CHANGED
package/dist/routing.js
CHANGED
|
@@ -19,6 +19,7 @@ export const routing = {
|
|
|
19
19
|
newsroomPrivacyRequestsUrl: '/v2/newsrooms/:newsroom_id/privacy-requests',
|
|
20
20
|
newsroomDomainsUrl: '/v2/newsrooms/:newsroom_id/domains',
|
|
21
21
|
newsroomGalleriesUrl: '/v2/newsrooms/:newsroom_id/galleries',
|
|
22
|
+
notificationSubscriptionsUrl: '/v2/notification-subscriptions',
|
|
22
23
|
senderAddressesUrl: '/v2/sender-addresses',
|
|
23
24
|
storiesUrl: '/v2/stories',
|
|
24
25
|
storiesSearchUrl: '/v2/stories/search',
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NotificationType } from './NotificationType';
|
|
2
|
+
export interface NotificationSubscription {
|
|
3
|
+
notification_type: NotificationType;
|
|
4
|
+
is_email_subscribed: boolean;
|
|
5
|
+
is_receiving: boolean;
|
|
6
|
+
missing_permissions: string[];
|
|
7
|
+
missing_features: string[];
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
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 = {}));
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
|
@@ -27,4 +27,7 @@ export * from "./SenderDomain.js";
|
|
|
27
27
|
export * from "./Snippet.js";
|
|
28
28
|
export * from "./Story.js";
|
|
29
29
|
export * from "./User.js";
|
|
30
|
-
export * from "./UserAccount.js";
|
|
30
|
+
export * from "./UserAccount.js";
|
|
31
|
+
export * from "./NotificationSubscription.js";
|
|
32
|
+
export * from "./NotificationType.js";
|
|
33
|
+
export * from "./NotificationTypeArea.js";
|