@prezly/sdk 19.6.0 → 19.6.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.
Files changed (112) hide show
  1. package/dist/api/DeferredJobsApiClient.cjs +0 -1
  2. package/dist/api/DeferredJobsApiClient.js +0 -1
  3. package/dist/api/constants.cjs +2 -3
  4. package/dist/api/constants.js +1 -1
  5. package/dist/endpoints/Accounts/index.cjs +2 -0
  6. package/dist/endpoints/Billing/index.cjs +2 -0
  7. package/dist/endpoints/Billing/types.cjs +7 -9
  8. package/dist/endpoints/Billing/types.js +6 -6
  9. package/dist/endpoints/CampaignRecipients/index.cjs +2 -0
  10. package/dist/endpoints/Campaigns/index.cjs +2 -0
  11. package/dist/endpoints/Contacts/index.cjs +2 -0
  12. package/dist/endpoints/ContactsExports/index.cjs +2 -0
  13. package/dist/endpoints/Coverage/index.cjs +2 -0
  14. package/dist/endpoints/Jobs/index.cjs +2 -0
  15. package/dist/endpoints/Licenses/index.cjs +1 -0
  16. package/dist/endpoints/NewsroomCategories/index.cjs +2 -0
  17. package/dist/endpoints/NewsroomContacts/index.cjs +2 -0
  18. package/dist/endpoints/NewsroomDomains/index.cjs +2 -0
  19. package/dist/endpoints/NewsroomGalleries/index.cjs +2 -0
  20. package/dist/endpoints/NewsroomHub/index.cjs +2 -0
  21. package/dist/endpoints/NewsroomLanguages/index.cjs +2 -0
  22. package/dist/endpoints/NewsroomPrivacyRequests/index.cjs +2 -0
  23. package/dist/endpoints/NewsroomSubscriptions/index.cjs +2 -0
  24. package/dist/endpoints/NewsroomThemes/index.cjs +1 -0
  25. package/dist/endpoints/NewsroomWebhooks/index.cjs +2 -0
  26. package/dist/endpoints/Newsrooms/index.cjs +2 -0
  27. package/dist/endpoints/NotificationSubscriptions/index.cjs +2 -0
  28. package/dist/endpoints/PricingTables/index.cjs +2 -0
  29. package/dist/endpoints/PricingTables/types.cjs +13 -17
  30. package/dist/endpoints/PricingTables/types.js +12 -12
  31. package/dist/endpoints/SenderAddresses/index.cjs +2 -0
  32. package/dist/endpoints/Snippets/index.cjs +2 -0
  33. package/dist/endpoints/Stories/Client.cjs +23 -4
  34. package/dist/endpoints/Stories/Client.js +22 -7
  35. package/dist/endpoints/Stories/index.cjs +3 -0
  36. package/dist/endpoints/Stories/scopes.cjs +2 -3
  37. package/dist/endpoints/Stories/types.cjs +14 -4
  38. package/dist/endpoints/Stories/types.js +13 -3
  39. package/dist/endpoints/Subscriptions/index.cjs +2 -0
  40. package/dist/endpoints/Subscriptions/types.cjs +3 -4
  41. package/dist/endpoints/Subscriptions/types.js +3 -3
  42. package/dist/endpoints/index.cjs +3 -3
  43. package/dist/http/constants.cjs +3 -6
  44. package/dist/http/index.cjs +8 -8
  45. package/dist/http/types.cjs +6 -8
  46. package/dist/http/types.js +6 -6
  47. package/dist/index.cjs +7 -4
  48. package/dist/routing.cjs +2 -3
  49. package/dist/types/BillingCycle.cjs +3 -4
  50. package/dist/types/BillingCycle.js +3 -3
  51. package/dist/types/Campaign.cjs +19 -20
  52. package/dist/types/Campaign.js +18 -18
  53. package/dist/types/Category.cjs +1 -2
  54. package/dist/types/Contact.cjs +19 -20
  55. package/dist/types/Contact.js +18 -18
  56. package/dist/types/ContactDuplicateSuggestion.cjs +5 -5
  57. package/dist/types/ContactDuplicateSuggestion.js +3 -4
  58. package/dist/types/ContactsExport.cjs +4 -5
  59. package/dist/types/ContactsExport.js +3 -3
  60. package/dist/types/ContactsScope.cjs +4 -5
  61. package/dist/types/ContactsScope.js +3 -3
  62. package/dist/types/CoverageEntry.cjs +7 -8
  63. package/dist/types/CoverageEntry.js +6 -6
  64. package/dist/types/Culture.cjs +10 -5
  65. package/dist/types/Culture.js +9 -3
  66. package/dist/types/Currency.cjs +3 -4
  67. package/dist/types/Currency.js +3 -3
  68. package/dist/types/EmailRecipient.cjs +4 -5
  69. package/dist/types/EmailRecipient.js +3 -3
  70. package/dist/types/JobState.cjs +3 -4
  71. package/dist/types/JobState.js +3 -3
  72. package/dist/types/License.cjs +10 -11
  73. package/dist/types/License.js +9 -9
  74. package/dist/types/Newsroom.cjs +13 -11
  75. package/dist/types/Newsroom.js +12 -9
  76. package/dist/types/NewsroomDomain.cjs +7 -8
  77. package/dist/types/NewsroomDomain.js +6 -6
  78. package/dist/types/NewsroomGallery.cjs +7 -8
  79. package/dist/types/NewsroomGallery.js +6 -6
  80. package/dist/types/NewsroomTheme.cjs +8 -11
  81. package/dist/types/NewsroomTheme.js +7 -8
  82. package/dist/types/NewsroomWebhook.cjs +4 -5
  83. package/dist/types/NewsroomWebhook.js +3 -3
  84. package/dist/types/NotificationSubscription.cjs +4 -5
  85. package/dist/types/NotificationSubscription.js +3 -3
  86. package/dist/types/Permissions.cjs +3 -4
  87. package/dist/types/Permissions.js +3 -3
  88. package/dist/types/Plan.cjs +7 -8
  89. package/dist/types/Plan.js +8 -8
  90. package/dist/types/PrivacyRequest.cjs +7 -8
  91. package/dist/types/PrivacyRequest.js +6 -6
  92. package/dist/types/SenderAddress.cjs +4 -5
  93. package/dist/types/SenderAddress.js +3 -3
  94. package/dist/types/SenderDomain.cjs +4 -5
  95. package/dist/types/SenderDomain.js +3 -3
  96. package/dist/types/SortOrder.cjs +4 -5
  97. package/dist/types/SortOrder.js +3 -3
  98. package/dist/types/Story.cjs +29 -18
  99. package/dist/types/Story.js +28 -16
  100. package/dist/types/User.cjs +7 -8
  101. package/dist/types/User.js +6 -6
  102. package/dist/types/common/Notification.cjs +4 -5
  103. package/dist/types/common/Notification.js +3 -3
  104. package/dist/types/common/OEmbedInfo.cjs +4 -5
  105. package/dist/types/common/OEmbedInfo.js +3 -3
  106. package/dist/types/common/Pagination.cjs +4 -4
  107. package/dist/types/common/Pagination.js +3 -3
  108. package/dist/types/common/Query.cjs +1 -2
  109. package/dist/types/common/Query.js +0 -1
  110. package/dist/types/common/index.cjs +6 -0
  111. package/dist/types/index.cjs +37 -0
  112. package/package.json +7 -7
@@ -1,9 +1,14 @@
1
1
  import { ApiError, HttpCodes } from "../../http/index.js";
2
2
  import { routing } from "../../routing.js";
3
3
  import { SortOrder } from "../../types/index.js";
4
- import { EXTENDED_STORY_INCLUDED_EXTRA_FIELDS } from "./types.js"; /**
5
- * `uuid` is the preferred way of targeting a Story. Numeric `id` is considered deprecated.
6
- */
4
+ import { EXTENDED_STORY_INCLUDED_EXTRA_FIELDS } from "./types.js";
5
+ /**
6
+ * `uuid` is the preferred way of targeting a Story. Numeric `id` is considered deprecated.
7
+ */
8
+ /**
9
+ * Utility type to forbid arbitrary ad-hoc extensions of generic parameters.
10
+ * @see https://stackoverflow.com/a/69666350
11
+ */
7
12
  export class Client {
8
13
  constructor(apiClient) {
9
14
  this.apiClient = apiClient;
@@ -55,6 +60,20 @@ export class Client {
55
60
  * Get story by UUID.
56
61
  */
57
62
 
63
+ /**
64
+ * Get multiple stories by UUIDs.
65
+ */
66
+
67
+ /**
68
+ * Get story by deprecated numeric ID, or UUID.
69
+ * @deprecated Please use UUID instead.
70
+ */
71
+
72
+ /**
73
+ * Get multiple stories by numeric IDs.
74
+ * @deprecated Please use UUID instead.
75
+ */
76
+
58
77
  /**
59
78
  * Implementation
60
79
  */
@@ -144,7 +163,6 @@ export class Client {
144
163
  include,
145
164
  force: force || undefined // only pass it if it's true
146
165
  },
147
-
148
166
  payload
149
167
  });
150
168
  return story;
@@ -203,7 +221,6 @@ export class Client {
203
221
  include,
204
222
  force: force || undefined // only pass it if it's true
205
223
  },
206
-
207
224
  payload
208
225
  });
209
226
  return {
@@ -232,7 +249,6 @@ export class Client {
232
249
  include,
233
250
  force: force || undefined // only pass it if it's true
234
251
  },
235
-
236
252
  payload
237
253
  });
238
254
  return story;
@@ -363,7 +379,6 @@ export class Client {
363
379
  force: force || undefined // only pass it if it's true
364
380
  }
365
381
  });
366
-
367
382
  return story;
368
383
  }
369
384
  async unpin(id, options) {
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  var _Client = require("./Client.cjs");
7
7
  Object.keys(_Client).forEach(function (key) {
8
8
  if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _Client[key]) return;
9
10
  Object.defineProperty(exports, key, {
10
11
  enumerable: true,
11
12
  get: function () {
@@ -16,6 +17,7 @@ Object.keys(_Client).forEach(function (key) {
16
17
  var _types = require("./types.cjs");
17
18
  Object.keys(_types).forEach(function (key) {
18
19
  if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _types[key]) return;
19
21
  Object.defineProperty(exports, key, {
20
22
  enumerable: true,
21
23
  get: function () {
@@ -26,6 +28,7 @@ Object.keys(_types).forEach(function (key) {
26
28
  var _scopes = require("./scopes.cjs");
27
29
  Object.keys(_scopes).forEach(function (key) {
28
30
  if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _scopes[key]) return;
29
32
  Object.defineProperty(exports, key, {
30
33
  enumerable: true,
31
34
  get: function () {
@@ -5,11 +5,10 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Scope = void 0;
7
7
  var _index = require("../../types/index.cjs");
8
- const Scope = {
8
+ const Scope = exports.Scope = {
9
9
  EXCLUDE_ARCHIVED_NEWSROOMS: {
10
10
  'newsroom.status': {
11
11
  $nin: [_index.Newsroom.Status.ARCHIVED]
12
12
  }
13
13
  }
14
- };
15
- exports.Scope = Scope;
14
+ };
@@ -5,6 +5,18 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.EXTENDED_STORY_INCLUDED_EXTRA_FIELDS = exports.ALL_EXTRA_FIELDS = void 0;
7
7
  var _index = require("../../types/index.cjs");
8
+ /**
9
+ * Uploadcare image JSON string.
10
+ */
11
+ /**
12
+ * Raw HTML string.
13
+ */
14
+ /**
15
+ * String-serialized JSON object.
16
+ */
17
+ /**
18
+ * String containing Prezly Content Format JSON structure.
19
+ */
8
20
  var Alignment = _index.Campaign.StoryAlignment;
9
21
  var Appearance = _index.Campaign.StoryAppearance;
10
22
  var HeaderFooter = _index.Campaign.StoryHeaderFooter;
@@ -41,7 +53,5 @@ const ALL_EXTRA_FIELDS_SHAPE = {
41
53
  'pitches.count': true
42
54
  }; // satisfies Record<keyof Story.OnDemandFields, boolean>; // TODO: Use Typescript `satisfies` operator, when it's out of beta
43
55
 
44
- const ALL_EXTRA_FIELDS = Object.keys(ALL_EXTRA_FIELDS_SHAPE);
45
- exports.ALL_EXTRA_FIELDS = ALL_EXTRA_FIELDS;
46
- const EXTENDED_STORY_INCLUDED_EXTRA_FIELDS = Object.keys(EXTENDED_STORY_INCLUDED_EXTRA_FIELDS_SHAPE);
47
- exports.EXTENDED_STORY_INCLUDED_EXTRA_FIELDS = EXTENDED_STORY_INCLUDED_EXTRA_FIELDS;
56
+ const ALL_EXTRA_FIELDS = exports.ALL_EXTRA_FIELDS = Object.keys(ALL_EXTRA_FIELDS_SHAPE);
57
+ const EXTENDED_STORY_INCLUDED_EXTRA_FIELDS = exports.EXTENDED_STORY_INCLUDED_EXTRA_FIELDS = Object.keys(EXTENDED_STORY_INCLUDED_EXTRA_FIELDS_SHAPE);
@@ -1,6 +1,16 @@
1
- import { Campaign } from "../../types/index.js"; /**
2
- * Uploadcare image JSON string.
3
- */
1
+ import { Campaign } from "../../types/index.js";
2
+ /**
3
+ * Uploadcare image JSON string.
4
+ */
5
+ /**
6
+ * Raw HTML string.
7
+ */
8
+ /**
9
+ * String-serialized JSON object.
10
+ */
11
+ /**
12
+ * String containing Prezly Content Format JSON structure.
13
+ */
4
14
  var Alignment = Campaign.StoryAlignment;
5
15
  var Appearance = Campaign.StoryAppearance;
6
16
  var HeaderFooter = Campaign.StoryHeaderFooter;
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  var _Client = require("./Client.cjs");
7
7
  Object.keys(_Client).forEach(function (key) {
8
8
  if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _Client[key]) return;
9
10
  Object.defineProperty(exports, key, {
10
11
  enumerable: true,
11
12
  get: function () {
@@ -16,6 +17,7 @@ Object.keys(_Client).forEach(function (key) {
16
17
  var _types = require("./types.cjs");
17
18
  Object.keys(_types).forEach(function (key) {
18
19
  if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _types[key]) return;
19
21
  Object.defineProperty(exports, key, {
20
22
  enumerable: true,
21
23
  get: function () {
@@ -4,12 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.UnsubscribeReason = void 0;
7
- let UnsubscribeReason;
8
- exports.UnsubscribeReason = UnsubscribeReason;
9
- (function (UnsubscribeReason) {
7
+ let UnsubscribeReason = exports.UnsubscribeReason = /*#__PURE__*/function (UnsubscribeReason) {
10
8
  UnsubscribeReason["UNKNOWN"] = "unknown";
11
9
  UnsubscribeReason["UNWANTED"] = "unwanted";
12
10
  UnsubscribeReason["SPAM"] = "spam";
13
11
  UnsubscribeReason["NEVER_SIGNED_UP"] = "never_signed_up";
14
12
  UnsubscribeReason["OTHER"] = "other";
15
- })(UnsubscribeReason || (exports.UnsubscribeReason = UnsubscribeReason = {}));
13
+ return UnsubscribeReason;
14
+ }({});
@@ -1,8 +1,8 @@
1
- export let UnsubscribeReason;
2
- (function (UnsubscribeReason) {
1
+ export let UnsubscribeReason = /*#__PURE__*/function (UnsubscribeReason) {
3
2
  UnsubscribeReason["UNKNOWN"] = "unknown";
4
3
  UnsubscribeReason["UNWANTED"] = "unwanted";
5
4
  UnsubscribeReason["SPAM"] = "spam";
6
5
  UnsubscribeReason["NEVER_SIGNED_UP"] = "never_signed_up";
7
6
  UnsubscribeReason["OTHER"] = "other";
8
- })(UnsubscribeReason || (UnsubscribeReason = {}));
7
+ return UnsubscribeReason;
8
+ }({});
@@ -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.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.Contacts = exports.Campaigns = exports.CampaignRecipients = exports.Billing = exports.Accounts = void 0;
6
+ exports.Subscriptions = exports.Stories = exports.Snippets = exports.SenderAddresses = exports.PricingTables = exports.NotificationSubscriptions = exports.Newsrooms = exports.NewsroomWebhooks = exports.NewsroomThemes = exports.NewsroomSubscriptions = exports.NewsroomPrivacyRequests = exports.NewsroomLanguages = exports.NewsroomHub = exports.NewsroomGalleries = exports.NewsroomDomains = exports.NewsroomContacts = exports.NewsroomCategories = exports.Licenses = exports.Jobs = exports.Coverage = exports.ContactsExports = exports.Contacts = 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"));
@@ -56,5 +56,5 @@ var _Subscriptions = _interopRequireWildcard(require("./Subscriptions/index.cjs"
56
56
  exports.Subscriptions = _Subscriptions;
57
57
  var _NotificationSubscriptions = _interopRequireWildcard(require("./NotificationSubscriptions/index.cjs"));
58
58
  exports.NotificationSubscriptions = _NotificationSubscriptions;
59
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
60
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
59
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
60
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -4,9 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.NETWORK_PROBLEM_ERROR_MESSAGE = exports.INVALID_URL_ERROR_MESSAGE = exports.CONTENT_TYPE = void 0;
7
- const CONTENT_TYPE = 'application/json;charset=utf-8';
8
- exports.CONTENT_TYPE = CONTENT_TYPE;
9
- const INVALID_URL_ERROR_MESSAGE = 'Invalid URL provided';
10
- exports.INVALID_URL_ERROR_MESSAGE = INVALID_URL_ERROR_MESSAGE;
11
- const NETWORK_PROBLEM_ERROR_MESSAGE = 'Network problem';
12
- exports.NETWORK_PROBLEM_ERROR_MESSAGE = NETWORK_PROBLEM_ERROR_MESSAGE;
7
+ const CONTENT_TYPE = exports.CONTENT_TYPE = 'application/json;charset=utf-8';
8
+ const INVALID_URL_ERROR_MESSAGE = exports.INVALID_URL_ERROR_MESSAGE = 'Invalid URL provided';
9
+ const NETWORK_PROBLEM_ERROR_MESSAGE = exports.NETWORK_PROBLEM_ERROR_MESSAGE = 'Network problem';
@@ -9,28 +9,28 @@ Object.defineProperty(exports, "ApiError", {
9
9
  return _ApiError.ApiError;
10
10
  }
11
11
  });
12
- Object.defineProperty(exports, "createHttpClient", {
12
+ Object.defineProperty(exports, "HttpCodes", {
13
13
  enumerable: true,
14
14
  get: function () {
15
- return _HttpClient.createHttpClient;
15
+ return _types.HttpCodes;
16
16
  }
17
17
  });
18
- Object.defineProperty(exports, "isDeferredJobResponse", {
18
+ Object.defineProperty(exports, "Method", {
19
19
  enumerable: true,
20
20
  get: function () {
21
- return _lib.isDeferredJobResponse;
21
+ return _types.Method;
22
22
  }
23
23
  });
24
- Object.defineProperty(exports, "HttpCodes", {
24
+ Object.defineProperty(exports, "createHttpClient", {
25
25
  enumerable: true,
26
26
  get: function () {
27
- return _types.HttpCodes;
27
+ return _HttpClient.createHttpClient;
28
28
  }
29
29
  });
30
- Object.defineProperty(exports, "Method", {
30
+ Object.defineProperty(exports, "isDeferredJobResponse", {
31
31
  enumerable: true,
32
32
  get: function () {
33
- return _types.Method;
33
+ return _lib.isDeferredJobResponse;
34
34
  }
35
35
  });
36
36
  var _ApiError = require("./ApiError.cjs");
@@ -4,22 +4,20 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Method = exports.HttpCodes = void 0;
7
- let HttpCodes;
8
- exports.HttpCodes = HttpCodes;
9
- (function (HttpCodes) {
7
+ let HttpCodes = exports.HttpCodes = /*#__PURE__*/function (HttpCodes) {
10
8
  HttpCodes[HttpCodes["ACCEPTED"] = 202] = "ACCEPTED";
11
9
  HttpCodes[HttpCodes["NO_CONTENT"] = 204] = "NO_CONTENT";
12
10
  HttpCodes[HttpCodes["NOT_FOUND"] = 404] = "NOT_FOUND";
13
11
  HttpCodes[HttpCodes["CONFLICT"] = 409] = "CONFLICT";
14
12
  HttpCodes[HttpCodes["GONE"] = 410] = "GONE";
15
13
  HttpCodes[HttpCodes["PRECONDITION_FAILED"] = 412] = "PRECONDITION_FAILED";
16
- })(HttpCodes || (exports.HttpCodes = HttpCodes = {}));
17
- let Method;
18
- exports.Method = Method;
19
- (function (Method) {
14
+ return HttpCodes;
15
+ }({});
16
+ let Method = exports.Method = /*#__PURE__*/function (Method) {
20
17
  Method["DELETE"] = "DELETE";
21
18
  Method["GET"] = "GET";
22
19
  Method["PATCH"] = "PATCH";
23
20
  Method["POST"] = "POST";
24
21
  Method["PUT"] = "PUT";
25
- })(Method || (exports.Method = Method = {}));
22
+ return Method;
23
+ }({});
@@ -1,17 +1,17 @@
1
- export let HttpCodes;
2
- (function (HttpCodes) {
1
+ export let HttpCodes = /*#__PURE__*/function (HttpCodes) {
3
2
  HttpCodes[HttpCodes["ACCEPTED"] = 202] = "ACCEPTED";
4
3
  HttpCodes[HttpCodes["NO_CONTENT"] = 204] = "NO_CONTENT";
5
4
  HttpCodes[HttpCodes["NOT_FOUND"] = 404] = "NOT_FOUND";
6
5
  HttpCodes[HttpCodes["CONFLICT"] = 409] = "CONFLICT";
7
6
  HttpCodes[HttpCodes["GONE"] = 410] = "GONE";
8
7
  HttpCodes[HttpCodes["PRECONDITION_FAILED"] = 412] = "PRECONDITION_FAILED";
9
- })(HttpCodes || (HttpCodes = {}));
10
- export let Method;
11
- (function (Method) {
8
+ return HttpCodes;
9
+ }({});
10
+ export let Method = /*#__PURE__*/function (Method) {
12
11
  Method["DELETE"] = "DELETE";
13
12
  Method["GET"] = "GET";
14
13
  Method["PATCH"] = "PATCH";
15
14
  Method["POST"] = "POST";
16
15
  Method["PUT"] = "PUT";
17
- })(Method || (Method = {}));
16
+ return Method;
17
+ }({});
package/dist/index.cjs CHANGED
@@ -7,22 +7,23 @@ var _exportNames = {
7
7
  createPrezlyClient: true,
8
8
  ApiError: true
9
9
  };
10
- Object.defineProperty(exports, "createPrezlyClient", {
10
+ Object.defineProperty(exports, "ApiError", {
11
11
  enumerable: true,
12
12
  get: function () {
13
- return _Client.createClient;
13
+ return _index.ApiError;
14
14
  }
15
15
  });
16
- Object.defineProperty(exports, "ApiError", {
16
+ Object.defineProperty(exports, "createPrezlyClient", {
17
17
  enumerable: true,
18
18
  get: function () {
19
- return _index.ApiError;
19
+ return _Client.createClient;
20
20
  }
21
21
  });
22
22
  var _uploads = require("@prezly/uploads");
23
23
  Object.keys(_uploads).forEach(function (key) {
24
24
  if (key === "default" || key === "__esModule") return;
25
25
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
26
+ if (key in exports && exports[key] === _uploads[key]) return;
26
27
  Object.defineProperty(exports, key, {
27
28
  enumerable: true,
28
29
  get: function () {
@@ -36,6 +37,7 @@ var _index2 = require("./endpoints/index.cjs");
36
37
  Object.keys(_index2).forEach(function (key) {
37
38
  if (key === "default" || key === "__esModule") return;
38
39
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
40
+ if (key in exports && exports[key] === _index2[key]) return;
39
41
  Object.defineProperty(exports, key, {
40
42
  enumerable: true,
41
43
  get: function () {
@@ -47,6 +49,7 @@ var _index3 = require("./types/index.cjs");
47
49
  Object.keys(_index3).forEach(function (key) {
48
50
  if (key === "default" || key === "__esModule") return;
49
51
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
52
+ if (key in exports && exports[key] === _index3[key]) return;
50
53
  Object.defineProperty(exports, key, {
51
54
  enumerable: true,
52
55
  get: function () {
package/dist/routing.cjs CHANGED
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.routing = void 0;
7
- const routing = {
7
+ const routing = exports.routing = {
8
8
  accounts: '/v2/accounts',
9
9
  billing: 'v2/billing',
10
10
  campaignsUrl: '/v2/campaigns',
@@ -36,5 +36,4 @@ const routing = {
36
36
  storiesSearchUrl: '/v2/stories/search',
37
37
  storyCoverageUrl: '/v1/stories/:story_id/reports/coverage',
38
38
  snippetsUrl: '/v2/snippets'
39
- };
40
- exports.routing = routing;
39
+ };
@@ -4,9 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.BillingCycle = void 0;
7
- let BillingCycle;
8
- exports.BillingCycle = BillingCycle;
9
- (function (BillingCycle) {
7
+ let BillingCycle = exports.BillingCycle = /*#__PURE__*/function (BillingCycle) {
10
8
  BillingCycle["YEAR"] = "year";
11
9
  BillingCycle["MONTH"] = "month";
12
- })(BillingCycle || (exports.BillingCycle = BillingCycle = {}));
10
+ return BillingCycle;
11
+ }({});
@@ -1,5 +1,5 @@
1
- export let BillingCycle;
2
- (function (BillingCycle) {
1
+ export let BillingCycle = /*#__PURE__*/function (BillingCycle) {
3
2
  BillingCycle["YEAR"] = "year";
4
3
  BillingCycle["MONTH"] = "month";
5
- })(BillingCycle || (BillingCycle = {}));
4
+ return BillingCycle;
5
+ }({});
@@ -5,51 +5,50 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Campaign = void 0;
7
7
  var _SenderDomain = require("./SenderDomain.cjs");
8
- let Campaign;
9
- exports.Campaign = Campaign;
8
+ let Campaign = exports.Campaign = void 0;
10
9
  (function (_Campaign) {
11
10
  const SenderDomainVerificationFlow = _Campaign.SenderDomainVerificationFlow = _SenderDomain.SenderDomain.VerificationFlowVersion;
12
- let LifecycleStatus;
13
- (function (LifecycleStatus) {
11
+ let LifecycleStatus = /*#__PURE__*/function (LifecycleStatus) {
14
12
  LifecycleStatus["DRAFT"] = "draft";
15
13
  LifecycleStatus["SCHEDULED"] = "scheduled";
16
14
  LifecycleStatus["PENDING"] = "pending";
17
15
  LifecycleStatus["SENT"] = "sent";
18
- })(LifecycleStatus || (LifecycleStatus = {}));
16
+ return LifecycleStatus;
17
+ }({});
19
18
  _Campaign.LifecycleStatus = LifecycleStatus;
20
- let StoryAlignment;
21
- (function (StoryAlignment) {
19
+ let StoryAlignment = /*#__PURE__*/function (StoryAlignment) {
22
20
  StoryAlignment["CENTER"] = "center";
23
21
  StoryAlignment["LEFT"] = "left";
24
22
  StoryAlignment["RIGHT"] = "right";
25
- })(StoryAlignment || (StoryAlignment = {}));
23
+ return StoryAlignment;
24
+ }({});
26
25
  _Campaign.StoryAlignment = StoryAlignment;
27
- let StoryAppearance;
28
- (function (StoryAppearance) {
26
+ let StoryAppearance = /*#__PURE__*/function (StoryAppearance) {
29
27
  StoryAppearance["INTRO"] = "intro";
30
28
  StoryAppearance["FULL"] = "full";
31
- })(StoryAppearance || (StoryAppearance = {}));
29
+ return StoryAppearance;
30
+ }({});
32
31
  _Campaign.StoryAppearance = StoryAppearance;
33
- let StoryHeaderFooter;
34
- (function (StoryHeaderFooter) {
32
+ let StoryHeaderFooter = /*#__PURE__*/function (StoryHeaderFooter) {
35
33
  StoryHeaderFooter["NONE"] = "none";
36
34
  StoryHeaderFooter["STANDARD"] = "standard";
37
35
  StoryHeaderFooter["FULL"] = "full";
38
- })(StoryHeaderFooter || (StoryHeaderFooter = {}));
36
+ return StoryHeaderFooter;
37
+ }({});
39
38
  _Campaign.StoryHeaderFooter = StoryHeaderFooter;
40
- let SenderDomainVerificationStatus;
41
- (function (SenderDomainVerificationStatus) {
39
+ let SenderDomainVerificationStatus = /*#__PURE__*/function (SenderDomainVerificationStatus) {
42
40
  SenderDomainVerificationStatus["UNKNOWN"] = "unknown";
43
41
  SenderDomainVerificationStatus["VALID"] = "valid";
44
42
  SenderDomainVerificationStatus["INVALID"] = "invalid";
45
43
  SenderDomainVerificationStatus["NOT_APPLICABLE"] = "not-applicable";
46
- })(SenderDomainVerificationStatus || (SenderDomainVerificationStatus = {}));
44
+ return SenderDomainVerificationStatus;
45
+ }({});
47
46
  _Campaign.SenderDomainVerificationStatus = SenderDomainVerificationStatus;
48
- let ClickTrackingVersion;
49
- (function (ClickTrackingVersion) {
47
+ let ClickTrackingVersion = /*#__PURE__*/function (ClickTrackingVersion) {
50
48
  ClickTrackingVersion[ClickTrackingVersion["DEPRECATED"] = 1] = "DEPRECATED";
51
49
  ClickTrackingVersion[ClickTrackingVersion["ENHANCED"] = 2] = "ENHANCED";
52
- })(ClickTrackingVersion || (ClickTrackingVersion = {}));
50
+ return ClickTrackingVersion;
51
+ }({});
53
52
  _Campaign.ClickTrackingVersion = ClickTrackingVersion;
54
53
  function isDraft(arg) {
55
54
  if (typeof arg === 'object') {
@@ -2,47 +2,47 @@ import { SenderDomain } from "./SenderDomain.js";
2
2
  export let Campaign;
3
3
  (function (_Campaign) {
4
4
  const SenderDomainVerificationFlow = _Campaign.SenderDomainVerificationFlow = SenderDomain.VerificationFlowVersion;
5
- let LifecycleStatus;
6
- (function (LifecycleStatus) {
5
+ let LifecycleStatus = /*#__PURE__*/function (LifecycleStatus) {
7
6
  LifecycleStatus["DRAFT"] = "draft";
8
7
  LifecycleStatus["SCHEDULED"] = "scheduled";
9
8
  LifecycleStatus["PENDING"] = "pending";
10
9
  LifecycleStatus["SENT"] = "sent";
11
- })(LifecycleStatus || (LifecycleStatus = {}));
10
+ return LifecycleStatus;
11
+ }({});
12
12
  _Campaign.LifecycleStatus = LifecycleStatus;
13
- let StoryAlignment;
14
- (function (StoryAlignment) {
13
+ let StoryAlignment = /*#__PURE__*/function (StoryAlignment) {
15
14
  StoryAlignment["CENTER"] = "center";
16
15
  StoryAlignment["LEFT"] = "left";
17
16
  StoryAlignment["RIGHT"] = "right";
18
- })(StoryAlignment || (StoryAlignment = {}));
17
+ return StoryAlignment;
18
+ }({});
19
19
  _Campaign.StoryAlignment = StoryAlignment;
20
- let StoryAppearance;
21
- (function (StoryAppearance) {
20
+ let StoryAppearance = /*#__PURE__*/function (StoryAppearance) {
22
21
  StoryAppearance["INTRO"] = "intro";
23
22
  StoryAppearance["FULL"] = "full";
24
- })(StoryAppearance || (StoryAppearance = {}));
23
+ return StoryAppearance;
24
+ }({});
25
25
  _Campaign.StoryAppearance = StoryAppearance;
26
- let StoryHeaderFooter;
27
- (function (StoryHeaderFooter) {
26
+ let StoryHeaderFooter = /*#__PURE__*/function (StoryHeaderFooter) {
28
27
  StoryHeaderFooter["NONE"] = "none";
29
28
  StoryHeaderFooter["STANDARD"] = "standard";
30
29
  StoryHeaderFooter["FULL"] = "full";
31
- })(StoryHeaderFooter || (StoryHeaderFooter = {}));
30
+ return StoryHeaderFooter;
31
+ }({});
32
32
  _Campaign.StoryHeaderFooter = StoryHeaderFooter;
33
- let SenderDomainVerificationStatus;
34
- (function (SenderDomainVerificationStatus) {
33
+ let SenderDomainVerificationStatus = /*#__PURE__*/function (SenderDomainVerificationStatus) {
35
34
  SenderDomainVerificationStatus["UNKNOWN"] = "unknown";
36
35
  SenderDomainVerificationStatus["VALID"] = "valid";
37
36
  SenderDomainVerificationStatus["INVALID"] = "invalid";
38
37
  SenderDomainVerificationStatus["NOT_APPLICABLE"] = "not-applicable";
39
- })(SenderDomainVerificationStatus || (SenderDomainVerificationStatus = {}));
38
+ return SenderDomainVerificationStatus;
39
+ }({});
40
40
  _Campaign.SenderDomainVerificationStatus = SenderDomainVerificationStatus;
41
- let ClickTrackingVersion;
42
- (function (ClickTrackingVersion) {
41
+ let ClickTrackingVersion = /*#__PURE__*/function (ClickTrackingVersion) {
43
42
  ClickTrackingVersion[ClickTrackingVersion["DEPRECATED"] = 1] = "DEPRECATED";
44
43
  ClickTrackingVersion[ClickTrackingVersion["ENHANCED"] = 2] = "ENHANCED";
45
- })(ClickTrackingVersion || (ClickTrackingVersion = {}));
44
+ return ClickTrackingVersion;
45
+ }({});
46
46
  _Campaign.ClickTrackingVersion = ClickTrackingVersion;
47
47
  function isDraft(arg) {
48
48
  if (typeof arg === 'object') {
@@ -4,8 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Category = void 0;
7
- let Category;
8
- exports.Category = Category;
7
+ let Category = exports.Category = void 0;
9
8
  (function (_Category) {
10
9
  function isTranslated(category, locale) {
11
10
  const translation = category.i18n[localeCode(locale)];
@@ -4,24 +4,22 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Contact = void 0;
7
- let Contact;
8
- exports.Contact = Contact;
7
+ let Contact = exports.Contact = void 0;
9
8
  (function (_Contact) {
10
- let Type;
11
- (function (Type) {
9
+ let Type = /*#__PURE__*/function (Type) {
12
10
  Type["PERSON"] = "person";
13
11
  Type["ORGANISATION"] = "organisation";
14
- })(Type || (Type = {}));
12
+ return Type;
13
+ }({});
15
14
  _Contact.Type = Type;
16
- let Gender;
17
- (function (Gender) {
15
+ let Gender = /*#__PURE__*/function (Gender) {
18
16
  Gender["MALE"] = "male";
19
17
  Gender["FEMALE"] = "female";
20
18
  Gender["UNSPECIFIED"] = "unspecified";
21
- })(Gender || (Gender = {}));
19
+ return Gender;
20
+ }({});
22
21
  _Contact.Gender = Gender;
23
- let Periodicity;
24
- (function (Periodicity) {
22
+ let Periodicity = /*#__PURE__*/function (Periodicity) {
25
23
  Periodicity["DAILY"] = "daily";
26
24
  Periodicity["WEEKDAYS"] = "weekdays";
27
25
  Periodicity["WEEKLY"] = "weekly";
@@ -32,10 +30,10 @@ exports.Contact = Contact;
32
30
  Periodicity["ANNUALLY"] = "annually";
33
31
  Periodicity["BI_ANUALLY"] = "bi-annually";
34
32
  Periodicity["SEMI_ANNUALLY"] = "semi-annually";
35
- })(Periodicity || (Periodicity = {}));
33
+ return Periodicity;
34
+ }({});
36
35
  _Contact.Periodicity = Periodicity;
37
- let MediumType;
38
- (function (MediumType) {
36
+ let MediumType = /*#__PURE__*/function (MediumType) {
39
37
  MediumType["WIRE"] = "wire";
40
38
  MediumType["PRINT"] = "print";
41
39
  MediumType["RADIO"] = "radio";
@@ -53,10 +51,10 @@ exports.Contact = Contact;
53
51
  MediumType["PODCAST"] = "podcast";
54
52
  MediumType["NEWSLETTER"] = "newsletter";
55
53
  MediumType["NEWS_SITE"] = "news website";
56
- })(MediumType || (MediumType = {}));
54
+ return MediumType;
55
+ }({});
57
56
  _Contact.MediumType = MediumType;
58
- let SocialNetwork;
59
- (function (SocialNetwork) {
57
+ let SocialNetwork = /*#__PURE__*/function (SocialNetwork) {
60
58
  SocialNetwork["DISCORD"] = "discord";
61
59
  SocialNetwork["FACEBOOK"] = "facebook";
62
60
  SocialNetwork["INSTAGRAM"] = "instagram";
@@ -68,15 +66,16 @@ exports.Contact = Contact;
68
66
  SocialNetwork["TWITCH"] = "twitch";
69
67
  SocialNetwork["TWITTER"] = "twitter";
70
68
  SocialNetwork["YOUTUBE"] = "youtube";
71
- })(SocialNetwork || (SocialNetwork = {}));
69
+ return SocialNetwork;
70
+ }({});
72
71
  _Contact.SocialNetwork = SocialNetwork;
73
72
  let PhoneNumber;
74
73
  (function (_PhoneNumber) {
75
- let Type;
76
- (function (Type) {
74
+ let Type = /*#__PURE__*/function (Type) {
77
75
  Type["TELEPHONE"] = "tel";
78
76
  Type["CELLPHONE"] = "cell";
79
- })(Type || (Type = {}));
77
+ return Type;
78
+ }({});
80
79
  _PhoneNumber.Type = Type;
81
80
  })(PhoneNumber || (PhoneNumber = _Contact.PhoneNumber || (_Contact.PhoneNumber = {})));
82
81
  function isPerson(arg) {