@prezly/sdk 15.4.0 → 15.6.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/api/constants.cjs +1 -1
- package/dist/api/constants.js +1 -1
- package/dist/endpoints/Billing/types.cjs +2 -8
- package/dist/endpoints/Billing/types.d.ts +2 -5
- package/dist/endpoints/Billing/types.js +1 -6
- package/dist/endpoints/PricingTables/Client.cjs +9 -2
- package/dist/endpoints/PricingTables/Client.d.ts +1 -0
- package/dist/endpoints/PricingTables/Client.js +9 -2
- package/dist/endpoints/PricingTables/types.cjs +18 -1
- package/dist/endpoints/PricingTables/types.d.ts +11 -1
- package/dist/endpoints/PricingTables/types.js +11 -1
- package/dist/routing.cjs +1 -1
- package/dist/routing.js +1 -1
- package/dist/types/BillingCycle.cjs +12 -0
- package/dist/types/BillingCycle.d.ts +4 -0
- package/dist/types/BillingCycle.js +5 -0
- package/dist/types/Plan.cjs +9 -2
- package/dist/types/Plan.d.ts +19 -3
- package/dist/types/Plan.js +7 -0
- package/dist/types/index.cjs +10 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/package.json +1 -1
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 = "15.
|
|
7
|
+
const VERSION = "15.5.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
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.SignupCurrency = exports.SignupPlan = void 0;
|
|
7
7
|
let SignupPlan;
|
|
8
8
|
exports.SignupPlan = SignupPlan;
|
|
9
9
|
(function (SignupPlan) {
|
|
@@ -16,10 +16,4 @@ exports.SignupCurrency = SignupCurrency;
|
|
|
16
16
|
(function (SignupCurrency) {
|
|
17
17
|
SignupCurrency["EUR"] = "eur";
|
|
18
18
|
SignupCurrency["USD"] = "usd";
|
|
19
|
-
})(SignupCurrency || (exports.SignupCurrency = SignupCurrency = {}));
|
|
20
|
-
let SignupBillingCycle;
|
|
21
|
-
exports.SignupBillingCycle = SignupBillingCycle;
|
|
22
|
-
(function (SignupBillingCycle) {
|
|
23
|
-
SignupBillingCycle["YEAR"] = "year";
|
|
24
|
-
SignupBillingCycle["MONTH"] = "month";
|
|
25
|
-
})(SignupBillingCycle || (exports.SignupBillingCycle = SignupBillingCycle = {}));
|
|
19
|
+
})(SignupCurrency || (exports.SignupCurrency = SignupCurrency = {}));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { BillingCycle } from '../../types/BillingCycle';
|
|
1
2
|
export declare enum SignupPlan {
|
|
2
3
|
STARTER = "starter",
|
|
3
4
|
CORE = "core",
|
|
@@ -7,10 +8,6 @@ export declare enum SignupCurrency {
|
|
|
7
8
|
EUR = "eur",
|
|
8
9
|
USD = "usd"
|
|
9
10
|
}
|
|
10
|
-
export declare enum SignupBillingCycle {
|
|
11
|
-
YEAR = "year",
|
|
12
|
-
MONTH = "month"
|
|
13
|
-
}
|
|
14
11
|
export interface SignupRequest {
|
|
15
12
|
email: string;
|
|
16
13
|
company_name: string;
|
|
@@ -19,7 +16,7 @@ export interface SignupRequest {
|
|
|
19
16
|
quantity: number;
|
|
20
17
|
plan?: SignupPlan;
|
|
21
18
|
currency?: SignupCurrency;
|
|
22
|
-
billing_cycle?:
|
|
19
|
+
billing_cycle?: BillingCycle;
|
|
23
20
|
phone?: string;
|
|
24
21
|
}
|
|
25
22
|
export interface SignupResponse {
|
|
@@ -8,9 +8,4 @@ export let SignupCurrency;
|
|
|
8
8
|
(function (SignupCurrency) {
|
|
9
9
|
SignupCurrency["EUR"] = "eur";
|
|
10
10
|
SignupCurrency["USD"] = "usd";
|
|
11
|
-
})(SignupCurrency || (SignupCurrency = {}));
|
|
12
|
-
export let SignupBillingCycle;
|
|
13
|
-
(function (SignupBillingCycle) {
|
|
14
|
-
SignupBillingCycle["YEAR"] = "year";
|
|
15
|
-
SignupBillingCycle["MONTH"] = "month";
|
|
16
|
-
})(SignupBillingCycle || (SignupBillingCycle = {}));
|
|
11
|
+
})(SignupCurrency || (SignupCurrency = {}));
|
|
@@ -9,11 +9,18 @@ class Client {
|
|
|
9
9
|
constructor(apiClient) {
|
|
10
10
|
this.apiClient = apiClient;
|
|
11
11
|
}
|
|
12
|
+
async list() {
|
|
13
|
+
const url = _routing.routing.pricingTablesUrl;
|
|
14
|
+
const {
|
|
15
|
+
tables
|
|
16
|
+
} = await this.apiClient.get(url);
|
|
17
|
+
return tables;
|
|
18
|
+
}
|
|
12
19
|
async get(tableId) {
|
|
13
|
-
const url = _routing.routing.pricingTablesUrl
|
|
20
|
+
const url = _routing.routing.pricingTablesUrl;
|
|
14
21
|
const {
|
|
15
22
|
table
|
|
16
|
-
} = await this.apiClient.get(url);
|
|
23
|
+
} = await this.apiClient.get(`${url}/${tableId}`);
|
|
17
24
|
return table;
|
|
18
25
|
}
|
|
19
26
|
}
|
|
@@ -3,11 +3,18 @@ export class Client {
|
|
|
3
3
|
constructor(apiClient) {
|
|
4
4
|
this.apiClient = apiClient;
|
|
5
5
|
}
|
|
6
|
+
async list() {
|
|
7
|
+
const url = routing.pricingTablesUrl;
|
|
8
|
+
const {
|
|
9
|
+
tables
|
|
10
|
+
} = await this.apiClient.get(url);
|
|
11
|
+
return tables;
|
|
12
|
+
}
|
|
6
13
|
async get(tableId) {
|
|
7
|
-
const url = routing.pricingTablesUrl
|
|
14
|
+
const url = routing.pricingTablesUrl;
|
|
8
15
|
const {
|
|
9
16
|
table
|
|
10
|
-
} = await this.apiClient.get(url);
|
|
17
|
+
} = await this.apiClient.get(`${url}/${tableId}`);
|
|
11
18
|
return table;
|
|
12
19
|
}
|
|
13
20
|
}
|
|
@@ -1 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.OptionId = void 0;
|
|
7
|
+
let OptionId;
|
|
8
|
+
exports.OptionId = OptionId;
|
|
9
|
+
(function (OptionId) {
|
|
10
|
+
OptionId["STARTER"] = "starter";
|
|
11
|
+
OptionId["CORE"] = "core";
|
|
12
|
+
OptionId["PREMIUM"] = "premium";
|
|
13
|
+
OptionId["AGENCY_STARTER"] = "agency_starter";
|
|
14
|
+
OptionId["AGENCY_SMALL"] = "agency_small";
|
|
15
|
+
OptionId["AGENCY_MEDIUM"] = "agency_medium";
|
|
16
|
+
OptionId["AGENCY_LARGE"] = "agency_large";
|
|
17
|
+
OptionId["AGENCY_HUGE"] = "agency_huge";
|
|
18
|
+
})(OptionId || (exports.OptionId = OptionId = {}));
|
|
@@ -3,7 +3,7 @@ export interface PricingTable {
|
|
|
3
3
|
rows: Row[];
|
|
4
4
|
}
|
|
5
5
|
export interface Option {
|
|
6
|
-
id:
|
|
6
|
+
id: OptionId;
|
|
7
7
|
display_name: string;
|
|
8
8
|
description: string | null;
|
|
9
9
|
overview_features_list: PlanFeatureRef[];
|
|
@@ -11,6 +11,16 @@ export interface Option {
|
|
|
11
11
|
prices: Price[];
|
|
12
12
|
add_ons: AddOn[];
|
|
13
13
|
}
|
|
14
|
+
export declare enum OptionId {
|
|
15
|
+
STARTER = "starter",
|
|
16
|
+
CORE = "core",
|
|
17
|
+
PREMIUM = "premium",
|
|
18
|
+
AGENCY_STARTER = "agency_starter",
|
|
19
|
+
AGENCY_SMALL = "agency_small",
|
|
20
|
+
AGENCY_MEDIUM = "agency_medium",
|
|
21
|
+
AGENCY_LARGE = "agency_large",
|
|
22
|
+
AGENCY_HUGE = "agency_huge"
|
|
23
|
+
}
|
|
14
24
|
export interface PlanFeatureRef {
|
|
15
25
|
name: string;
|
|
16
26
|
details?: string;
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
export
|
|
1
|
+
export let OptionId;
|
|
2
|
+
(function (OptionId) {
|
|
3
|
+
OptionId["STARTER"] = "starter";
|
|
4
|
+
OptionId["CORE"] = "core";
|
|
5
|
+
OptionId["PREMIUM"] = "premium";
|
|
6
|
+
OptionId["AGENCY_STARTER"] = "agency_starter";
|
|
7
|
+
OptionId["AGENCY_SMALL"] = "agency_small";
|
|
8
|
+
OptionId["AGENCY_MEDIUM"] = "agency_medium";
|
|
9
|
+
OptionId["AGENCY_LARGE"] = "agency_large";
|
|
10
|
+
OptionId["AGENCY_HUGE"] = "agency_huge";
|
|
11
|
+
})(OptionId || (OptionId = {}));
|
package/dist/routing.cjs
CHANGED
|
@@ -29,7 +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
|
|
32
|
+
pricingTablesUrl: '/v2/pricing-tables',
|
|
33
33
|
senderAddressesUrl: '/v2/sender-addresses',
|
|
34
34
|
signup: '/v2/signup',
|
|
35
35
|
storiesUrl: '/v2/stories',
|
package/dist/routing.js
CHANGED
|
@@ -23,7 +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
|
|
26
|
+
pricingTablesUrl: '/v2/pricing-tables',
|
|
27
27
|
senderAddressesUrl: '/v2/sender-addresses',
|
|
28
28
|
signup: '/v2/signup',
|
|
29
29
|
storiesUrl: '/v2/stories',
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.BillingCycle = void 0;
|
|
7
|
+
let BillingCycle;
|
|
8
|
+
exports.BillingCycle = BillingCycle;
|
|
9
|
+
(function (BillingCycle) {
|
|
10
|
+
BillingCycle["YEAR"] = "year";
|
|
11
|
+
BillingCycle["MONTH"] = "month";
|
|
12
|
+
})(BillingCycle || (exports.BillingCycle = BillingCycle = {}));
|
package/dist/types/Plan.cjs
CHANGED
|
@@ -3,8 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.PlanLevel = void 0;
|
|
7
|
-
/** @deprecated Will be dropped in future */
|
|
6
|
+
exports.PlanLevel = exports.ChangeType = void 0;
|
|
7
|
+
let ChangeType; /** @deprecated Will be dropped in future */
|
|
8
|
+
exports.ChangeType = ChangeType;
|
|
9
|
+
(function (ChangeType) {
|
|
10
|
+
ChangeType["ACTIVATION"] = "activation";
|
|
11
|
+
ChangeType["UPGRADE"] = "upgrade";
|
|
12
|
+
ChangeType["DOWNGRADE"] = "downgrade";
|
|
13
|
+
})(ChangeType || (exports.ChangeType = ChangeType = {}));
|
|
14
|
+
let PlanLevel;
|
|
8
15
|
exports.PlanLevel = PlanLevel;
|
|
9
16
|
(function (PlanLevel) {
|
|
10
17
|
PlanLevel["BASIC"] = "basic";
|
package/dist/types/Plan.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { Limit } from '../endpoints/PricingTables';
|
|
2
|
+
import type { OptionId } from '../endpoints/PricingTables';
|
|
3
|
+
import type { BillingCycle } from './BillingCycle';
|
|
4
|
+
import type { Currency } from './Currency';
|
|
2
5
|
export interface PlanReference {
|
|
3
6
|
display_name: string;
|
|
4
7
|
description: string | null;
|
|
@@ -7,20 +10,33 @@ export interface PlanReference {
|
|
|
7
10
|
is_superior: boolean;
|
|
8
11
|
is_trial: boolean;
|
|
9
12
|
can_upgrade: boolean;
|
|
10
|
-
pricing_table_option_id:
|
|
13
|
+
pricing_table_option_id: OptionId | null;
|
|
11
14
|
}
|
|
12
15
|
export interface Plan extends PlanReference {
|
|
13
|
-
billing_cycle:
|
|
16
|
+
billing_cycle: BillingCycle;
|
|
14
17
|
billing_cycle_count: number;
|
|
15
|
-
currency:
|
|
18
|
+
currency: Currency;
|
|
16
19
|
total_before_discount: number;
|
|
17
20
|
total_after_discount: number;
|
|
18
21
|
usage: Usage[];
|
|
22
|
+
possible_changes: Change[];
|
|
23
|
+
ends_at: string | null;
|
|
24
|
+
ended_at: string | null;
|
|
19
25
|
}
|
|
20
26
|
export interface Usage {
|
|
21
27
|
limit: Limit;
|
|
22
28
|
used: number;
|
|
23
29
|
}
|
|
30
|
+
export interface Change {
|
|
31
|
+
pricing_table_option_id: OptionId;
|
|
32
|
+
can_self_change: boolean;
|
|
33
|
+
type: ChangeType;
|
|
34
|
+
}
|
|
35
|
+
export declare enum ChangeType {
|
|
36
|
+
ACTIVATION = "activation",
|
|
37
|
+
UPGRADE = "upgrade",
|
|
38
|
+
DOWNGRADE = "downgrade"
|
|
39
|
+
}
|
|
24
40
|
/** @deprecated Will be dropped in future */
|
|
25
41
|
export declare enum PlanLevel {
|
|
26
42
|
BASIC = "basic",
|
package/dist/types/Plan.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
+
export let ChangeType;
|
|
2
|
+
|
|
1
3
|
/** @deprecated Will be dropped in future */
|
|
4
|
+
(function (ChangeType) {
|
|
5
|
+
ChangeType["ACTIVATION"] = "activation";
|
|
6
|
+
ChangeType["UPGRADE"] = "upgrade";
|
|
7
|
+
ChangeType["DOWNGRADE"] = "downgrade";
|
|
8
|
+
})(ChangeType || (ChangeType = {}));
|
|
2
9
|
export let PlanLevel;
|
|
3
10
|
(function (PlanLevel) {
|
|
4
11
|
PlanLevel["BASIC"] = "basic";
|
package/dist/types/index.cjs
CHANGED
|
@@ -13,6 +13,16 @@ Object.keys(_index).forEach(function (key) {
|
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
15
|
});
|
|
16
|
+
var _BillingCycle = require("./BillingCycle.cjs");
|
|
17
|
+
Object.keys(_BillingCycle).forEach(function (key) {
|
|
18
|
+
if (key === "default" || key === "__esModule") return;
|
|
19
|
+
Object.defineProperty(exports, key, {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () {
|
|
22
|
+
return _BillingCycle[key];
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
});
|
|
16
26
|
var _Campaign = require("./Campaign.cjs");
|
|
17
27
|
Object.keys(_Campaign).forEach(function (key) {
|
|
18
28
|
if (key === "default" || key === "__esModule") return;
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED