@prezly/sdk 11.8.0 → 11.8.1-cjs

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 (131) hide show
  1. package/dist/Client.js +33 -27
  2. package/dist/api/ApiClient.js +19 -12
  3. package/dist/api/DeferredJobsApiClient.js +19 -12
  4. package/dist/api/constants.js +9 -2
  5. package/dist/api/index.js +19 -2
  6. package/dist/endpoints/Accounts/Client.js +13 -6
  7. package/dist/endpoints/Accounts/index.js +25 -2
  8. package/dist/endpoints/Accounts/types.js +1 -1
  9. package/dist/endpoints/Billing/Client.js +11 -4
  10. package/dist/endpoints/Billing/index.js +25 -2
  11. package/dist/endpoints/Billing/types.js +15 -6
  12. package/dist/endpoints/CampaignRecipients/Client.js +19 -12
  13. package/dist/endpoints/CampaignRecipients/index.js +37 -3
  14. package/dist/endpoints/CampaignRecipients/types.js +1 -1
  15. package/dist/endpoints/Campaigns/Client.js +25 -18
  16. package/dist/endpoints/Campaigns/index.js +25 -2
  17. package/dist/endpoints/Campaigns/types.js +1 -1
  18. package/dist/endpoints/ContactsExports/Client.js +15 -8
  19. package/dist/endpoints/ContactsExports/index.js +37 -3
  20. package/dist/endpoints/ContactsExports/types.js +1 -1
  21. package/dist/endpoints/Coverage/Client.js +19 -12
  22. package/dist/endpoints/Coverage/index.js +25 -2
  23. package/dist/endpoints/Coverage/types.js +1 -1
  24. package/dist/endpoints/Jobs/Client.js +11 -4
  25. package/dist/endpoints/Jobs/index.js +25 -2
  26. package/dist/endpoints/Jobs/types.js +1 -1
  27. package/dist/endpoints/Licenses/Client.js +11 -4
  28. package/dist/endpoints/Licenses/index.js +15 -1
  29. package/dist/endpoints/NewsroomCategories/Client.js +15 -8
  30. package/dist/endpoints/NewsroomCategories/index.js +25 -2
  31. package/dist/endpoints/NewsroomCategories/types.js +1 -1
  32. package/dist/endpoints/NewsroomContacts/Client.js +18 -11
  33. package/dist/endpoints/NewsroomContacts/index.js +25 -2
  34. package/dist/endpoints/NewsroomContacts/types.js +1 -1
  35. package/dist/endpoints/NewsroomDomains/Client.js +16 -9
  36. package/dist/endpoints/NewsroomDomains/index.js +25 -2
  37. package/dist/endpoints/NewsroomDomains/types.js +1 -1
  38. package/dist/endpoints/NewsroomGalleries/Client.js +20 -13
  39. package/dist/endpoints/NewsroomGalleries/index.js +25 -2
  40. package/dist/endpoints/NewsroomGalleries/types.js +1 -1
  41. package/dist/endpoints/NewsroomLanguages/Client.js +17 -10
  42. package/dist/endpoints/NewsroomLanguages/index.js +25 -2
  43. package/dist/endpoints/NewsroomLanguages/lib.js +7 -1
  44. package/dist/endpoints/NewsroomLanguages/types.js +1 -1
  45. package/dist/endpoints/NewsroomPrivacyRequests/Client.js +12 -5
  46. package/dist/endpoints/NewsroomPrivacyRequests/index.js +25 -2
  47. package/dist/endpoints/NewsroomPrivacyRequests/types.js +1 -1
  48. package/dist/endpoints/NewsroomSubscriptions/Client.js +11 -4
  49. package/dist/endpoints/NewsroomSubscriptions/index.js +25 -2
  50. package/dist/endpoints/NewsroomSubscriptions/types.js +1 -1
  51. package/dist/endpoints/NewsroomThemes/Client.js +14 -7
  52. package/dist/endpoints/NewsroomThemes/index.js +15 -1
  53. package/dist/endpoints/NewsroomWebhooks/Client.js +15 -8
  54. package/dist/endpoints/NewsroomWebhooks/index.js +25 -2
  55. package/dist/endpoints/NewsroomWebhooks/types.js +1 -1
  56. package/dist/endpoints/Newsrooms/Client.js +22 -15
  57. package/dist/endpoints/Newsrooms/index.js +25 -2
  58. package/dist/endpoints/Newsrooms/types.js +1 -1
  59. package/dist/endpoints/NotificationSubscriptions/Client.js +12 -5
  60. package/dist/endpoints/NotificationSubscriptions/index.js +25 -2
  61. package/dist/endpoints/NotificationSubscriptions/types.js +1 -1
  62. package/dist/endpoints/SenderAddresses/Client.js +15 -8
  63. package/dist/endpoints/SenderAddresses/index.js +25 -2
  64. package/dist/endpoints/SenderAddresses/types.js +1 -1
  65. package/dist/endpoints/Signup/Client.js +11 -4
  66. package/dist/endpoints/Signup/index.js +25 -2
  67. package/dist/endpoints/Signup/types.js +9 -2
  68. package/dist/endpoints/Snippets/Client.js +15 -8
  69. package/dist/endpoints/Snippets/index.js +25 -2
  70. package/dist/endpoints/Snippets/types.js +1 -1
  71. package/dist/endpoints/Stories/Client.js +30 -23
  72. package/dist/endpoints/Stories/index.js +35 -3
  73. package/dist/endpoints/Stories/scopes.js +11 -4
  74. package/dist/endpoints/Stories/types.js +10 -2
  75. package/dist/endpoints/Subscriptions/Client.js +15 -8
  76. package/dist/endpoints/Subscriptions/index.js +25 -2
  77. package/dist/endpoints/Subscriptions/types.js +9 -2
  78. package/dist/endpoints/index.js +56 -24
  79. package/dist/http/ApiError.js +9 -2
  80. package/dist/http/Http.js +21 -14
  81. package/dist/http/constants.js +12 -3
  82. package/dist/http/createRequest.js +20 -13
  83. package/dist/http/index.js +39 -4
  84. package/dist/http/lib.js +16 -6
  85. package/dist/http/types.js +12 -4
  86. package/dist/index.js +56 -5
  87. package/dist/routing.js +9 -2
  88. package/dist/types/Campaign.js +11 -4
  89. package/dist/types/Category.js +1 -1
  90. package/dist/types/Contact.js +9 -2
  91. package/dist/types/ContactDuplicateSuggestion.js +9 -2
  92. package/dist/types/ContactsExport.js +9 -2
  93. package/dist/types/ContactsScope.js +9 -2
  94. package/dist/types/Country.js +1 -1
  95. package/dist/types/CoverageEntry.js +9 -2
  96. package/dist/types/Culture.js +9 -2
  97. package/dist/types/Currency.js +9 -2
  98. package/dist/types/DnsConfigurationInstruction.js +1 -1
  99. package/dist/types/EmailRecipient.js +9 -2
  100. package/dist/types/EmailSubscription.js +1 -1
  101. package/dist/types/JobState.js +9 -2
  102. package/dist/types/License.js +9 -2
  103. package/dist/types/Newsroom.js +9 -2
  104. package/dist/types/NewsroomCompanyInformation.js +1 -1
  105. package/dist/types/NewsroomContact.js +1 -1
  106. package/dist/types/NewsroomDomain.js +9 -2
  107. package/dist/types/NewsroomGallery.js +9 -2
  108. package/dist/types/NewsroomLanguageSettings.js +1 -1
  109. package/dist/types/NewsroomTheme.js +12 -4
  110. package/dist/types/NewsroomWebhook.js +9 -2
  111. package/dist/types/NotificationSubscription.js +9 -2
  112. package/dist/types/Permissions.js +9 -2
  113. package/dist/types/Plan.js +9 -2
  114. package/dist/types/PrivacyRequest.js +9 -2
  115. package/dist/types/SEOSettings.js +1 -1
  116. package/dist/types/SenderAddress.js +9 -2
  117. package/dist/types/SenderDomain.js +9 -2
  118. package/dist/types/Snippet.js +1 -1
  119. package/dist/types/Story.js +9 -2
  120. package/dist/types/User.js +9 -2
  121. package/dist/types/UserAccount.js +1 -1
  122. package/dist/types/common/Notification.js +9 -2
  123. package/dist/types/common/OEmbedInfo.js +9 -2
  124. package/dist/types/common/Pagination.js +9 -4
  125. package/dist/types/common/Query.js +9 -3
  126. package/dist/types/common/Utm.js +1 -1
  127. package/dist/types/common/Warning.js +1 -1
  128. package/dist/types/common/index.js +65 -6
  129. package/dist/types/index.js +325 -33
  130. package/dist/utils.js +9 -2
  131. package/package.json +6 -5
@@ -1,17 +1,23 @@
1
- import { routing } from "../../routing.js";
2
- export class Client {
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Client = void 0;
7
+ var _routing = require("../../routing.js");
8
+ class Client {
3
9
  constructor(apiClient) {
4
10
  this.apiClient = apiClient;
5
11
  }
6
12
  async list() {
7
- const url = routing.notificationSubscriptionsUrl;
13
+ const url = _routing.routing.notificationSubscriptionsUrl;
8
14
  const {
9
15
  subscriptions
10
16
  } = await this.apiClient.get(url);
11
17
  return subscriptions;
12
18
  }
13
19
  async update(payload) {
14
- const url = routing.notificationSubscriptionsUrl;
20
+ const url = _routing.routing.notificationSubscriptionsUrl;
15
21
  const {
16
22
  subscriptions
17
23
  } = await this.apiClient.patch(url, {
@@ -19,4 +25,5 @@ export class Client {
19
25
  });
20
26
  return subscriptions;
21
27
  }
22
- }
28
+ }
29
+ exports.Client = Client;
@@ -1,2 +1,25 @@
1
- export * from "./Client.js";
2
- export * from "./types.js";
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _Client = require("./Client.js");
7
+ Object.keys(_Client).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ Object.defineProperty(exports, key, {
10
+ enumerable: true,
11
+ get: function () {
12
+ return _Client[key];
13
+ }
14
+ });
15
+ });
16
+ var _types = require("./types.js");
17
+ Object.keys(_types).forEach(function (key) {
18
+ if (key === "default" || key === "__esModule") return;
19
+ Object.defineProperty(exports, key, {
20
+ enumerable: true,
21
+ get: function () {
22
+ return _types[key];
23
+ }
24
+ });
25
+ });
@@ -1 +1 @@
1
- export {};
1
+ "use strict";
@@ -1,18 +1,24 @@
1
- import { routing } from "../../routing.js";
2
- export class Client {
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Client = void 0;
7
+ var _routing = require("../../routing.js");
8
+ class Client {
3
9
  constructor(apiClient) {
4
10
  this.apiClient = apiClient;
5
11
  }
6
12
  async list() {
7
13
  const {
8
14
  senders
9
- } = await this.apiClient.get(routing.senderAddressesUrl);
15
+ } = await this.apiClient.get(_routing.routing.senderAddressesUrl);
10
16
  return senders;
11
17
  }
12
18
  async create(payload) {
13
19
  const {
14
20
  sender
15
- } = await this.apiClient.post(routing.senderAddressesUrl, {
21
+ } = await this.apiClient.post(_routing.routing.senderAddressesUrl, {
16
22
  payload
17
23
  });
18
24
  return sender;
@@ -20,18 +26,19 @@ export class Client {
20
26
  async get(senderId) {
21
27
  const {
22
28
  sender
23
- } = await this.apiClient.get(`${routing.senderAddressesUrl}/${senderId}`);
29
+ } = await this.apiClient.get(`${_routing.routing.senderAddressesUrl}/${senderId}`);
24
30
  return sender;
25
31
  }
26
32
  async update(senderId, payload) {
27
33
  const {
28
34
  sender
29
- } = await this.apiClient.patch(`${routing.senderAddressesUrl}/${senderId}`, {
35
+ } = await this.apiClient.patch(`${_routing.routing.senderAddressesUrl}/${senderId}`, {
30
36
  payload
31
37
  });
32
38
  return sender;
33
39
  }
34
40
  async remove(senderId) {
35
- return this.apiClient.delete(`${routing.senderAddressesUrl}/${senderId}`);
41
+ return this.apiClient.delete(`${_routing.routing.senderAddressesUrl}/${senderId}`);
36
42
  }
37
- }
43
+ }
44
+ exports.Client = Client;
@@ -1,2 +1,25 @@
1
- export * from "./Client.js";
2
- export * from "./types.js";
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _Client = require("./Client.js");
7
+ Object.keys(_Client).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ Object.defineProperty(exports, key, {
10
+ enumerable: true,
11
+ get: function () {
12
+ return _Client[key];
13
+ }
14
+ });
15
+ });
16
+ var _types = require("./types.js");
17
+ Object.keys(_types).forEach(function (key) {
18
+ if (key === "default" || key === "__esModule") return;
19
+ Object.defineProperty(exports, key, {
20
+ enumerable: true,
21
+ get: function () {
22
+ return _types[key];
23
+ }
24
+ });
25
+ });
@@ -1 +1 @@
1
- export {};
1
+ "use strict";
@@ -1,14 +1,21 @@
1
- import { routing } from "../../routing.js";
2
- export class Client {
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Client = void 0;
7
+ var _routing = require("../../routing.js");
8
+ class Client {
3
9
  constructor(apiClient) {
4
10
  this.apiClient = apiClient;
5
11
  }
6
12
  async checkEmailAvailability(email) {
7
- const url = `${routing.signup}/check-availability`;
13
+ const url = `${_routing.routing.signup}/check-availability`;
8
14
  return this.apiClient.post(url, {
9
15
  payload: {
10
16
  email
11
17
  }
12
18
  });
13
19
  }
14
- }
20
+ }
21
+ exports.Client = Client;
@@ -1,2 +1,25 @@
1
- export * from "./Client.js";
2
- export * from "./types.js";
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _Client = require("./Client.js");
7
+ Object.keys(_Client).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ Object.defineProperty(exports, key, {
10
+ enumerable: true,
11
+ get: function () {
12
+ return _Client[key];
13
+ }
14
+ });
15
+ });
16
+ var _types = require("./types.js");
17
+ Object.keys(_types).forEach(function (key) {
18
+ if (key === "default" || key === "__esModule") return;
19
+ Object.defineProperty(exports, key, {
20
+ enumerable: true,
21
+ get: function () {
22
+ return _types[key];
23
+ }
24
+ });
25
+ });
@@ -1,5 +1,12 @@
1
- export let EmailAvailability;
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.EmailAvailability = void 0;
7
+ let EmailAvailability;
8
+ exports.EmailAvailability = EmailAvailability;
2
9
  (function (EmailAvailability) {
3
10
  EmailAvailability["AVAILABLE"] = "available";
4
11
  EmailAvailability["TAKEN"] = "taken";
5
- })(EmailAvailability || (EmailAvailability = {}));
12
+ })(EmailAvailability || (exports.EmailAvailability = EmailAvailability = {}));
@@ -1,24 +1,30 @@
1
- import { routing } from "../../routing.js";
2
- export class Client {
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Client = void 0;
7
+ var _routing = require("../../routing.js");
8
+ class Client {
3
9
  constructor(apiClient) {
4
10
  this.apiClient = apiClient;
5
11
  }
6
12
  async list() {
7
- const url = routing.snippetsUrl;
13
+ const url = _routing.routing.snippetsUrl;
8
14
  const {
9
15
  snippets
10
16
  } = await this.apiClient.get(url);
11
17
  return snippets;
12
18
  }
13
19
  async get(snippetId) {
14
- const url = routing.snippetsUrl;
20
+ const url = _routing.routing.snippetsUrl;
15
21
  const {
16
22
  snippet
17
23
  } = await this.apiClient.get(`${url}/${snippetId}`);
18
24
  return snippet;
19
25
  }
20
26
  async create(payload) {
21
- const url = routing.snippetsUrl;
27
+ const url = _routing.routing.snippetsUrl;
22
28
  const {
23
29
  snippet
24
30
  } = await this.apiClient.post(url, {
@@ -27,7 +33,7 @@ export class Client {
27
33
  return snippet;
28
34
  }
29
35
  async update(snippetId, payload) {
30
- const url = routing.snippetsUrl;
36
+ const url = _routing.routing.snippetsUrl;
31
37
  const {
32
38
  snippet
33
39
  } = await this.apiClient.patch(`${url}/${snippetId}`, {
@@ -36,7 +42,8 @@ export class Client {
36
42
  return snippet;
37
43
  }
38
44
  async remove(snippetId) {
39
- const url = routing.snippetsUrl;
45
+ const url = _routing.routing.snippetsUrl;
40
46
  return this.apiClient.delete(`${url}/${snippetId}`);
41
47
  }
42
- }
48
+ }
49
+ exports.Client = Client;
@@ -1,2 +1,25 @@
1
- export * from "./Client.js";
2
- export * from "./types.js";
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _Client = require("./Client.js");
7
+ Object.keys(_Client).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ Object.defineProperty(exports, key, {
10
+ enumerable: true,
11
+ get: function () {
12
+ return _Client[key];
13
+ }
14
+ });
15
+ });
16
+ var _types = require("./types.js");
17
+ Object.keys(_types).forEach(function (key) {
18
+ if (key === "default" || key === "__esModule") return;
19
+ Object.defineProperty(exports, key, {
20
+ enumerable: true,
21
+ get: function () {
22
+ return _types[key];
23
+ }
24
+ });
25
+ });
@@ -1 +1 @@
1
- export {};
1
+ "use strict";
@@ -1,7 +1,13 @@
1
- import { HttpCodes } from "../../http/index.js";
2
- import { ApiError } from "../../http/ApiError.js";
3
- import { routing } from "../../routing.js";
4
- export class Client {
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Client = void 0;
7
+ var _index = require("../../http/index.js");
8
+ var _ApiError = require("../../http/ApiError.js");
9
+ var _routing = require("../../routing.js");
10
+ class Client {
5
11
  constructor(apiClient) {
6
12
  this.apiClient = apiClient;
7
13
  }
@@ -12,7 +18,7 @@ export class Client {
12
18
  sortOrder,
13
19
  include
14
20
  } = options ?? {};
15
- return this.apiClient.get(routing.storiesUrl, {
21
+ return this.apiClient.get(_routing.routing.storiesUrl, {
16
22
  query: {
17
23
  limit,
18
24
  offset,
@@ -29,7 +35,7 @@ export class Client {
29
35
  include,
30
36
  query
31
37
  } = options ?? {};
32
- return this.apiClient.post(routing.storiesSearchUrl, {
38
+ return this.apiClient.post(_routing.routing.storiesSearchUrl, {
33
39
  payload: {
34
40
  query,
35
41
  limit,
@@ -84,7 +90,7 @@ export class Client {
84
90
  }
85
91
  const {
86
92
  story
87
- } = await this.apiClient.get(`${routing.storiesUrl}/${arg}`, {
93
+ } = await this.apiClient.get(`${_routing.routing.storiesUrl}/${arg}`, {
88
94
  query: {
89
95
  include: include
90
96
  }
@@ -95,7 +101,7 @@ export class Client {
95
101
  const include = options?.include;
96
102
  const {
97
103
  story
98
- } = await this.apiClient.post(routing.storiesUrl, {
104
+ } = await this.apiClient.post(_routing.routing.storiesUrl, {
99
105
  payload,
100
106
  query: {
101
107
  include: include
@@ -105,7 +111,7 @@ export class Client {
105
111
  }
106
112
  async duplicate(id, options) {
107
113
  const include = options?.include;
108
- const url = `${routing.storiesUrl}/${id}/duplicate`;
114
+ const url = `${_routing.routing.storiesUrl}/${id}/duplicate`;
109
115
  const {
110
116
  story
111
117
  } = await this.apiClient.post(url, {
@@ -117,7 +123,7 @@ export class Client {
117
123
  }
118
124
  async translate(id, payload, options) {
119
125
  const include = options?.include;
120
- const url = `${routing.storiesUrl}/${id}/translate`;
126
+ const url = `${_routing.routing.storiesUrl}/${id}/translate`;
121
127
  const {
122
128
  story
123
129
  } = await this.apiClient.post(url, {
@@ -131,7 +137,7 @@ export class Client {
131
137
  async move(id, payload, options) {
132
138
  const include = options?.include;
133
139
  const force = options?.force;
134
- const url = `${routing.storiesUrl}/${id}/move`;
140
+ const url = `${_routing.routing.storiesUrl}/${id}/move`;
135
141
  try {
136
142
  const {
137
143
  story
@@ -147,14 +153,14 @@ export class Client {
147
153
  story
148
154
  };
149
155
  } catch (error) {
150
- if (error instanceof ApiError && error.status === HttpCodes.CONFLICT) {
156
+ if (error instanceof _ApiError.ApiError && error.status === _index.HttpCodes.CONFLICT) {
151
157
  return error.payload;
152
158
  }
153
159
  throw error;
154
160
  }
155
161
  }
156
162
  async update(id, payload, options) {
157
- const url = `${routing.storiesUrl}/${id}`;
163
+ const url = `${_routing.routing.storiesUrl}/${id}`;
158
164
  const include = options?.include;
159
165
  const {
160
166
  story
@@ -171,7 +177,7 @@ export class Client {
171
177
  * This operation is only allowed for V3 stories
172
178
  */
173
179
  async autosave(id, payload, options) {
174
- const url = `${routing.storiesUrl}/${id}/autosave`;
180
+ const url = `${_routing.routing.storiesUrl}/${id}/autosave`;
175
181
  const include = options?.include;
176
182
  const {
177
183
  story
@@ -188,7 +194,7 @@ export class Client {
188
194
  * This operation is only allowed for V3 stories
189
195
  */
190
196
  async revert(id, payload, options) {
191
- const url = `${routing.storiesUrl}/${id}/revert`;
197
+ const url = `${_routing.routing.storiesUrl}/${id}/revert`;
192
198
  const include = options?.include;
193
199
  const {
194
200
  story
@@ -201,7 +207,7 @@ export class Client {
201
207
  return story;
202
208
  }
203
209
  async publish(id, payload, options) {
204
- const url = `${routing.storiesUrl}/${id}/publish`;
210
+ const url = `${_routing.routing.storiesUrl}/${id}/publish`;
205
211
  const include = options?.include;
206
212
  const {
207
213
  story
@@ -214,7 +220,7 @@ export class Client {
214
220
  return story;
215
221
  }
216
222
  async unpublish(id, payload, options) {
217
- const url = `${routing.storiesUrl}/${id}/unpublish`;
223
+ const url = `${_routing.routing.storiesUrl}/${id}/unpublish`;
218
224
  const include = options?.include;
219
225
  const {
220
226
  story
@@ -227,7 +233,7 @@ export class Client {
227
233
  return story;
228
234
  }
229
235
  async schedule(id, payload, options) {
230
- const url = `${routing.storiesUrl}/${id}/schedule`;
236
+ const url = `${_routing.routing.storiesUrl}/${id}/schedule`;
231
237
  const include = options?.include;
232
238
  const {
233
239
  story
@@ -240,7 +246,7 @@ export class Client {
240
246
  return story;
241
247
  }
242
248
  async unschedule(id, payload, options) {
243
- const url = `${routing.storiesUrl}/${id}/unpublish`;
249
+ const url = `${_routing.routing.storiesUrl}/${id}/unpublish`;
244
250
  const include = options?.include;
245
251
  const {
246
252
  story
@@ -253,7 +259,7 @@ export class Client {
253
259
  return story;
254
260
  }
255
261
  async pin(id, options) {
256
- const url = `${routing.storiesUrl}/${id}/pin`;
262
+ const url = `${_routing.routing.storiesUrl}/${id}/pin`;
257
263
  const include = options?.include;
258
264
  const {
259
265
  story
@@ -266,7 +272,7 @@ export class Client {
266
272
  return story;
267
273
  }
268
274
  async unpin(id, options) {
269
- const url = `${routing.storiesUrl}/${id}/unpin`;
275
+ const url = `${_routing.routing.storiesUrl}/${id}/unpin`;
270
276
  const include = options?.include;
271
277
  const {
272
278
  story
@@ -278,7 +284,8 @@ export class Client {
278
284
  return story;
279
285
  }
280
286
  async delete(id) {
281
- const url = `${routing.storiesUrl}/${id}`;
287
+ const url = `${_routing.routing.storiesUrl}/${id}`;
282
288
  await this.apiClient.delete(url);
283
289
  }
284
- }
290
+ }
291
+ exports.Client = Client;
@@ -1,3 +1,35 @@
1
- export * from "./Client.js";
2
- export * from "./types.js";
3
- export * from "./scopes.js";
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _Client = require("./Client.js");
7
+ Object.keys(_Client).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ Object.defineProperty(exports, key, {
10
+ enumerable: true,
11
+ get: function () {
12
+ return _Client[key];
13
+ }
14
+ });
15
+ });
16
+ var _types = require("./types.js");
17
+ Object.keys(_types).forEach(function (key) {
18
+ if (key === "default" || key === "__esModule") return;
19
+ Object.defineProperty(exports, key, {
20
+ enumerable: true,
21
+ get: function () {
22
+ return _types[key];
23
+ }
24
+ });
25
+ });
26
+ var _scopes = require("./scopes.js");
27
+ Object.keys(_scopes).forEach(function (key) {
28
+ if (key === "default" || key === "__esModule") return;
29
+ Object.defineProperty(exports, key, {
30
+ enumerable: true,
31
+ get: function () {
32
+ return _scopes[key];
33
+ }
34
+ });
35
+ });
@@ -1,8 +1,15 @@
1
- import { Newsroom } from "../../types/index.js";
2
- export const Scope = {
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Scope = void 0;
7
+ var _index = require("../../types/index.js");
8
+ const Scope = {
3
9
  EXCLUDE_ARCHIVED_NEWSROOMS: {
4
10
  'newsroom.status': {
5
- $nin: [Newsroom.Status.ARCHIVED]
11
+ $nin: [_index.Newsroom.Status.ARCHIVED]
6
12
  }
7
13
  }
8
- };
14
+ };
15
+ exports.Scope = Scope;
@@ -1,3 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.EXTENDED_STORY_INCLUDED_EXTRA_FIELDS = exports.ALL_EXTRA_FIELDS = void 0;
1
7
  /**
2
8
  * Uploadcare image JSON string.
3
9
  */
@@ -39,5 +45,7 @@ const ALL_EXTRA_FIELDS_SHAPE = {
39
45
  'pitches.count': true
40
46
  }; // satisfies Record<keyof Story.OnDemandFields, boolean>; // TODO: Use Typescript `satisfies` operator, when it's out of beta
41
47
 
42
- export const ALL_EXTRA_FIELDS = Object.keys(ALL_EXTRA_FIELDS_SHAPE);
43
- export const EXTENDED_STORY_INCLUDED_EXTRA_FIELDS = Object.keys(EXTENDED_STORY_INCLUDED_EXTRA_FIELDS_SHAPE);
48
+ const ALL_EXTRA_FIELDS = Object.keys(ALL_EXTRA_FIELDS_SHAPE);
49
+ exports.ALL_EXTRA_FIELDS = ALL_EXTRA_FIELDS;
50
+ const EXTENDED_STORY_INCLUDED_EXTRA_FIELDS = Object.keys(EXTENDED_STORY_INCLUDED_EXTRA_FIELDS_SHAPE);
51
+ exports.EXTENDED_STORY_INCLUDED_EXTRA_FIELDS = EXTENDED_STORY_INCLUDED_EXTRA_FIELDS;
@@ -1,10 +1,16 @@
1
- import { routing } from "../../routing.js";
2
- export class Client {
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Client = void 0;
7
+ var _routing = require("../../routing.js");
8
+ class Client {
3
9
  constructor(apiClient) {
4
10
  this.apiClient = apiClient;
5
11
  }
6
12
  async subscribeToNewsroom(newsroomId, payload) {
7
- const url = routing.newsroomSubscribeUrl.replace(':newsroom_id', String(newsroomId));
13
+ const url = _routing.routing.newsroomSubscribeUrl.replace(':newsroom_id', String(newsroomId));
8
14
  const {
9
15
  subscription
10
16
  } = await this.apiClient.post(url, {
@@ -13,7 +19,7 @@ export class Client {
13
19
  return subscription;
14
20
  }
15
21
  async unsubscribeFromNewsroom(newsroomId, payload) {
16
- const url = routing.newsroomUnsubscribeUrl.replace(':newsroom_id', String(newsroomId));
22
+ const url = _routing.routing.newsroomUnsubscribeUrl.replace(':newsroom_id', String(newsroomId));
17
23
  const {
18
24
  subscription
19
25
  } = await this.apiClient.post(url, {
@@ -22,7 +28,7 @@ export class Client {
22
28
  return subscription;
23
29
  }
24
30
  async updateNewsroomUnsubscribeDetails(newsroomId, subscriptionId, payload) {
25
- const url = routing.newsroomUnsubscribeUrl.replace(':newsroom_id', String(newsroomId));
31
+ const url = _routing.routing.newsroomUnsubscribeUrl.replace(':newsroom_id', String(newsroomId));
26
32
  const {
27
33
  subscription
28
34
  } = await this.apiClient.patch(`${url}/${subscriptionId}`, {
@@ -31,7 +37,7 @@ export class Client {
31
37
  return subscription;
32
38
  }
33
39
  async unsubscribeFromLicense(payload) {
34
- const url = routing.licenseUnsubscribeUrl;
40
+ const url = _routing.routing.licenseUnsubscribeUrl;
35
41
  const {
36
42
  subscription
37
43
  } = await this.apiClient.post(url, {
@@ -40,7 +46,7 @@ export class Client {
40
46
  return subscription;
41
47
  }
42
48
  async updateLicenseUnsubscribeDetails(subscriptionId, payload) {
43
- const url = routing.licenseUnsubscribeUrl;
49
+ const url = _routing.routing.licenseUnsubscribeUrl;
44
50
  const {
45
51
  subscription
46
52
  } = await this.apiClient.patch(`${url}/${subscriptionId}`, {
@@ -48,4 +54,5 @@ export class Client {
48
54
  });
49
55
  return subscription;
50
56
  }
51
- }
57
+ }
58
+ exports.Client = Client;
@@ -1,2 +1,25 @@
1
- export * from "./Client.js";
2
- export * from "./types.js";
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _Client = require("./Client.js");
7
+ Object.keys(_Client).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ Object.defineProperty(exports, key, {
10
+ enumerable: true,
11
+ get: function () {
12
+ return _Client[key];
13
+ }
14
+ });
15
+ });
16
+ var _types = require("./types.js");
17
+ Object.keys(_types).forEach(function (key) {
18
+ if (key === "default" || key === "__esModule") return;
19
+ Object.defineProperty(exports, key, {
20
+ enumerable: true,
21
+ get: function () {
22
+ return _types[key];
23
+ }
24
+ });
25
+ });
@@ -1,8 +1,15 @@
1
- export let UnsubscribeReason;
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.UnsubscribeReason = void 0;
7
+ let UnsubscribeReason;
8
+ exports.UnsubscribeReason = UnsubscribeReason;
2
9
  (function (UnsubscribeReason) {
3
10
  UnsubscribeReason["UNKNOWN"] = "unknown";
4
11
  UnsubscribeReason["UNWANTED"] = "unwanted";
5
12
  UnsubscribeReason["SPAM"] = "spam";
6
13
  UnsubscribeReason["NEVER_SIGNED_UP"] = "never_signed_up";
7
14
  UnsubscribeReason["OTHER"] = "other";
8
- })(UnsubscribeReason || (UnsubscribeReason = {}));
15
+ })(UnsubscribeReason || (exports.UnsubscribeReason = UnsubscribeReason = {}));