@prezly/sdk 18.3.0 → 19.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.
Files changed (119) 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/api/types.d.ts +1 -1
  6. package/dist/endpoints/Accounts/index.cjs +2 -0
  7. package/dist/endpoints/Billing/index.cjs +2 -0
  8. package/dist/endpoints/Billing/types.cjs +3 -5
  9. package/dist/endpoints/CampaignRecipients/Client.d.ts +3 -3
  10. package/dist/endpoints/CampaignRecipients/index.cjs +2 -0
  11. package/dist/endpoints/Campaigns/index.cjs +2 -0
  12. package/dist/endpoints/Contacts/Client.d.ts +2 -2
  13. package/dist/endpoints/Contacts/index.cjs +2 -0
  14. package/dist/endpoints/Contacts/types.d.ts +3 -3
  15. package/dist/endpoints/ContactsExports/index.cjs +2 -0
  16. package/dist/endpoints/Coverage/Client.d.ts +1 -1
  17. package/dist/endpoints/Coverage/index.cjs +2 -0
  18. package/dist/endpoints/Coverage/types.d.ts +1 -1
  19. package/dist/endpoints/Jobs/index.cjs +2 -0
  20. package/dist/endpoints/Licenses/index.cjs +1 -0
  21. package/dist/endpoints/NewsroomCategories/Client.d.ts +1 -1
  22. package/dist/endpoints/NewsroomCategories/index.cjs +2 -0
  23. package/dist/endpoints/NewsroomContacts/Client.d.ts +2 -2
  24. package/dist/endpoints/NewsroomContacts/index.cjs +2 -0
  25. package/dist/endpoints/NewsroomContacts/types.d.ts +1 -1
  26. package/dist/endpoints/NewsroomDomains/Client.d.ts +1 -1
  27. package/dist/endpoints/NewsroomDomains/index.cjs +2 -0
  28. package/dist/endpoints/NewsroomGalleries/Client.d.ts +2 -2
  29. package/dist/endpoints/NewsroomGalleries/index.cjs +2 -0
  30. package/dist/endpoints/NewsroomHub/Client.d.ts +1 -1
  31. package/dist/endpoints/NewsroomHub/index.cjs +2 -0
  32. package/dist/endpoints/NewsroomHub/types.d.ts +1 -1
  33. package/dist/endpoints/NewsroomLanguages/Client.d.ts +1 -1
  34. package/dist/endpoints/NewsroomLanguages/index.cjs +2 -0
  35. package/dist/endpoints/NewsroomPrivacyRequests/index.cjs +2 -0
  36. package/dist/endpoints/NewsroomSubscriptions/Client.d.ts +1 -1
  37. package/dist/endpoints/NewsroomSubscriptions/index.cjs +2 -0
  38. package/dist/endpoints/NewsroomThemes/Client.d.ts +2 -2
  39. package/dist/endpoints/NewsroomThemes/index.cjs +1 -0
  40. package/dist/endpoints/NewsroomWebhooks/Client.d.ts +1 -1
  41. package/dist/endpoints/NewsroomWebhooks/index.cjs +2 -0
  42. package/dist/endpoints/Newsrooms/Client.d.ts +1 -1
  43. package/dist/endpoints/Newsrooms/index.cjs +2 -0
  44. package/dist/endpoints/NotificationSubscriptions/index.cjs +2 -0
  45. package/dist/endpoints/PricingTables/index.cjs +2 -0
  46. package/dist/endpoints/PricingTables/types.cjs +5 -9
  47. package/dist/endpoints/SenderAddresses/index.cjs +2 -0
  48. package/dist/endpoints/Snippets/Client.d.ts +1 -1
  49. package/dist/endpoints/Snippets/index.cjs +2 -0
  50. package/dist/endpoints/Stories/Client.cjs +23 -4
  51. package/dist/endpoints/Stories/Client.d.ts +4 -4
  52. package/dist/endpoints/Stories/Client.js +22 -7
  53. package/dist/endpoints/Stories/index.cjs +3 -0
  54. package/dist/endpoints/Stories/scopes.cjs +2 -3
  55. package/dist/endpoints/Stories/types.cjs +14 -4
  56. package/dist/endpoints/Stories/types.d.ts +11 -11
  57. package/dist/endpoints/Stories/types.js +13 -3
  58. package/dist/endpoints/Subscriptions/Client.d.ts +1 -1
  59. package/dist/endpoints/Subscriptions/index.cjs +2 -0
  60. package/dist/endpoints/Subscriptions/types.cjs +1 -2
  61. package/dist/endpoints/index.cjs +3 -3
  62. package/dist/http/constants.cjs +3 -6
  63. package/dist/http/index.cjs +8 -8
  64. package/dist/http/lib.cjs +0 -16
  65. package/dist/http/lib.js +0 -14
  66. package/dist/http/types.cjs +2 -4
  67. package/dist/index.cjs +7 -4
  68. package/dist/routing.cjs +2 -3
  69. package/dist/types/BillingCycle.cjs +1 -2
  70. package/dist/types/Campaign.cjs +1 -2
  71. package/dist/types/Category.cjs +1 -2
  72. package/dist/types/Category.d.ts +3 -3
  73. package/dist/types/Contact.cjs +1 -2
  74. package/dist/types/ContactDuplicateSuggestion.cjs +2 -2
  75. package/dist/types/ContactDuplicateSuggestion.d.ts +1 -1
  76. package/dist/types/ContactsExport.cjs +1 -2
  77. package/dist/types/ContactsExport.d.ts +1 -1
  78. package/dist/types/ContactsScope.cjs +1 -2
  79. package/dist/types/ContactsScope.d.ts +1 -1
  80. package/dist/types/CoverageEntry.cjs +1 -2
  81. package/dist/types/Culture.cjs +7 -2
  82. package/dist/types/Culture.d.ts +1 -1
  83. package/dist/types/Culture.js +6 -0
  84. package/dist/types/Currency.cjs +1 -2
  85. package/dist/types/DnsConfigurationInstruction.d.ts +1 -1
  86. package/dist/types/EmailRecipient.cjs +1 -2
  87. package/dist/types/JobState.cjs +1 -2
  88. package/dist/types/JobState.d.ts +1 -1
  89. package/dist/types/License.cjs +1 -2
  90. package/dist/types/Newsroom.cjs +4 -2
  91. package/dist/types/Newsroom.d.ts +2 -2
  92. package/dist/types/Newsroom.js +3 -0
  93. package/dist/types/NewsroomDomain.cjs +1 -2
  94. package/dist/types/NewsroomGallery.cjs +1 -2
  95. package/dist/types/NewsroomTheme.cjs +3 -5
  96. package/dist/types/NewsroomTheme.d.ts +1 -1
  97. package/dist/types/NewsroomTheme.js +1 -1
  98. package/dist/types/NewsroomWebhook.cjs +1 -2
  99. package/dist/types/NotificationSubscription.cjs +1 -2
  100. package/dist/types/Permissions.cjs +1 -2
  101. package/dist/types/Permissions.d.ts +1 -1
  102. package/dist/types/Plan.cjs +3 -4
  103. package/dist/types/PrivacyRequest.cjs +1 -2
  104. package/dist/types/SenderAddress.cjs +1 -2
  105. package/dist/types/SenderDomain.cjs +1 -2
  106. package/dist/types/SortOrder.cjs +1 -2
  107. package/dist/types/Story.cjs +17 -6
  108. package/dist/types/Story.d.ts +4 -2
  109. package/dist/types/Story.js +16 -4
  110. package/dist/types/User.cjs +1 -2
  111. package/dist/types/UserAccount.d.ts +1 -1
  112. package/dist/types/common/Notification.cjs +1 -2
  113. package/dist/types/common/OEmbedInfo.cjs +1 -2
  114. package/dist/types/common/Pagination.cjs +2 -2
  115. package/dist/types/common/Query.cjs +1 -2
  116. package/dist/types/common/Query.d.ts +1 -1
  117. package/dist/types/common/index.cjs +6 -0
  118. package/dist/types/index.cjs +36 -0
  119. package/package.json +10 -13
@@ -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 () {
@@ -1,7 +1,7 @@
1
1
  import type { DeferredJobsApiClient } from '../../api';
2
2
  import type { Snippet } from '../../types';
3
3
  import type { CreateRequest, UpdateRequest } from './types';
4
- declare type SnippetId = Snippet['uuid'] | Snippet['id'];
4
+ type SnippetId = Snippet['uuid'] | Snippet['id'];
5
5
  export declare class Client {
6
6
  private readonly apiClient;
7
7
  constructor(apiClient: DeferredJobsApiClient);
@@ -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 () {
@@ -8,6 +8,15 @@ var _index = require("../../http/index.cjs");
8
8
  var _routing = require("../../routing.cjs");
9
9
  var _index2 = require("../../types/index.cjs");
10
10
  var _types = require("./types.cjs");
11
+ /**
12
+ * `uuid` is the preferred way of targeting a Story. Numeric `id` is considered deprecated.
13
+ */
14
+
15
+ /**
16
+ * Utility type to forbid arbitrary ad-hoc extensions of generic parameters.
17
+ * @see https://stackoverflow.com/a/69666350
18
+ */
19
+
11
20
  class Client {
12
21
  constructor(apiClient) {
13
22
  this.apiClient = apiClient;
@@ -59,6 +68,20 @@ class Client {
59
68
  * Get story by UUID.
60
69
  */
61
70
 
71
+ /**
72
+ * Get multiple stories by UUIDs.
73
+ */
74
+
75
+ /**
76
+ * Get story by deprecated numeric ID, or UUID.
77
+ * @deprecated Please use UUID instead.
78
+ */
79
+
80
+ /**
81
+ * Get multiple stories by numeric IDs.
82
+ * @deprecated Please use UUID instead.
83
+ */
84
+
62
85
  /**
63
86
  * Implementation
64
87
  */
@@ -148,7 +171,6 @@ class Client {
148
171
  include,
149
172
  force: force || undefined // only pass it if it's true
150
173
  },
151
-
152
174
  payload
153
175
  });
154
176
  return story;
@@ -207,7 +229,6 @@ class Client {
207
229
  include,
208
230
  force: force || undefined // only pass it if it's true
209
231
  },
210
-
211
232
  payload
212
233
  });
213
234
  return {
@@ -236,7 +257,6 @@ class Client {
236
257
  include,
237
258
  force: force || undefined // only pass it if it's true
238
259
  },
239
-
240
260
  payload
241
261
  });
242
262
  return story;
@@ -367,7 +387,6 @@ class Client {
367
387
  force: force || undefined // only pass it if it's true
368
388
  }
369
389
  });
370
-
371
390
  return story;
372
391
  }
373
392
  async unpin(id, options) {
@@ -4,14 +4,14 @@ import type { AutosaveRequest, ChangeNewsroomSuccessResponse, ChangeNewsroomUnsa
4
4
  /**
5
5
  * `uuid` is the preferred way of targeting a Story. Numeric `id` is considered deprecated.
6
6
  */
7
- declare type StoryId = Story['uuid'] | Story['id'];
8
- declare type Formats = Story.FormatVersion[];
7
+ type StoryId = Story['uuid'] | Story['id'];
8
+ type Formats = Story.FormatVersion[];
9
9
  /**
10
10
  * Utility type to forbid arbitrary ad-hoc extensions of generic parameters.
11
11
  * @see https://stackoverflow.com/a/69666350
12
12
  */
13
- declare type Exactly<Concrete, Abstract> = Concrete & Record<Exclude<keyof Concrete, keyof Abstract>, never>;
14
- declare type InferExtraFields<T> = T extends Required<IncludeOptions<infer I>> ? Pick<Story.ExtraFields, I> : unknown;
13
+ type Exactly<Concrete, Abstract> = Concrete & Record<Exclude<keyof Concrete, keyof Abstract>, never>;
14
+ type InferExtraFields<T> = T extends Required<IncludeOptions<infer I>> ? Pick<Story.ExtraFields, I> : unknown;
15
15
  export declare class Client {
16
16
  private readonly apiClient;
17
17
  constructor(apiClient: DeferredJobsApiClient);
@@ -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
  const EXTENDED_STORY_INCLUDED_EXTRA_FIELDS_SHAPE = {
@@ -40,7 +52,5 @@ const ALL_EXTRA_FIELDS_SHAPE = {
40
52
  'pitches.count': true
41
53
  }; // satisfies Record<keyof Story.OnDemandFields, boolean>; // TODO: Use Typescript `satisfies` operator, when it's out of beta
42
54
 
43
- const ALL_EXTRA_FIELDS = Object.keys(ALL_EXTRA_FIELDS_SHAPE);
44
- exports.ALL_EXTRA_FIELDS = ALL_EXTRA_FIELDS;
45
- const EXTENDED_STORY_INCLUDED_EXTRA_FIELDS = Object.keys(EXTENDED_STORY_INCLUDED_EXTRA_FIELDS_SHAPE);
46
- exports.EXTENDED_STORY_INCLUDED_EXTRA_FIELDS = EXTENDED_STORY_INCLUDED_EXTRA_FIELDS;
55
+ const ALL_EXTRA_FIELDS = exports.ALL_EXTRA_FIELDS = Object.keys(ALL_EXTRA_FIELDS_SHAPE);
56
+ const EXTENDED_STORY_INCLUDED_EXTRA_FIELDS = exports.EXTENDED_STORY_INCLUDED_EXTRA_FIELDS = Object.keys(EXTENDED_STORY_INCLUDED_EXTRA_FIELDS_SHAPE);
@@ -3,20 +3,20 @@ import { Campaign } from '../../types';
3
3
  /**
4
4
  * Uploadcare image JSON string.
5
5
  */
6
- declare type UploadedImage = string;
7
- declare type Iso8601DateTime = string;
6
+ type UploadedImage = string;
7
+ type Iso8601DateTime = string;
8
8
  /**
9
9
  * Raw HTML string.
10
10
  */
11
- declare type Html = string;
11
+ type Html = string;
12
12
  /**
13
13
  * String-serialized JSON object.
14
14
  */
15
- declare type Json = string;
15
+ type Json = string;
16
16
  /**
17
17
  * String containing Prezly Content Format JSON structure.
18
18
  */
19
- declare type PrezlyContentFormat = string;
19
+ type PrezlyContentFormat = string;
20
20
  interface BaseWarning {
21
21
  text: string;
22
22
  scope: string;
@@ -48,7 +48,7 @@ interface StoryEmbeddedContactsWillBeRemovedWarning extends BaseWarning {
48
48
  field: 'room_contacts';
49
49
  value: NewsroomContactRef[];
50
50
  }
51
- export declare type ChangeNewsroomWarning = ChangingNewsroomUnsafeOperationWarning | DestinationNewsroomMissingCategoriesWarning | DestinationNewsroomMissingCulturesWarning | StoryEmbeddedContactsWillBeRemovedWarning | StoryTranslationsWillMoveWarning;
51
+ export type ChangeNewsroomWarning = ChangingNewsroomUnsafeOperationWarning | DestinationNewsroomMissingCategoriesWarning | DestinationNewsroomMissingCulturesWarning | StoryEmbeddedContactsWillBeRemovedWarning | StoryTranslationsWillMoveWarning;
52
52
  export interface IncludeOptions<Include extends keyof Story.ExtraFields = keyof Story.ExtraFields> {
53
53
  include?: Include[];
54
54
  }
@@ -78,7 +78,7 @@ interface GenericCreateRequest {
78
78
  * - Conflicts can be force-resolved by passing `?force` GET parameter.
79
79
  * This will update other conflicting stories slugs to something else (i.e. adding random suffix).
80
80
  */
81
- slug?: Story['slug'];
81
+ custom_slug?: Story['custom_slug'];
82
82
  newsroom?: Newsroom['id'] | Newsroom['uuid'];
83
83
  published_at?: Iso8601DateTime;
84
84
  visibility?: Story.Visibility;
@@ -100,7 +100,7 @@ interface GenericUpdateRequest {
100
100
  * - Conflicts can be force-resolved by passing `?force` GET parameter.
101
101
  * This will update other conflicting stories slugs to something else (i.e. adding random suffix).
102
102
  */
103
- slug?: Story['slug'] | null;
103
+ custom_slug?: Story['custom_slug'];
104
104
  published_at?: Iso8601DateTime;
105
105
  visibility?: Story.Visibility;
106
106
  culture?: CultureRef['code'];
@@ -220,8 +220,8 @@ export interface PreviewOptions {
220
220
  }
221
221
  export import Alignment = Campaign.StoryAlignment;
222
222
  export import Appearance = Campaign.StoryAppearance;
223
- export declare type CreateRequest = HtmlStoryCreateRequest | SlateV3StoryCreateRequest | SlateV4StoryCreateRequest | SlateV5StoryCreateRequest;
224
- export declare type UpdateRequest = HtmlStoryUpdateRequest | SlateV3StoryUpdateRequest | SlateV4StoryUpdateRequest | SlateV5StoryUpdateRequest;
223
+ export type CreateRequest = HtmlStoryCreateRequest | SlateV3StoryCreateRequest | SlateV4StoryCreateRequest | SlateV5StoryCreateRequest;
224
+ export type UpdateRequest = HtmlStoryUpdateRequest | SlateV3StoryUpdateRequest | SlateV4StoryUpdateRequest | SlateV5StoryUpdateRequest;
225
225
  export interface AutosaveRequest {
226
226
  autosaved_content: PrezlyContentFormat;
227
227
  content_version?: number;
@@ -240,7 +240,7 @@ export interface ScheduleRequest {
240
240
  publish_at: Iso8601DateTime;
241
241
  visibility?: Story.Visibility.PUBLIC | Story.Visibility.EMBARGO;
242
242
  }
243
- export declare type UnscheduleRequest = UnpublishRequest;
243
+ export type UnscheduleRequest = UnpublishRequest;
244
244
  export interface TranslateRequest {
245
245
  culture?: CultureRef['code'];
246
246
  }
@@ -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
  const EXTENDED_STORY_INCLUDED_EXTRA_FIELDS_SHAPE = {
@@ -1,7 +1,7 @@
1
1
  import type { DeferredJobsApiClient } from '../../api';
2
2
  import type { Contact, EmailSubscription, Newsroom } from '../../types';
3
3
  import type { SubscribeRequest, UnsubscribeRequest, UpdateUnsubscribeDetailsRequest } from './types';
4
- declare type NewsroomId = Newsroom['uuid'] | Newsroom['id'];
4
+ type NewsroomId = Newsroom['uuid'] | Newsroom['id'];
5
5
  export declare class Client {
6
6
  private readonly apiClient;
7
7
  constructor(apiClient: DeferredJobsApiClient);
@@ -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,8 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.UnsubscribeReason = void 0;
7
- let UnsubscribeReason;
8
- exports.UnsubscribeReason = UnsubscribeReason;
7
+ let UnsubscribeReason = exports.UnsubscribeReason = void 0;
9
8
  (function (UnsubscribeReason) {
10
9
  UnsubscribeReason["UNKNOWN"] = "unknown";
11
10
  UnsubscribeReason["UNWANTED"] = "unwanted";
@@ -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");
package/dist/http/lib.cjs CHANGED
@@ -6,23 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.createUrlWithQuery = createUrlWithQuery;
7
7
  exports.isDeferredJobResponse = isDeferredJobResponse;
8
8
  var _queryString = _interopRequireDefault(require("query-string"));
9
- var nodeUrl = _interopRequireWildcard(require("url"));
10
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
11
- 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; }
12
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
- /**
14
- * Choose which `URL` class to use based on the environment (Browser / Node.js / Edge)
15
- */
16
- function getURLClass() {
17
- if (typeof window !== 'undefined') {
18
- return window.URL;
19
- }
20
- if (typeof globalThis.EdgeRuntime === 'string') {
21
- return globalThis.URL;
22
- }
23
- return nodeUrl.URL;
24
- }
25
- const URL = getURLClass();
26
10
  function parseUrlParams(query) {
27
11
  return _queryString.default.parse(query, {
28
12
  arrayFormat: 'bracket'
package/dist/http/lib.js CHANGED
@@ -1,18 +1,4 @@
1
1
  import queryString from 'query-string';
2
- import * as nodeUrl from 'url';
3
- /**
4
- * Choose which `URL` class to use based on the environment (Browser / Node.js / Edge)
5
- */
6
- function getURLClass() {
7
- if (typeof window !== 'undefined') {
8
- return window.URL;
9
- }
10
- if (typeof globalThis.EdgeRuntime === 'string') {
11
- return globalThis.URL;
12
- }
13
- return nodeUrl.URL;
14
- }
15
- const URL = getURLClass();
16
2
  function parseUrlParams(query) {
17
3
  return queryString.parse(query, {
18
4
  arrayFormat: 'bracket'
@@ -4,8 +4,7 @@ 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;
7
+ let HttpCodes = exports.HttpCodes = void 0;
9
8
  (function (HttpCodes) {
10
9
  HttpCodes[HttpCodes["ACCEPTED"] = 202] = "ACCEPTED";
11
10
  HttpCodes[HttpCodes["NO_CONTENT"] = 204] = "NO_CONTENT";
@@ -14,8 +13,7 @@ exports.HttpCodes = HttpCodes;
14
13
  HttpCodes[HttpCodes["GONE"] = 410] = "GONE";
15
14
  HttpCodes[HttpCodes["PRECONDITION_FAILED"] = 412] = "PRECONDITION_FAILED";
16
15
  })(HttpCodes || (exports.HttpCodes = HttpCodes = {}));
17
- let Method;
18
- exports.Method = Method;
16
+ let Method = exports.Method = void 0;
19
17
  (function (Method) {
20
18
  Method["DELETE"] = "DELETE";
21
19
  Method["GET"] = "GET";
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',
@@ -37,5 +37,4 @@ const routing = {
37
37
  storiesSearchUrl: '/v2/stories/search',
38
38
  storyCoverageUrl: '/v1/stories/:story_id/reports/coverage',
39
39
  snippetsUrl: '/v2/snippets'
40
- };
41
- exports.routing = routing;
40
+ };
@@ -4,8 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.BillingCycle = void 0;
7
- let BillingCycle;
8
- exports.BillingCycle = BillingCycle;
7
+ let BillingCycle = exports.BillingCycle = void 0;
9
8
  (function (BillingCycle) {
10
9
  BillingCycle["YEAR"] = "year";
11
10
  BillingCycle["MONTH"] = "month";
@@ -5,8 +5,7 @@ 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
11
  let LifecycleStatus;
@@ -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)];
@@ -31,14 +31,14 @@ export interface TranslatedCategory {
31
31
  name: Category.Translation['name'];
32
32
  description: Category.Translation['description'];
33
33
  }
34
- declare type LocaleIdentifier<Locale extends Culture['code'] = Culture['code']> = Locale | {
34
+ type LocaleIdentifier<Locale extends Culture['code'] = Culture['code']> = Locale | {
35
35
  code: Locale;
36
36
  };
37
- declare type NonEmptyTranslation = Category.Translation & {
37
+ type NonEmptyTranslation = Category.Translation & {
38
38
  slug: NonNullable<Category.Translation['slug']>;
39
39
  name: Exclude<Category.Translation['name'], ''>;
40
40
  };
41
- declare type WithNonEmptyTranslation<T extends Category, LocaleCode extends Culture['code']> = T & {
41
+ type WithNonEmptyTranslation<T extends Category, LocaleCode extends Culture['code']> = T & {
42
42
  i18n: {
43
43
  [localeCode in LocaleCode]: NonEmptyTranslation;
44
44
  };