@prezly/sdk 19.7.0 → 19.8.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.
Files changed (114) hide show
  1. package/dist/api/DeferredJobsApiClient.cjs +1 -0
  2. package/dist/api/DeferredJobsApiClient.js +1 -0
  3. package/dist/api/constants.cjs +3 -2
  4. package/dist/api/constants.js +1 -1
  5. package/dist/endpoints/Accounts/index.cjs +0 -2
  6. package/dist/endpoints/Billing/index.cjs +0 -2
  7. package/dist/endpoints/Billing/types.cjs +9 -7
  8. package/dist/endpoints/Billing/types.js +6 -6
  9. package/dist/endpoints/CampaignRecipients/index.cjs +0 -2
  10. package/dist/endpoints/Campaigns/index.cjs +0 -2
  11. package/dist/endpoints/Contacts/index.cjs +0 -2
  12. package/dist/endpoints/ContactsExports/index.cjs +0 -2
  13. package/dist/endpoints/Coverage/index.cjs +0 -2
  14. package/dist/endpoints/Jobs/index.cjs +0 -2
  15. package/dist/endpoints/Licenses/index.cjs +0 -1
  16. package/dist/endpoints/NewsroomCategories/index.cjs +0 -2
  17. package/dist/endpoints/NewsroomContacts/index.cjs +0 -2
  18. package/dist/endpoints/NewsroomDomains/index.cjs +0 -2
  19. package/dist/endpoints/NewsroomGalleries/index.cjs +0 -2
  20. package/dist/endpoints/NewsroomHub/index.cjs +0 -2
  21. package/dist/endpoints/NewsroomLanguages/index.cjs +0 -2
  22. package/dist/endpoints/NewsroomPrivacyRequests/index.cjs +0 -2
  23. package/dist/endpoints/NewsroomSubscriptions/index.cjs +0 -2
  24. package/dist/endpoints/NewsroomThemes/index.cjs +0 -1
  25. package/dist/endpoints/NewsroomWebhooks/index.cjs +0 -2
  26. package/dist/endpoints/Newsrooms/index.cjs +0 -2
  27. package/dist/endpoints/NotificationSubscriptions/index.cjs +0 -2
  28. package/dist/endpoints/PricingTables/index.cjs +0 -2
  29. package/dist/endpoints/PricingTables/types.cjs +17 -13
  30. package/dist/endpoints/PricingTables/types.js +12 -12
  31. package/dist/endpoints/SenderAddresses/index.cjs +0 -2
  32. package/dist/endpoints/Snippets/index.cjs +0 -2
  33. package/dist/endpoints/Stories/Client.cjs +4 -23
  34. package/dist/endpoints/Stories/Client.js +7 -22
  35. package/dist/endpoints/Stories/index.cjs +0 -3
  36. package/dist/endpoints/Stories/scopes.cjs +3 -2
  37. package/dist/endpoints/Stories/types.cjs +4 -14
  38. package/dist/endpoints/Stories/types.js +3 -13
  39. package/dist/endpoints/Subscriptions/index.cjs +0 -2
  40. package/dist/endpoints/Subscriptions/types.cjs +4 -3
  41. package/dist/endpoints/Subscriptions/types.d.ts +5 -0
  42. package/dist/endpoints/Subscriptions/types.js +3 -3
  43. package/dist/endpoints/index.cjs +3 -3
  44. package/dist/http/constants.cjs +6 -3
  45. package/dist/http/index.cjs +8 -8
  46. package/dist/http/types.cjs +8 -6
  47. package/dist/http/types.js +6 -6
  48. package/dist/index.cjs +4 -7
  49. package/dist/routing.cjs +3 -2
  50. package/dist/types/BillingCycle.cjs +4 -3
  51. package/dist/types/BillingCycle.js +3 -3
  52. package/dist/types/Campaign.cjs +20 -19
  53. package/dist/types/Campaign.js +18 -18
  54. package/dist/types/Category.cjs +2 -1
  55. package/dist/types/Contact.cjs +20 -19
  56. package/dist/types/Contact.js +18 -18
  57. package/dist/types/ContactDuplicateSuggestion.cjs +5 -5
  58. package/dist/types/ContactDuplicateSuggestion.js +4 -3
  59. package/dist/types/ContactsExport.cjs +5 -4
  60. package/dist/types/ContactsExport.js +3 -3
  61. package/dist/types/ContactsScope.cjs +5 -4
  62. package/dist/types/ContactsScope.js +3 -3
  63. package/dist/types/CoverageEntry.cjs +8 -7
  64. package/dist/types/CoverageEntry.js +6 -6
  65. package/dist/types/Culture.cjs +5 -10
  66. package/dist/types/Culture.js +3 -9
  67. package/dist/types/Currency.cjs +4 -3
  68. package/dist/types/Currency.js +3 -3
  69. package/dist/types/EmailRecipient.cjs +5 -4
  70. package/dist/types/EmailRecipient.js +3 -3
  71. package/dist/types/EmailSubscription.d.ts +2 -0
  72. package/dist/types/JobState.cjs +4 -3
  73. package/dist/types/JobState.js +3 -3
  74. package/dist/types/License.cjs +11 -10
  75. package/dist/types/License.js +9 -9
  76. package/dist/types/Newsroom.cjs +14 -16
  77. package/dist/types/Newsroom.js +12 -15
  78. package/dist/types/NewsroomDomain.cjs +8 -7
  79. package/dist/types/NewsroomDomain.js +6 -6
  80. package/dist/types/NewsroomGallery.cjs +8 -7
  81. package/dist/types/NewsroomGallery.js +6 -6
  82. package/dist/types/NewsroomTheme.cjs +11 -8
  83. package/dist/types/NewsroomTheme.js +8 -7
  84. package/dist/types/NewsroomWebhook.cjs +5 -4
  85. package/dist/types/NewsroomWebhook.js +3 -3
  86. package/dist/types/NotificationSubscription.cjs +5 -4
  87. package/dist/types/NotificationSubscription.js +3 -3
  88. package/dist/types/Permissions.cjs +4 -3
  89. package/dist/types/Permissions.js +3 -3
  90. package/dist/types/Plan.cjs +8 -7
  91. package/dist/types/Plan.js +8 -8
  92. package/dist/types/PrivacyRequest.cjs +8 -7
  93. package/dist/types/PrivacyRequest.js +6 -6
  94. package/dist/types/SenderAddress.cjs +5 -4
  95. package/dist/types/SenderAddress.js +3 -3
  96. package/dist/types/SenderDomain.cjs +5 -4
  97. package/dist/types/SenderDomain.js +3 -3
  98. package/dist/types/SortOrder.cjs +5 -4
  99. package/dist/types/SortOrder.js +3 -3
  100. package/dist/types/Story.cjs +18 -29
  101. package/dist/types/Story.js +16 -28
  102. package/dist/types/User.cjs +8 -7
  103. package/dist/types/User.js +6 -6
  104. package/dist/types/common/Notification.cjs +5 -4
  105. package/dist/types/common/Notification.js +3 -3
  106. package/dist/types/common/OEmbedInfo.cjs +5 -4
  107. package/dist/types/common/OEmbedInfo.js +3 -3
  108. package/dist/types/common/Pagination.cjs +4 -4
  109. package/dist/types/common/Pagination.js +3 -3
  110. package/dist/types/common/Query.cjs +2 -1
  111. package/dist/types/common/Query.js +1 -0
  112. package/dist/types/common/index.cjs +0 -6
  113. package/dist/types/index.cjs +0 -37
  114. package/package.json +1 -1
@@ -1,14 +1,9 @@
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
- /**
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
- */
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
+ */
12
7
  export class Client {
13
8
  constructor(apiClient) {
14
9
  this.apiClient = apiClient;
@@ -60,20 +55,6 @@ export class Client {
60
55
  * Get story by UUID.
61
56
  */
62
57
 
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
-
77
58
  /**
78
59
  * Implementation
79
60
  */
@@ -163,6 +144,7 @@ export class Client {
163
144
  include,
164
145
  force: force || undefined // only pass it if it's true
165
146
  },
147
+
166
148
  payload
167
149
  });
168
150
  return story;
@@ -221,6 +203,7 @@ export class Client {
221
203
  include,
222
204
  force: force || undefined // only pass it if it's true
223
205
  },
206
+
224
207
  payload
225
208
  });
226
209
  return {
@@ -249,6 +232,7 @@ export class Client {
249
232
  include,
250
233
  force: force || undefined // only pass it if it's true
251
234
  },
235
+
252
236
  payload
253
237
  });
254
238
  return story;
@@ -379,6 +363,7 @@ export class Client {
379
363
  force: force || undefined // only pass it if it's true
380
364
  }
381
365
  });
366
+
382
367
  return story;
383
368
  }
384
369
  async unpin(id, options) {
@@ -6,7 +6,6 @@ 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;
10
9
  Object.defineProperty(exports, key, {
11
10
  enumerable: true,
12
11
  get: function () {
@@ -17,7 +16,6 @@ Object.keys(_Client).forEach(function (key) {
17
16
  var _types = require("./types.cjs");
18
17
  Object.keys(_types).forEach(function (key) {
19
18
  if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _types[key]) return;
21
19
  Object.defineProperty(exports, key, {
22
20
  enumerable: true,
23
21
  get: function () {
@@ -28,7 +26,6 @@ Object.keys(_types).forEach(function (key) {
28
26
  var _scopes = require("./scopes.cjs");
29
27
  Object.keys(_scopes).forEach(function (key) {
30
28
  if (key === "default" || key === "__esModule") return;
31
- if (key in exports && exports[key] === _scopes[key]) return;
32
29
  Object.defineProperty(exports, key, {
33
30
  enumerable: true,
34
31
  get: function () {
@@ -5,10 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Scope = void 0;
7
7
  var _index = require("../../types/index.cjs");
8
- const Scope = exports.Scope = {
8
+ const Scope = {
9
9
  EXCLUDE_ARCHIVED_NEWSROOMS: {
10
10
  'newsroom.status': {
11
11
  $nin: [_index.Newsroom.Status.ARCHIVED]
12
12
  }
13
13
  }
14
- };
14
+ };
15
+ exports.Scope = Scope;
@@ -5,18 +5,6 @@ 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
- */
20
8
  var Alignment = _index.Campaign.StoryAlignment;
21
9
  var Appearance = _index.Campaign.StoryAppearance;
22
10
  var HeaderFooter = _index.Campaign.StoryHeaderFooter;
@@ -53,5 +41,7 @@ const ALL_EXTRA_FIELDS_SHAPE = {
53
41
  'pitches.count': true
54
42
  }; // satisfies Record<keyof Story.OnDemandFields, boolean>; // TODO: Use Typescript `satisfies` operator, when it's out of beta
55
43
 
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);
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;
@@ -1,16 +1,6 @@
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
- */
1
+ import { Campaign } from "../../types/index.js"; /**
2
+ * Uploadcare image JSON string.
3
+ */
14
4
  var Alignment = Campaign.StoryAlignment;
15
5
  var Appearance = Campaign.StoryAppearance;
16
6
  var HeaderFooter = Campaign.StoryHeaderFooter;
@@ -6,7 +6,6 @@ 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;
10
9
  Object.defineProperty(exports, key, {
11
10
  enumerable: true,
12
11
  get: function () {
@@ -17,7 +16,6 @@ Object.keys(_Client).forEach(function (key) {
17
16
  var _types = require("./types.cjs");
18
17
  Object.keys(_types).forEach(function (key) {
19
18
  if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _types[key]) return;
21
19
  Object.defineProperty(exports, key, {
22
20
  enumerable: true,
23
21
  get: function () {
@@ -4,11 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.UnsubscribeReason = void 0;
7
- let UnsubscribeReason = exports.UnsubscribeReason = /*#__PURE__*/function (UnsubscribeReason) {
7
+ let UnsubscribeReason;
8
+ exports.UnsubscribeReason = UnsubscribeReason;
9
+ (function (UnsubscribeReason) {
8
10
  UnsubscribeReason["UNKNOWN"] = "unknown";
9
11
  UnsubscribeReason["UNWANTED"] = "unwanted";
10
12
  UnsubscribeReason["SPAM"] = "spam";
11
13
  UnsubscribeReason["NEVER_SIGNED_UP"] = "never_signed_up";
12
14
  UnsubscribeReason["OTHER"] = "other";
13
- return UnsubscribeReason;
14
- }({});
15
+ })(UnsubscribeReason || (exports.UnsubscribeReason = UnsubscribeReason = {}));
@@ -14,11 +14,16 @@ interface Organisation {
14
14
  }
15
15
  export interface SubscribeRequest<Type extends Contact.Type> {
16
16
  email_address: string;
17
+ first_name?: string | null;
18
+ last_name?: string | null;
17
19
  locale?: string;
18
20
  url?: string;
19
21
  visitor_uid?: string;
20
22
  session_uid?: string;
21
23
  comment?: string;
24
+ /**
25
+ * @deprecated Please use Contacts instead
26
+ */
22
27
  contact?: (Type extends Contact.Type.PERSON ? Person : Organisation) & {
23
28
  avatar_image?: UploadedImage | null;
24
29
  languages?: string[];
@@ -1,8 +1,8 @@
1
- export let UnsubscribeReason = /*#__PURE__*/function (UnsubscribeReason) {
1
+ export let UnsubscribeReason;
2
+ (function (UnsubscribeReason) {
2
3
  UnsubscribeReason["UNKNOWN"] = "unknown";
3
4
  UnsubscribeReason["UNWANTED"] = "unwanted";
4
5
  UnsubscribeReason["SPAM"] = "spam";
5
6
  UnsubscribeReason["NEVER_SIGNED_UP"] = "never_signed_up";
6
7
  UnsubscribeReason["OTHER"] = "other";
7
- return UnsubscribeReason;
8
- }({});
8
+ })(UnsubscribeReason || (UnsubscribeReason = {}));
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
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;
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;
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(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; }
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; }
@@ -4,6 +4,9 @@ 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 = 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';
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;
@@ -9,28 +9,28 @@ Object.defineProperty(exports, "ApiError", {
9
9
  return _ApiError.ApiError;
10
10
  }
11
11
  });
12
- Object.defineProperty(exports, "HttpCodes", {
12
+ Object.defineProperty(exports, "createHttpClient", {
13
13
  enumerable: true,
14
14
  get: function () {
15
- return _types.HttpCodes;
15
+ return _HttpClient.createHttpClient;
16
16
  }
17
17
  });
18
- Object.defineProperty(exports, "Method", {
18
+ Object.defineProperty(exports, "isDeferredJobResponse", {
19
19
  enumerable: true,
20
20
  get: function () {
21
- return _types.Method;
21
+ return _lib.isDeferredJobResponse;
22
22
  }
23
23
  });
24
- Object.defineProperty(exports, "createHttpClient", {
24
+ Object.defineProperty(exports, "HttpCodes", {
25
25
  enumerable: true,
26
26
  get: function () {
27
- return _HttpClient.createHttpClient;
27
+ return _types.HttpCodes;
28
28
  }
29
29
  });
30
- Object.defineProperty(exports, "isDeferredJobResponse", {
30
+ Object.defineProperty(exports, "Method", {
31
31
  enumerable: true,
32
32
  get: function () {
33
- return _lib.isDeferredJobResponse;
33
+ return _types.Method;
34
34
  }
35
35
  });
36
36
  var _ApiError = require("./ApiError.cjs");
@@ -4,20 +4,22 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Method = exports.HttpCodes = void 0;
7
- let HttpCodes = exports.HttpCodes = /*#__PURE__*/function (HttpCodes) {
7
+ let HttpCodes;
8
+ exports.HttpCodes = HttpCodes;
9
+ (function (HttpCodes) {
8
10
  HttpCodes[HttpCodes["ACCEPTED"] = 202] = "ACCEPTED";
9
11
  HttpCodes[HttpCodes["NO_CONTENT"] = 204] = "NO_CONTENT";
10
12
  HttpCodes[HttpCodes["NOT_FOUND"] = 404] = "NOT_FOUND";
11
13
  HttpCodes[HttpCodes["CONFLICT"] = 409] = "CONFLICT";
12
14
  HttpCodes[HttpCodes["GONE"] = 410] = "GONE";
13
15
  HttpCodes[HttpCodes["PRECONDITION_FAILED"] = 412] = "PRECONDITION_FAILED";
14
- return HttpCodes;
15
- }({});
16
- let Method = exports.Method = /*#__PURE__*/function (Method) {
16
+ })(HttpCodes || (exports.HttpCodes = HttpCodes = {}));
17
+ let Method;
18
+ exports.Method = Method;
19
+ (function (Method) {
17
20
  Method["DELETE"] = "DELETE";
18
21
  Method["GET"] = "GET";
19
22
  Method["PATCH"] = "PATCH";
20
23
  Method["POST"] = "POST";
21
24
  Method["PUT"] = "PUT";
22
- return Method;
23
- }({});
25
+ })(Method || (exports.Method = Method = {}));
@@ -1,17 +1,17 @@
1
- export let HttpCodes = /*#__PURE__*/function (HttpCodes) {
1
+ export let HttpCodes;
2
+ (function (HttpCodes) {
2
3
  HttpCodes[HttpCodes["ACCEPTED"] = 202] = "ACCEPTED";
3
4
  HttpCodes[HttpCodes["NO_CONTENT"] = 204] = "NO_CONTENT";
4
5
  HttpCodes[HttpCodes["NOT_FOUND"] = 404] = "NOT_FOUND";
5
6
  HttpCodes[HttpCodes["CONFLICT"] = 409] = "CONFLICT";
6
7
  HttpCodes[HttpCodes["GONE"] = 410] = "GONE";
7
8
  HttpCodes[HttpCodes["PRECONDITION_FAILED"] = 412] = "PRECONDITION_FAILED";
8
- return HttpCodes;
9
- }({});
10
- export let Method = /*#__PURE__*/function (Method) {
9
+ })(HttpCodes || (HttpCodes = {}));
10
+ export let Method;
11
+ (function (Method) {
11
12
  Method["DELETE"] = "DELETE";
12
13
  Method["GET"] = "GET";
13
14
  Method["PATCH"] = "PATCH";
14
15
  Method["POST"] = "POST";
15
16
  Method["PUT"] = "PUT";
16
- return Method;
17
- }({});
17
+ })(Method || (Method = {}));
package/dist/index.cjs CHANGED
@@ -7,23 +7,22 @@ var _exportNames = {
7
7
  createPrezlyClient: true,
8
8
  ApiError: true
9
9
  };
10
- Object.defineProperty(exports, "ApiError", {
10
+ Object.defineProperty(exports, "createPrezlyClient", {
11
11
  enumerable: true,
12
12
  get: function () {
13
- return _index.ApiError;
13
+ return _Client.createClient;
14
14
  }
15
15
  });
16
- Object.defineProperty(exports, "createPrezlyClient", {
16
+ Object.defineProperty(exports, "ApiError", {
17
17
  enumerable: true,
18
18
  get: function () {
19
- return _Client.createClient;
19
+ return _index.ApiError;
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;
27
26
  Object.defineProperty(exports, key, {
28
27
  enumerable: true,
29
28
  get: function () {
@@ -37,7 +36,6 @@ var _index2 = require("./endpoints/index.cjs");
37
36
  Object.keys(_index2).forEach(function (key) {
38
37
  if (key === "default" || key === "__esModule") return;
39
38
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
40
- if (key in exports && exports[key] === _index2[key]) return;
41
39
  Object.defineProperty(exports, key, {
42
40
  enumerable: true,
43
41
  get: function () {
@@ -49,7 +47,6 @@ var _index3 = require("./types/index.cjs");
49
47
  Object.keys(_index3).forEach(function (key) {
50
48
  if (key === "default" || key === "__esModule") return;
51
49
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
52
- if (key in exports && exports[key] === _index3[key]) return;
53
50
  Object.defineProperty(exports, key, {
54
51
  enumerable: true,
55
52
  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 = exports.routing = {
7
+ const routing = {
8
8
  accounts: '/v2/accounts',
9
9
  billing: 'v2/billing',
10
10
  campaignsUrl: '/v2/campaigns',
@@ -36,4 +36,5 @@ const routing = exports.routing = {
36
36
  storiesSearchUrl: '/v2/stories/search',
37
37
  storyCoverageUrl: '/v1/stories/:story_id/reports/coverage',
38
38
  snippetsUrl: '/v2/snippets'
39
- };
39
+ };
40
+ exports.routing = routing;
@@ -4,8 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.BillingCycle = void 0;
7
- let BillingCycle = exports.BillingCycle = /*#__PURE__*/function (BillingCycle) {
7
+ let BillingCycle;
8
+ exports.BillingCycle = BillingCycle;
9
+ (function (BillingCycle) {
8
10
  BillingCycle["YEAR"] = "year";
9
11
  BillingCycle["MONTH"] = "month";
10
- return BillingCycle;
11
- }({});
12
+ })(BillingCycle || (exports.BillingCycle = BillingCycle = {}));
@@ -1,5 +1,5 @@
1
- export let BillingCycle = /*#__PURE__*/function (BillingCycle) {
1
+ export let BillingCycle;
2
+ (function (BillingCycle) {
2
3
  BillingCycle["YEAR"] = "year";
3
4
  BillingCycle["MONTH"] = "month";
4
- return BillingCycle;
5
- }({});
5
+ })(BillingCycle || (BillingCycle = {}));
@@ -5,50 +5,51 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Campaign = void 0;
7
7
  var _SenderDomain = require("./SenderDomain.cjs");
8
- let Campaign = exports.Campaign = void 0;
8
+ let Campaign;
9
+ exports.Campaign = Campaign;
9
10
  (function (_Campaign) {
10
11
  const SenderDomainVerificationFlow = _Campaign.SenderDomainVerificationFlow = _SenderDomain.SenderDomain.VerificationFlowVersion;
11
- let LifecycleStatus = /*#__PURE__*/function (LifecycleStatus) {
12
+ let LifecycleStatus;
13
+ (function (LifecycleStatus) {
12
14
  LifecycleStatus["DRAFT"] = "draft";
13
15
  LifecycleStatus["SCHEDULED"] = "scheduled";
14
16
  LifecycleStatus["PENDING"] = "pending";
15
17
  LifecycleStatus["SENT"] = "sent";
16
- return LifecycleStatus;
17
- }({});
18
+ })(LifecycleStatus || (LifecycleStatus = {}));
18
19
  _Campaign.LifecycleStatus = LifecycleStatus;
19
- let StoryAlignment = /*#__PURE__*/function (StoryAlignment) {
20
+ let StoryAlignment;
21
+ (function (StoryAlignment) {
20
22
  StoryAlignment["CENTER"] = "center";
21
23
  StoryAlignment["LEFT"] = "left";
22
24
  StoryAlignment["RIGHT"] = "right";
23
- return StoryAlignment;
24
- }({});
25
+ })(StoryAlignment || (StoryAlignment = {}));
25
26
  _Campaign.StoryAlignment = StoryAlignment;
26
- let StoryAppearance = /*#__PURE__*/function (StoryAppearance) {
27
+ let StoryAppearance;
28
+ (function (StoryAppearance) {
27
29
  StoryAppearance["INTRO"] = "intro";
28
30
  StoryAppearance["FULL"] = "full";
29
- return StoryAppearance;
30
- }({});
31
+ })(StoryAppearance || (StoryAppearance = {}));
31
32
  _Campaign.StoryAppearance = StoryAppearance;
32
- let StoryHeaderFooter = /*#__PURE__*/function (StoryHeaderFooter) {
33
+ let StoryHeaderFooter;
34
+ (function (StoryHeaderFooter) {
33
35
  StoryHeaderFooter["NONE"] = "none";
34
36
  StoryHeaderFooter["STANDARD"] = "standard";
35
37
  StoryHeaderFooter["FULL"] = "full";
36
- return StoryHeaderFooter;
37
- }({});
38
+ })(StoryHeaderFooter || (StoryHeaderFooter = {}));
38
39
  _Campaign.StoryHeaderFooter = StoryHeaderFooter;
39
- let SenderDomainVerificationStatus = /*#__PURE__*/function (SenderDomainVerificationStatus) {
40
+ let SenderDomainVerificationStatus;
41
+ (function (SenderDomainVerificationStatus) {
40
42
  SenderDomainVerificationStatus["UNKNOWN"] = "unknown";
41
43
  SenderDomainVerificationStatus["VALID"] = "valid";
42
44
  SenderDomainVerificationStatus["INVALID"] = "invalid";
43
45
  SenderDomainVerificationStatus["NOT_APPLICABLE"] = "not-applicable";
44
- return SenderDomainVerificationStatus;
45
- }({});
46
+ })(SenderDomainVerificationStatus || (SenderDomainVerificationStatus = {}));
46
47
  _Campaign.SenderDomainVerificationStatus = SenderDomainVerificationStatus;
47
- let ClickTrackingVersion = /*#__PURE__*/function (ClickTrackingVersion) {
48
+ let ClickTrackingVersion;
49
+ (function (ClickTrackingVersion) {
48
50
  ClickTrackingVersion[ClickTrackingVersion["DEPRECATED"] = 1] = "DEPRECATED";
49
51
  ClickTrackingVersion[ClickTrackingVersion["ENHANCED"] = 2] = "ENHANCED";
50
- return ClickTrackingVersion;
51
- }({});
52
+ })(ClickTrackingVersion || (ClickTrackingVersion = {}));
52
53
  _Campaign.ClickTrackingVersion = ClickTrackingVersion;
53
54
  function isDraft(arg) {
54
55
  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 = /*#__PURE__*/function (LifecycleStatus) {
5
+ let LifecycleStatus;
6
+ (function (LifecycleStatus) {
6
7
  LifecycleStatus["DRAFT"] = "draft";
7
8
  LifecycleStatus["SCHEDULED"] = "scheduled";
8
9
  LifecycleStatus["PENDING"] = "pending";
9
10
  LifecycleStatus["SENT"] = "sent";
10
- return LifecycleStatus;
11
- }({});
11
+ })(LifecycleStatus || (LifecycleStatus = {}));
12
12
  _Campaign.LifecycleStatus = LifecycleStatus;
13
- let StoryAlignment = /*#__PURE__*/function (StoryAlignment) {
13
+ let StoryAlignment;
14
+ (function (StoryAlignment) {
14
15
  StoryAlignment["CENTER"] = "center";
15
16
  StoryAlignment["LEFT"] = "left";
16
17
  StoryAlignment["RIGHT"] = "right";
17
- return StoryAlignment;
18
- }({});
18
+ })(StoryAlignment || (StoryAlignment = {}));
19
19
  _Campaign.StoryAlignment = StoryAlignment;
20
- let StoryAppearance = /*#__PURE__*/function (StoryAppearance) {
20
+ let StoryAppearance;
21
+ (function (StoryAppearance) {
21
22
  StoryAppearance["INTRO"] = "intro";
22
23
  StoryAppearance["FULL"] = "full";
23
- return StoryAppearance;
24
- }({});
24
+ })(StoryAppearance || (StoryAppearance = {}));
25
25
  _Campaign.StoryAppearance = StoryAppearance;
26
- let StoryHeaderFooter = /*#__PURE__*/function (StoryHeaderFooter) {
26
+ let StoryHeaderFooter;
27
+ (function (StoryHeaderFooter) {
27
28
  StoryHeaderFooter["NONE"] = "none";
28
29
  StoryHeaderFooter["STANDARD"] = "standard";
29
30
  StoryHeaderFooter["FULL"] = "full";
30
- return StoryHeaderFooter;
31
- }({});
31
+ })(StoryHeaderFooter || (StoryHeaderFooter = {}));
32
32
  _Campaign.StoryHeaderFooter = StoryHeaderFooter;
33
- let SenderDomainVerificationStatus = /*#__PURE__*/function (SenderDomainVerificationStatus) {
33
+ let SenderDomainVerificationStatus;
34
+ (function (SenderDomainVerificationStatus) {
34
35
  SenderDomainVerificationStatus["UNKNOWN"] = "unknown";
35
36
  SenderDomainVerificationStatus["VALID"] = "valid";
36
37
  SenderDomainVerificationStatus["INVALID"] = "invalid";
37
38
  SenderDomainVerificationStatus["NOT_APPLICABLE"] = "not-applicable";
38
- return SenderDomainVerificationStatus;
39
- }({});
39
+ })(SenderDomainVerificationStatus || (SenderDomainVerificationStatus = {}));
40
40
  _Campaign.SenderDomainVerificationStatus = SenderDomainVerificationStatus;
41
- let ClickTrackingVersion = /*#__PURE__*/function (ClickTrackingVersion) {
41
+ let ClickTrackingVersion;
42
+ (function (ClickTrackingVersion) {
42
43
  ClickTrackingVersion[ClickTrackingVersion["DEPRECATED"] = 1] = "DEPRECATED";
43
44
  ClickTrackingVersion[ClickTrackingVersion["ENHANCED"] = 2] = "ENHANCED";
44
- return ClickTrackingVersion;
45
- }({});
45
+ })(ClickTrackingVersion || (ClickTrackingVersion = {}));
46
46
  _Campaign.ClickTrackingVersion = ClickTrackingVersion;
47
47
  function isDraft(arg) {
48
48
  if (typeof arg === 'object') {
@@ -4,7 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Category = void 0;
7
- let Category = exports.Category = void 0;
7
+ let Category;
8
+ exports.Category = Category;
8
9
  (function (_Category) {
9
10
  function isTranslated(category, locale) {
10
11
  const translation = category.i18n[localeCode(locale)];