@prezly/sdk 14.5.0 → 15.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.cjs +1 -0
- package/dist/Client.d.ts +2 -1
- package/dist/Client.js +2 -1
- package/dist/api/constants.cjs +1 -1
- package/dist/api/constants.js +1 -1
- package/dist/endpoints/Billing/Client.cjs +6 -0
- package/dist/endpoints/Billing/Client.d.ts +2 -0
- package/dist/endpoints/Billing/Client.js +6 -0
- package/dist/endpoints/PricingTables/Client.cjs +20 -0
- package/dist/endpoints/PricingTables/Client.d.ts +7 -0
- package/dist/endpoints/PricingTables/Client.js +13 -0
- package/dist/endpoints/PricingTables/index.cjs +25 -0
- package/dist/endpoints/PricingTables/index.d.ts +2 -0
- package/dist/endpoints/PricingTables/index.js +2 -0
- package/dist/endpoints/PricingTables/types.cjs +1 -0
- package/dist/endpoints/PricingTables/types.d.ts +33 -0
- package/dist/endpoints/PricingTables/types.js +1 -0
- package/dist/endpoints/index.cjs +3 -1
- package/dist/endpoints/index.d.ts +1 -0
- package/dist/endpoints/index.js +1 -0
- package/dist/routing.cjs +1 -0
- package/dist/routing.d.ts +1 -0
- package/dist/routing.js +1 -0
- package/dist/types/License.d.ts +2 -9
- package/dist/types/Plan.cjs +1 -1
- package/dist/types/Plan.d.ts +20 -0
- package/dist/types/Plan.js +1 -0
- package/package.json +1 -1
package/dist/Client.cjs
CHANGED
|
@@ -37,6 +37,7 @@ function createClient({
|
|
|
37
37
|
newsroomDomains: new _index2.NewsroomDomains.Client(apiClient),
|
|
38
38
|
newsroomGalleries: new _index2.NewsroomGalleries.Client(apiClient),
|
|
39
39
|
newsroomHub: new _index2.NewsroomHub.Client(apiClient),
|
|
40
|
+
pricingTables: new _index2.PricingTables.Client(apiClient),
|
|
40
41
|
senderAddresses: new _index2.SenderAddresses.Client(apiClient),
|
|
41
42
|
signup: new _index2.Signup.Client(apiClient),
|
|
42
43
|
stories: new _index2.Stories.Client(apiClient),
|
package/dist/Client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeferredJobsApiClient } from './api';
|
|
2
|
-
import { Accounts, Billing, Campaigns, CampaignRecipients, ContactsExports, Coverage, Jobs, Licenses, Newsrooms, NewsroomCategories, NewsroomContacts, NewsroomLanguages, NewsroomThemes, NewsroomWebhooks, NewsroomPrivacyRequests, NewsroomDomains, NewsroomGalleries, NewsroomHub, SenderAddresses, Signup, Stories, Snippets, Subscriptions, NotificationSubscriptions } from './endpoints';
|
|
2
|
+
import { Accounts, Billing, Campaigns, CampaignRecipients, ContactsExports, Coverage, Jobs, Licenses, Newsrooms, NewsroomCategories, NewsroomContacts, NewsroomLanguages, NewsroomThemes, NewsroomWebhooks, NewsroomPrivacyRequests, NewsroomDomains, NewsroomGalleries, NewsroomHub, PricingTables, SenderAddresses, Signup, Stories, Snippets, Subscriptions, NotificationSubscriptions } from './endpoints';
|
|
3
3
|
import type { HeadersMap } from './http';
|
|
4
4
|
export interface ClientOptions {
|
|
5
5
|
accessToken: string;
|
|
@@ -26,6 +26,7 @@ export interface Client {
|
|
|
26
26
|
newsroomDomains: NewsroomDomains.Client;
|
|
27
27
|
newsroomGalleries: NewsroomGalleries.Client;
|
|
28
28
|
newsroomHub: NewsroomHub.Client;
|
|
29
|
+
pricingTables: PricingTables.Client;
|
|
29
30
|
senderAddresses: SenderAddresses.Client;
|
|
30
31
|
signup: Signup.Client;
|
|
31
32
|
stories: Stories.Client;
|
package/dist/Client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiClient, DeferredJobsApiClient } from "./api/index.js";
|
|
2
|
-
import { Accounts, Billing, Campaigns, CampaignRecipients, ContactsExports, Coverage, Jobs, Licenses, Newsrooms, NewsroomCategories, NewsroomContacts, NewsroomLanguages, NewsroomThemes, NewsroomWebhooks, NewsroomPrivacyRequests, NewsroomDomains, NewsroomGalleries, NewsroomHub, SenderAddresses, Signup, Stories, Snippets, Subscriptions, NotificationSubscriptions } from "./endpoints/index.js";
|
|
2
|
+
import { Accounts, Billing, Campaigns, CampaignRecipients, ContactsExports, Coverage, Jobs, Licenses, Newsrooms, NewsroomCategories, NewsroomContacts, NewsroomLanguages, NewsroomThemes, NewsroomWebhooks, NewsroomPrivacyRequests, NewsroomDomains, NewsroomGalleries, NewsroomHub, PricingTables, SenderAddresses, Signup, 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,
|
|
@@ -31,6 +31,7 @@ export function createClient({
|
|
|
31
31
|
newsroomDomains: new NewsroomDomains.Client(apiClient),
|
|
32
32
|
newsroomGalleries: new NewsroomGalleries.Client(apiClient),
|
|
33
33
|
newsroomHub: new NewsroomHub.Client(apiClient),
|
|
34
|
+
pricingTables: new PricingTables.Client(apiClient),
|
|
34
35
|
senderAddresses: new SenderAddresses.Client(apiClient),
|
|
35
36
|
signup: new Signup.Client(apiClient),
|
|
36
37
|
stories: new Stories.Client(apiClient),
|
package/dist/api/constants.cjs
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.DEFAULT_USER_AGENT = void 0;
|
|
7
|
-
const VERSION = "14.
|
|
7
|
+
const VERSION = "14.6.0";
|
|
8
8
|
const URL = 'https://github.com/prezly/javascript-sdk';
|
|
9
9
|
const DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
|
|
10
10
|
exports.DEFAULT_USER_AGENT = DEFAULT_USER_AGENT;
|
package/dist/api/constants.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { DeferredJobsApiClient } from '../../api';
|
|
2
|
+
import type { Plan } from '../../types';
|
|
2
3
|
import type { SignupRequest, SignupResponse } from './types';
|
|
3
4
|
export declare class Client {
|
|
4
5
|
private readonly apiClient;
|
|
5
6
|
constructor(apiClient: DeferredJobsApiClient);
|
|
6
7
|
signup(payload: SignupRequest): Promise<SignupResponse>;
|
|
8
|
+
getPlan(): Promise<Plan>;
|
|
7
9
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Client = void 0;
|
|
7
|
+
var _routing = require("../../routing.cjs");
|
|
8
|
+
class Client {
|
|
9
|
+
constructor(apiClient) {
|
|
10
|
+
this.apiClient = apiClient;
|
|
11
|
+
}
|
|
12
|
+
async get(tableId) {
|
|
13
|
+
const url = _routing.routing.pricingTablesUrl.replace(':table_id', String(tableId));
|
|
14
|
+
const {
|
|
15
|
+
table
|
|
16
|
+
} = await this.apiClient.get(url);
|
|
17
|
+
return table;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.Client = Client;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DeferredJobsApiClient } from '../../api';
|
|
2
|
+
import type { PricingTable } from './types';
|
|
3
|
+
export declare class Client {
|
|
4
|
+
private readonly apiClient;
|
|
5
|
+
constructor(apiClient: DeferredJobsApiClient);
|
|
6
|
+
get(tableId: 'standard'): Promise<PricingTable>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { routing } from "../../routing.js";
|
|
2
|
+
export class Client {
|
|
3
|
+
constructor(apiClient) {
|
|
4
|
+
this.apiClient = apiClient;
|
|
5
|
+
}
|
|
6
|
+
async get(tableId) {
|
|
7
|
+
const url = routing.pricingTablesUrl.replace(':table_id', String(tableId));
|
|
8
|
+
const {
|
|
9
|
+
table
|
|
10
|
+
} = await this.apiClient.get(url);
|
|
11
|
+
return table;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _Client = require("./Client.cjs");
|
|
7
|
+
Object.keys(_Client).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
Object.defineProperty(exports, key, {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return _Client[key];
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
var _types = require("./types.cjs");
|
|
17
|
+
Object.keys(_types).forEach(function (key) {
|
|
18
|
+
if (key === "default" || key === "__esModule") return;
|
|
19
|
+
Object.defineProperty(exports, key, {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () {
|
|
22
|
+
return _types[key];
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface PricingTable {
|
|
2
|
+
options: Option[];
|
|
3
|
+
}
|
|
4
|
+
export interface Option {
|
|
5
|
+
id: string;
|
|
6
|
+
display_name: string;
|
|
7
|
+
description: string | null;
|
|
8
|
+
overview_features_list: PlanFeatureRef[];
|
|
9
|
+
limits: Limit[];
|
|
10
|
+
prices: Price[];
|
|
11
|
+
add_ons: AddOn[];
|
|
12
|
+
}
|
|
13
|
+
export interface PlanFeatureRef {
|
|
14
|
+
name: string;
|
|
15
|
+
details?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface Limit {
|
|
18
|
+
id: string;
|
|
19
|
+
display_name: string;
|
|
20
|
+
value: null | number;
|
|
21
|
+
per: null | string;
|
|
22
|
+
}
|
|
23
|
+
export interface Price {
|
|
24
|
+
billing_cycle: string;
|
|
25
|
+
currency: string;
|
|
26
|
+
amount: number;
|
|
27
|
+
unit: string | null;
|
|
28
|
+
}
|
|
29
|
+
export interface AddOn {
|
|
30
|
+
id: string;
|
|
31
|
+
display_name: string;
|
|
32
|
+
prices: Price[];
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/endpoints/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.NotificationSubscriptions = exports.Subscriptions = exports.Stories = exports.Snippets = exports.Signup = exports.SenderAddresses = exports.NewsroomWebhooks = exports.NewsroomThemes = exports.NewsroomSubscriptions = exports.Newsrooms = exports.NewsroomPrivacyRequests = exports.NewsroomLanguages = exports.NewsroomHub = exports.NewsroomGalleries = exports.NewsroomDomains = exports.NewsroomContacts = exports.NewsroomCategories = exports.Licenses = exports.Jobs = exports.Coverage = exports.ContactsExports = exports.Campaigns = exports.CampaignRecipients = exports.Billing = exports.Accounts = void 0;
|
|
6
|
+
exports.NotificationSubscriptions = exports.Subscriptions = exports.Stories = exports.Snippets = exports.Signup = exports.SenderAddresses = exports.PricingTables = exports.NewsroomWebhooks = exports.NewsroomThemes = exports.NewsroomSubscriptions = exports.Newsrooms = exports.NewsroomPrivacyRequests = exports.NewsroomLanguages = exports.NewsroomHub = exports.NewsroomGalleries = exports.NewsroomDomains = exports.NewsroomContacts = exports.NewsroomCategories = exports.Licenses = exports.Jobs = exports.Coverage = exports.ContactsExports = exports.Campaigns = exports.CampaignRecipients = exports.Billing = exports.Accounts = void 0;
|
|
7
7
|
var _Accounts = _interopRequireWildcard(require("./Accounts/index.cjs"));
|
|
8
8
|
exports.Accounts = _Accounts;
|
|
9
9
|
var _Billing = _interopRequireWildcard(require("./Billing/index.cjs"));
|
|
@@ -42,6 +42,8 @@ var _NewsroomThemes = _interopRequireWildcard(require("./NewsroomThemes/index.cj
|
|
|
42
42
|
exports.NewsroomThemes = _NewsroomThemes;
|
|
43
43
|
var _NewsroomWebhooks = _interopRequireWildcard(require("./NewsroomWebhooks/index.cjs"));
|
|
44
44
|
exports.NewsroomWebhooks = _NewsroomWebhooks;
|
|
45
|
+
var _PricingTables = _interopRequireWildcard(require("./PricingTables/index.cjs"));
|
|
46
|
+
exports.PricingTables = _PricingTables;
|
|
45
47
|
var _SenderAddresses = _interopRequireWildcard(require("./SenderAddresses/index.cjs"));
|
|
46
48
|
exports.SenderAddresses = _SenderAddresses;
|
|
47
49
|
var _Signup = _interopRequireWildcard(require("./Signup/index.cjs"));
|
|
@@ -17,6 +17,7 @@ export * as Newsrooms from './Newsrooms';
|
|
|
17
17
|
export * as NewsroomSubscriptions from './NewsroomSubscriptions';
|
|
18
18
|
export * as NewsroomThemes from './NewsroomThemes';
|
|
19
19
|
export * as NewsroomWebhooks from './NewsroomWebhooks';
|
|
20
|
+
export * as PricingTables from './PricingTables';
|
|
20
21
|
export * as SenderAddresses from './SenderAddresses';
|
|
21
22
|
export * as Signup from './Signup';
|
|
22
23
|
export * as Snippets from './Snippets';
|
package/dist/endpoints/index.js
CHANGED
|
@@ -17,6 +17,7 @@ export * as Newsrooms from "./Newsrooms/index.js";
|
|
|
17
17
|
export * as NewsroomSubscriptions from "./NewsroomSubscriptions/index.js";
|
|
18
18
|
export * as NewsroomThemes from "./NewsroomThemes/index.js";
|
|
19
19
|
export * as NewsroomWebhooks from "./NewsroomWebhooks/index.js";
|
|
20
|
+
export * as PricingTables from "./PricingTables/index.js";
|
|
20
21
|
export * as SenderAddresses from "./SenderAddresses/index.js";
|
|
21
22
|
export * as Signup from "./Signup/index.js";
|
|
22
23
|
export * as Snippets from "./Snippets/index.js";
|
package/dist/routing.cjs
CHANGED
|
@@ -29,6 +29,7 @@ const routing = {
|
|
|
29
29
|
newsroomGalleriesUrl: '/v2/newsrooms/:newsroom_id/galleries',
|
|
30
30
|
newsroomHubUrl: '/v2/newsrooms/:newsroom_id/hub',
|
|
31
31
|
notificationSubscriptionsUrl: '/v2/notification-subscriptions',
|
|
32
|
+
pricingTablesUrl: '/v2/pricing-tables/:table_id',
|
|
32
33
|
senderAddressesUrl: '/v2/sender-addresses',
|
|
33
34
|
signup: '/v2/signup',
|
|
34
35
|
storiesUrl: '/v2/stories',
|
package/dist/routing.d.ts
CHANGED
package/dist/routing.js
CHANGED
|
@@ -23,6 +23,7 @@ export const routing = {
|
|
|
23
23
|
newsroomGalleriesUrl: '/v2/newsrooms/:newsroom_id/galleries',
|
|
24
24
|
newsroomHubUrl: '/v2/newsrooms/:newsroom_id/hub',
|
|
25
25
|
notificationSubscriptionsUrl: '/v2/notification-subscriptions',
|
|
26
|
+
pricingTablesUrl: '/v2/pricing-tables/:table_id',
|
|
26
27
|
senderAddressesUrl: '/v2/sender-addresses',
|
|
27
28
|
signup: '/v2/signup',
|
|
28
29
|
storiesUrl: '/v2/stories',
|
package/dist/types/License.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Currency } from './Currency';
|
|
2
|
-
import type { PlanLevel } from './Plan';
|
|
2
|
+
import type { PlanLevel, PlanReference } from './Plan';
|
|
3
3
|
export interface LicenseRef {
|
|
4
4
|
id: number;
|
|
5
5
|
display_name: string;
|
|
@@ -60,7 +60,7 @@ export interface License extends LicenseRef {
|
|
|
60
60
|
* use "plan" instead.
|
|
61
61
|
*/
|
|
62
62
|
plan_level: PlanLevel | null;
|
|
63
|
-
plan:
|
|
63
|
+
plan: PlanReference | null;
|
|
64
64
|
status: License.Status;
|
|
65
65
|
subscription_lockout: boolean;
|
|
66
66
|
/**
|
|
@@ -108,11 +108,4 @@ export declare namespace License {
|
|
|
108
108
|
CANCELED = "canceled",
|
|
109
109
|
UNPAID = "unpaid"
|
|
110
110
|
}
|
|
111
|
-
interface Plan {
|
|
112
|
-
display_name: string | null;
|
|
113
|
-
description: string | null;
|
|
114
|
-
is_legacy: boolean;
|
|
115
|
-
is_superior: boolean;
|
|
116
|
-
pricing_table_option_id: string | null;
|
|
117
|
-
}
|
|
118
111
|
}
|
package/dist/types/Plan.cjs
CHANGED
package/dist/types/Plan.d.ts
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
import type { Limit } from '../endpoints/PricingTables';
|
|
2
|
+
export interface PlanReference {
|
|
3
|
+
display_name: string;
|
|
4
|
+
description: string | null;
|
|
5
|
+
is_legacy: boolean;
|
|
6
|
+
is_deprecated: boolean;
|
|
7
|
+
is_superior: boolean;
|
|
8
|
+
is_trial: boolean;
|
|
9
|
+
pricing_table_option_id: string | null;
|
|
10
|
+
}
|
|
11
|
+
export interface Plan extends PlanReference {
|
|
12
|
+
billing_cycle: string;
|
|
13
|
+
currency: string;
|
|
14
|
+
usage: Usage[];
|
|
15
|
+
}
|
|
16
|
+
export interface Usage {
|
|
17
|
+
limit: Limit;
|
|
18
|
+
used: number;
|
|
19
|
+
}
|
|
20
|
+
/** @deprecated Will be dropped in future */
|
|
1
21
|
export declare enum PlanLevel {
|
|
2
22
|
BASIC = "basic",
|
|
3
23
|
CORE = "core",
|
package/dist/types/Plan.js
CHANGED