@prezly/sdk 14.6.0 → 15.1.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.
@@ -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.5.0";
7
+ const VERSION = "15.0.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;
@@ -1,3 +1,3 @@
1
- const VERSION = "14.5.0";
1
+ const VERSION = "15.0.0";
2
2
  const URL = 'https://github.com/prezly/javascript-sdk';
3
3
  export const DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
@@ -15,5 +15,11 @@ class Client {
15
15
  payload
16
16
  });
17
17
  }
18
+ async getPlan() {
19
+ const {
20
+ plan
21
+ } = await this.apiClient.get(`${_routing.routing.billing}/plan`);
22
+ return plan;
23
+ }
18
24
  }
19
25
  exports.Client = Client;
@@ -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
  }
@@ -9,4 +9,10 @@ export class Client {
9
9
  payload
10
10
  });
11
11
  }
12
+ async getPlan() {
13
+ const {
14
+ plan
15
+ } = await this.apiClient.get(`${routing.billing}/plan`);
16
+ return plan;
17
+ }
12
18
  }
@@ -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: License.Plan | null;
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
  }
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.PlanLevel = void 0;
7
- let PlanLevel;
7
+ /** @deprecated Will be dropped in future */let PlanLevel;
8
8
  exports.PlanLevel = PlanLevel;
9
9
  (function (PlanLevel) {
10
10
  PlanLevel["BASIC"] = "basic";
@@ -1,3 +1,24 @@
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
+ can_upgrade: boolean;
10
+ pricing_table_option_id: string | null;
11
+ }
12
+ export interface Plan extends PlanReference {
13
+ billing_cycle: string;
14
+ currency: string;
15
+ usage: Usage[];
16
+ }
17
+ export interface Usage {
18
+ limit: Limit;
19
+ used: number;
20
+ }
21
+ /** @deprecated Will be dropped in future */
1
22
  export declare enum PlanLevel {
2
23
  BASIC = "basic",
3
24
  CORE = "core",
@@ -1,3 +1,4 @@
1
+ /** @deprecated Will be dropped in future */
1
2
  export let PlanLevel;
2
3
  (function (PlanLevel) {
3
4
  PlanLevel["BASIC"] = "basic";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prezly/sdk",
3
- "version": "14.6.0",
3
+ "version": "15.1.0",
4
4
  "description": "Prezly API SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",