@prezly/sdk 14.0.0 → 14.1.1

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 = "13.0.0";
7
+ const VERSION = "14.1.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 = "13.0.0";
1
+ const VERSION = "14.1.0";
2
2
  const URL = 'https://github.com/prezly/javascript-sdk';
3
3
  export const DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
@@ -55,8 +55,12 @@ export interface License extends LicenseRef {
55
55
  /**
56
56
  * Plan level will be null in case
57
57
  * we do not have data about plan level.
58
+ *
59
+ * @deprecated Will be dropped in the future,
60
+ * use "plan" instead.
58
61
  */
59
62
  plan_level: PlanLevel | null;
63
+ plan: License.Plan;
60
64
  status: License.Status;
61
65
  subscription_lockout: boolean;
62
66
  /**
@@ -104,4 +108,8 @@ export declare namespace License {
104
108
  CANCELED = "canceled",
105
109
  UNPAID = "unpaid"
106
110
  }
111
+ interface Plan {
112
+ display_name: string | null;
113
+ is_legacy: boolean;
114
+ }
107
115
  }
@@ -28,24 +28,24 @@ exports.Newsroom = Newsroom;
28
28
  })(TrackingPolicy || (TrackingPolicy = {}));
29
29
  _Newsroom.TrackingPolicy = TrackingPolicy;
30
30
  function isActive(arg) {
31
- if (typeof arg === 'string') {
32
- return arg === Status.ACTIVE;
31
+ if (typeof arg === 'object' && arg !== null) {
32
+ return isActive(arg.status);
33
33
  }
34
- return isActive(arg.status);
34
+ return arg === Status.ACTIVE;
35
35
  }
36
36
  _Newsroom.isActive = isActive;
37
37
  function isInactive(arg) {
38
- if (typeof arg === 'string') {
39
- return arg === Status.INACTIVE;
38
+ if (typeof arg === 'object' && arg !== null) {
39
+ return isInactive(arg.status);
40
40
  }
41
- return isInactive(arg.status);
41
+ return arg === Status.INACTIVE;
42
42
  }
43
43
  _Newsroom.isInactive = isInactive;
44
44
  function isArchived(arg) {
45
- if (typeof arg === 'string') {
46
- return arg === Status.ARCHIVED;
45
+ if (typeof arg === 'object' && arg !== null) {
46
+ return isArchived(arg.status);
47
47
  }
48
- return isArchived(arg.status);
48
+ return arg === Status.ARCHIVED;
49
49
  }
50
50
  _Newsroom.isArchived = isArchived;
51
51
  })(Newsroom || (exports.Newsroom = Newsroom = {}));
@@ -21,24 +21,24 @@ export let Newsroom;
21
21
  })(TrackingPolicy || (TrackingPolicy = {}));
22
22
  _Newsroom.TrackingPolicy = TrackingPolicy;
23
23
  function isActive(arg) {
24
- if (typeof arg === 'string') {
25
- return arg === Status.ACTIVE;
24
+ if (typeof arg === 'object' && arg !== null) {
25
+ return isActive(arg.status);
26
26
  }
27
- return isActive(arg.status);
27
+ return arg === Status.ACTIVE;
28
28
  }
29
29
  _Newsroom.isActive = isActive;
30
30
  function isInactive(arg) {
31
- if (typeof arg === 'string') {
32
- return arg === Status.INACTIVE;
31
+ if (typeof arg === 'object' && arg !== null) {
32
+ return isInactive(arg.status);
33
33
  }
34
- return isInactive(arg.status);
34
+ return arg === Status.INACTIVE;
35
35
  }
36
36
  _Newsroom.isInactive = isInactive;
37
37
  function isArchived(arg) {
38
- if (typeof arg === 'string') {
39
- return arg === Status.ARCHIVED;
38
+ if (typeof arg === 'object' && arg !== null) {
39
+ return isArchived(arg.status);
40
40
  }
41
- return isArchived(arg.status);
41
+ return arg === Status.ARCHIVED;
42
42
  }
43
43
  _Newsroom.isArchived = isArchived;
44
44
  })(Newsroom || (Newsroom = {}));
@@ -58,49 +58,49 @@ exports.Story = Story;
58
58
  }
59
59
  _Story.isArchivedNewsroom = isArchivedNewsroom;
60
60
  function isUninitialized(arg) {
61
- if (typeof arg === 'object') {
61
+ if (typeof arg === 'object' && arg !== null) {
62
62
  return isUninitialized(arg.status);
63
63
  }
64
64
  return arg === Status.UNINITIALIZED;
65
65
  }
66
66
  _Story.isUninitialized = isUninitialized;
67
67
  function isDraft(arg) {
68
- if (typeof arg === 'object') {
68
+ if (typeof arg === 'object' && arg !== null) {
69
69
  return isDraft(arg.status);
70
70
  }
71
71
  return arg === Status.DRAFT;
72
72
  }
73
73
  _Story.isDraft = isDraft;
74
74
  function isScheduled(arg) {
75
- if (typeof arg === 'object') {
75
+ if (typeof arg === 'object' && arg !== null) {
76
76
  return isScheduled(arg.status);
77
77
  }
78
78
  return arg === Status.SCHEDULED;
79
79
  }
80
80
  _Story.isScheduled = isScheduled;
81
81
  function isScheduledEmbargo(arg) {
82
- if (typeof arg === 'object') {
82
+ if (typeof arg === 'object' && arg !== null) {
83
83
  return isScheduledEmbargo(arg.status);
84
84
  }
85
85
  return arg === Status.EMBARGO;
86
86
  }
87
87
  _Story.isScheduledEmbargo = isScheduledEmbargo;
88
88
  function isPublished(arg) {
89
- if (typeof arg === 'object') {
89
+ if (typeof arg === 'object' && arg !== null) {
90
90
  return isPublished(arg.status);
91
91
  }
92
92
  return arg === Status.PUBLISHED;
93
93
  }
94
94
  _Story.isPublished = isPublished;
95
95
  function isLegacyHtmlFormat(arg) {
96
- if (typeof arg === 'object') {
96
+ if (typeof arg === 'object' && arg !== null) {
97
97
  return isLegacyHtmlFormat(arg.format_version);
98
98
  }
99
99
  return arg === FormatVersion.HTML;
100
100
  }
101
101
  _Story.isLegacyHtmlFormat = isLegacyHtmlFormat;
102
102
  function isSlateFormat(arg) {
103
- if (typeof arg === 'object') {
103
+ if (typeof arg === 'object' && arg !== null) {
104
104
  return isSlateFormat(arg.format_version);
105
105
  }
106
106
  return arg === FormatVersion.SLATEJS;
@@ -51,49 +51,49 @@ export let Story;
51
51
  }
52
52
  _Story.isArchivedNewsroom = isArchivedNewsroom;
53
53
  function isUninitialized(arg) {
54
- if (typeof arg === 'object') {
54
+ if (typeof arg === 'object' && arg !== null) {
55
55
  return isUninitialized(arg.status);
56
56
  }
57
57
  return arg === Status.UNINITIALIZED;
58
58
  }
59
59
  _Story.isUninitialized = isUninitialized;
60
60
  function isDraft(arg) {
61
- if (typeof arg === 'object') {
61
+ if (typeof arg === 'object' && arg !== null) {
62
62
  return isDraft(arg.status);
63
63
  }
64
64
  return arg === Status.DRAFT;
65
65
  }
66
66
  _Story.isDraft = isDraft;
67
67
  function isScheduled(arg) {
68
- if (typeof arg === 'object') {
68
+ if (typeof arg === 'object' && arg !== null) {
69
69
  return isScheduled(arg.status);
70
70
  }
71
71
  return arg === Status.SCHEDULED;
72
72
  }
73
73
  _Story.isScheduled = isScheduled;
74
74
  function isScheduledEmbargo(arg) {
75
- if (typeof arg === 'object') {
75
+ if (typeof arg === 'object' && arg !== null) {
76
76
  return isScheduledEmbargo(arg.status);
77
77
  }
78
78
  return arg === Status.EMBARGO;
79
79
  }
80
80
  _Story.isScheduledEmbargo = isScheduledEmbargo;
81
81
  function isPublished(arg) {
82
- if (typeof arg === 'object') {
82
+ if (typeof arg === 'object' && arg !== null) {
83
83
  return isPublished(arg.status);
84
84
  }
85
85
  return arg === Status.PUBLISHED;
86
86
  }
87
87
  _Story.isPublished = isPublished;
88
88
  function isLegacyHtmlFormat(arg) {
89
- if (typeof arg === 'object') {
89
+ if (typeof arg === 'object' && arg !== null) {
90
90
  return isLegacyHtmlFormat(arg.format_version);
91
91
  }
92
92
  return arg === FormatVersion.HTML;
93
93
  }
94
94
  _Story.isLegacyHtmlFormat = isLegacyHtmlFormat;
95
95
  function isSlateFormat(arg) {
96
- if (typeof arg === 'object') {
96
+ if (typeof arg === 'object' && arg !== null) {
97
97
  return isSlateFormat(arg.format_version);
98
98
  }
99
99
  return arg === FormatVersion.SLATEJS;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prezly/sdk",
3
- "version": "14.0.0",
3
+ "version": "14.1.1",
4
4
  "description": "Prezly API SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",