@prezly/sdk 11.8.1-cjs → 11.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/dist/Client.cjs +45 -0
  2. package/dist/Client.js +27 -33
  3. package/dist/api/ApiClient.cjs +95 -0
  4. package/dist/api/ApiClient.js +12 -19
  5. package/dist/api/DeferredJobsApiClient.cjs +99 -0
  6. package/dist/api/DeferredJobsApiClient.js +12 -19
  7. package/dist/api/constants.cjs +10 -0
  8. package/dist/api/constants.js +2 -9
  9. package/dist/api/index.cjs +19 -0
  10. package/dist/api/index.js +2 -19
  11. package/dist/endpoints/Accounts/Client.cjs +29 -0
  12. package/dist/endpoints/Accounts/Client.js +6 -13
  13. package/dist/endpoints/Accounts/index.cjs +25 -0
  14. package/dist/endpoints/Accounts/index.js +2 -25
  15. package/dist/endpoints/Accounts/types.cjs +1 -0
  16. package/dist/endpoints/Accounts/types.js +1 -1
  17. package/dist/endpoints/Billing/Client.cjs +19 -0
  18. package/dist/endpoints/Billing/Client.js +4 -11
  19. package/dist/endpoints/Billing/index.cjs +25 -0
  20. package/dist/endpoints/Billing/index.js +2 -25
  21. package/dist/endpoints/Billing/types.cjs +25 -0
  22. package/dist/endpoints/Billing/types.js +6 -15
  23. package/dist/endpoints/CampaignRecipients/Client.cjs +85 -0
  24. package/dist/endpoints/CampaignRecipients/Client.js +12 -19
  25. package/dist/endpoints/CampaignRecipients/index.cjs +37 -0
  26. package/dist/endpoints/CampaignRecipients/index.js +3 -37
  27. package/dist/endpoints/CampaignRecipients/types.cjs +1 -0
  28. package/dist/endpoints/CampaignRecipients/types.js +1 -1
  29. package/dist/endpoints/Campaigns/Client.cjs +92 -0
  30. package/dist/endpoints/Campaigns/Client.js +18 -25
  31. package/dist/endpoints/Campaigns/index.cjs +25 -0
  32. package/dist/endpoints/Campaigns/index.js +2 -25
  33. package/dist/endpoints/Campaigns/types.cjs +1 -0
  34. package/dist/endpoints/Campaigns/types.js +1 -1
  35. package/dist/endpoints/ContactsExports/Client.cjs +98 -0
  36. package/dist/endpoints/ContactsExports/Client.js +8 -15
  37. package/dist/endpoints/ContactsExports/index.cjs +37 -0
  38. package/dist/endpoints/ContactsExports/index.js +3 -37
  39. package/dist/endpoints/ContactsExports/types.cjs +1 -0
  40. package/dist/endpoints/ContactsExports/types.js +1 -1
  41. package/dist/endpoints/Coverage/Client.cjs +109 -0
  42. package/dist/endpoints/Coverage/Client.js +12 -19
  43. package/dist/endpoints/Coverage/index.cjs +25 -0
  44. package/dist/endpoints/Coverage/index.js +2 -25
  45. package/dist/endpoints/Coverage/types.cjs +1 -0
  46. package/dist/endpoints/Coverage/types.js +1 -1
  47. package/dist/endpoints/Jobs/Client.cjs +19 -0
  48. package/dist/endpoints/Jobs/Client.js +4 -11
  49. package/dist/endpoints/Jobs/index.cjs +25 -0
  50. package/dist/endpoints/Jobs/index.js +2 -25
  51. package/dist/endpoints/Jobs/types.cjs +1 -0
  52. package/dist/endpoints/Jobs/types.js +1 -1
  53. package/dist/endpoints/Licenses/Client.cjs +20 -0
  54. package/dist/endpoints/Licenses/Client.js +4 -11
  55. package/dist/endpoints/Licenses/index.cjs +15 -0
  56. package/dist/endpoints/Licenses/index.js +1 -15
  57. package/dist/endpoints/NewsroomCategories/Client.cjs +55 -0
  58. package/dist/endpoints/NewsroomCategories/Client.js +8 -15
  59. package/dist/endpoints/NewsroomCategories/index.cjs +25 -0
  60. package/dist/endpoints/NewsroomCategories/index.js +2 -25
  61. package/dist/endpoints/NewsroomCategories/types.cjs +1 -0
  62. package/dist/endpoints/NewsroomCategories/types.js +1 -1
  63. package/dist/endpoints/NewsroomContacts/Client.cjs +76 -0
  64. package/dist/endpoints/NewsroomContacts/Client.js +11 -18
  65. package/dist/endpoints/NewsroomContacts/index.cjs +25 -0
  66. package/dist/endpoints/NewsroomContacts/index.js +2 -25
  67. package/dist/endpoints/NewsroomContacts/types.cjs +1 -0
  68. package/dist/endpoints/NewsroomContacts/types.js +1 -1
  69. package/dist/endpoints/NewsroomDomains/Client.cjs +48 -0
  70. package/dist/endpoints/NewsroomDomains/Client.js +9 -16
  71. package/dist/endpoints/NewsroomDomains/index.cjs +25 -0
  72. package/dist/endpoints/NewsroomDomains/index.js +2 -25
  73. package/dist/endpoints/NewsroomDomains/types.cjs +1 -0
  74. package/dist/endpoints/NewsroomDomains/types.js +1 -1
  75. package/dist/endpoints/NewsroomGalleries/Client.cjs +82 -0
  76. package/dist/endpoints/NewsroomGalleries/Client.js +13 -20
  77. package/dist/endpoints/NewsroomGalleries/index.cjs +25 -0
  78. package/dist/endpoints/NewsroomGalleries/index.js +2 -25
  79. package/dist/endpoints/NewsroomGalleries/types.cjs +1 -0
  80. package/dist/endpoints/NewsroomGalleries/types.js +1 -1
  81. package/dist/endpoints/NewsroomLanguages/Client.cjs +100 -0
  82. package/dist/endpoints/NewsroomLanguages/Client.js +10 -17
  83. package/dist/endpoints/NewsroomLanguages/index.cjs +25 -0
  84. package/dist/endpoints/NewsroomLanguages/index.js +2 -25
  85. package/dist/endpoints/NewsroomLanguages/lib.cjs +9 -0
  86. package/dist/endpoints/NewsroomLanguages/lib.js +1 -7
  87. package/dist/endpoints/NewsroomLanguages/types.cjs +1 -0
  88. package/dist/endpoints/NewsroomLanguages/types.js +1 -1
  89. package/dist/endpoints/NewsroomPrivacyRequests/Client.cjs +29 -0
  90. package/dist/endpoints/NewsroomPrivacyRequests/Client.js +5 -12
  91. package/dist/endpoints/NewsroomPrivacyRequests/index.cjs +25 -0
  92. package/dist/endpoints/NewsroomPrivacyRequests/index.js +2 -25
  93. package/dist/endpoints/NewsroomPrivacyRequests/types.cjs +1 -0
  94. package/dist/endpoints/NewsroomPrivacyRequests/types.js +1 -1
  95. package/dist/endpoints/NewsroomSubscriptions/Client.cjs +22 -0
  96. package/dist/endpoints/NewsroomSubscriptions/Client.js +4 -11
  97. package/dist/endpoints/NewsroomSubscriptions/index.cjs +25 -0
  98. package/dist/endpoints/NewsroomSubscriptions/index.js +2 -25
  99. package/dist/endpoints/NewsroomSubscriptions/types.cjs +1 -0
  100. package/dist/endpoints/NewsroomSubscriptions/types.js +1 -1
  101. package/dist/endpoints/NewsroomThemes/Client.cjs +43 -0
  102. package/dist/endpoints/NewsroomThemes/Client.js +7 -14
  103. package/dist/endpoints/NewsroomThemes/index.cjs +15 -0
  104. package/dist/endpoints/NewsroomThemes/index.js +1 -15
  105. package/dist/endpoints/NewsroomWebhooks/Client.cjs +49 -0
  106. package/dist/endpoints/NewsroomWebhooks/Client.js +8 -15
  107. package/dist/endpoints/NewsroomWebhooks/index.cjs +25 -0
  108. package/dist/endpoints/NewsroomWebhooks/index.js +2 -25
  109. package/dist/endpoints/NewsroomWebhooks/types.cjs +1 -0
  110. package/dist/endpoints/NewsroomWebhooks/types.js +1 -1
  111. package/dist/endpoints/Newsrooms/Client.cjs +97 -0
  112. package/dist/endpoints/Newsrooms/Client.js +15 -22
  113. package/dist/endpoints/Newsrooms/index.cjs +25 -0
  114. package/dist/endpoints/Newsrooms/index.js +2 -25
  115. package/dist/endpoints/Newsrooms/types.cjs +1 -0
  116. package/dist/endpoints/Newsrooms/types.js +1 -1
  117. package/dist/endpoints/NotificationSubscriptions/Client.cjs +29 -0
  118. package/dist/endpoints/NotificationSubscriptions/Client.js +5 -12
  119. package/dist/endpoints/NotificationSubscriptions/index.cjs +25 -0
  120. package/dist/endpoints/NotificationSubscriptions/index.js +2 -25
  121. package/dist/endpoints/NotificationSubscriptions/types.cjs +1 -0
  122. package/dist/endpoints/NotificationSubscriptions/types.js +1 -1
  123. package/dist/endpoints/SenderAddresses/Client.cjs +44 -0
  124. package/dist/endpoints/SenderAddresses/Client.js +8 -15
  125. package/dist/endpoints/SenderAddresses/index.cjs +25 -0
  126. package/dist/endpoints/SenderAddresses/index.js +2 -25
  127. package/dist/endpoints/SenderAddresses/types.cjs +1 -0
  128. package/dist/endpoints/SenderAddresses/types.js +1 -1
  129. package/dist/endpoints/Signup/Client.cjs +21 -0
  130. package/dist/endpoints/Signup/Client.js +4 -11
  131. package/dist/endpoints/Signup/index.cjs +25 -0
  132. package/dist/endpoints/Signup/index.js +2 -25
  133. package/dist/endpoints/Signup/types.cjs +12 -0
  134. package/dist/endpoints/Signup/types.js +2 -9
  135. package/dist/endpoints/Snippets/Client.cjs +49 -0
  136. package/dist/endpoints/Snippets/Client.js +8 -15
  137. package/dist/endpoints/Snippets/index.cjs +25 -0
  138. package/dist/endpoints/Snippets/index.js +2 -25
  139. package/dist/endpoints/Snippets/types.cjs +1 -0
  140. package/dist/endpoints/Snippets/types.js +1 -1
  141. package/dist/endpoints/Stories/Client.cjs +290 -0
  142. package/dist/endpoints/Stories/Client.d.ts +25 -20
  143. package/dist/endpoints/Stories/Client.js +22 -30
  144. package/dist/endpoints/Stories/index.cjs +35 -0
  145. package/dist/endpoints/Stories/index.js +3 -35
  146. package/dist/endpoints/Stories/scopes.cjs +15 -0
  147. package/dist/endpoints/Stories/scopes.js +4 -11
  148. package/dist/endpoints/Stories/types.cjs +51 -0
  149. package/dist/endpoints/Stories/types.js +2 -10
  150. package/dist/endpoints/Subscriptions/Client.cjs +58 -0
  151. package/dist/endpoints/Subscriptions/Client.js +8 -15
  152. package/dist/endpoints/Subscriptions/index.cjs +25 -0
  153. package/dist/endpoints/Subscriptions/index.js +2 -25
  154. package/dist/endpoints/Subscriptions/types.cjs +15 -0
  155. package/dist/endpoints/Subscriptions/types.js +2 -9
  156. package/dist/endpoints/index.cjs +56 -0
  157. package/dist/endpoints/index.js +24 -56
  158. package/dist/http/ApiError.cjs +21 -0
  159. package/dist/http/ApiError.js +2 -9
  160. package/dist/http/Http.cjs +69 -0
  161. package/dist/http/Http.js +14 -21
  162. package/dist/http/constants.cjs +12 -0
  163. package/dist/http/constants.js +3 -12
  164. package/dist/http/createRequest.cjs +106 -0
  165. package/dist/http/createRequest.js +13 -20
  166. package/dist/http/index.cjs +39 -0
  167. package/dist/http/index.js +4 -39
  168. package/dist/http/lib.cjs +39 -0
  169. package/dist/http/lib.js +6 -16
  170. package/dist/http/types.cjs +25 -0
  171. package/dist/http/types.js +4 -12
  172. package/dist/index.cjs +56 -0
  173. package/dist/index.js +5 -56
  174. package/dist/routing.cjs +38 -0
  175. package/dist/routing.js +2 -9
  176. package/dist/types/Campaign.cjs +69 -0
  177. package/dist/types/Campaign.js +4 -11
  178. package/dist/types/Category.cjs +1 -0
  179. package/dist/types/Category.js +1 -1
  180. package/dist/types/Contact.cjs +82 -0
  181. package/dist/types/Contact.js +2 -9
  182. package/dist/types/ContactDuplicateSuggestion.cjs +17 -0
  183. package/dist/types/ContactDuplicateSuggestion.js +2 -9
  184. package/dist/types/ContactsExport.cjs +17 -0
  185. package/dist/types/ContactsExport.js +2 -9
  186. package/dist/types/ContactsScope.cjs +19 -0
  187. package/dist/types/ContactsScope.js +2 -9
  188. package/dist/types/Country.cjs +1 -0
  189. package/dist/types/Country.js +1 -1
  190. package/dist/types/CoverageEntry.cjs +32 -0
  191. package/dist/types/CoverageEntry.js +2 -9
  192. package/dist/types/Culture.cjs +16 -0
  193. package/dist/types/Culture.js +2 -9
  194. package/dist/types/Currency.cjs +13 -0
  195. package/dist/types/Currency.js +2 -9
  196. package/dist/types/DnsConfigurationInstruction.cjs +1 -0
  197. package/dist/types/DnsConfigurationInstruction.js +1 -1
  198. package/dist/types/EmailRecipient.cjs +18 -0
  199. package/dist/types/EmailRecipient.js +2 -9
  200. package/dist/types/EmailSubscription.cjs +1 -0
  201. package/dist/types/EmailSubscription.js +1 -1
  202. package/dist/types/JobState.cjs +13 -0
  203. package/dist/types/JobState.js +2 -9
  204. package/dist/types/License.cjs +31 -0
  205. package/dist/types/License.js +2 -9
  206. package/dist/types/Newsroom.cjs +30 -0
  207. package/dist/types/Newsroom.js +2 -9
  208. package/dist/types/NewsroomCompanyInformation.cjs +1 -0
  209. package/dist/types/NewsroomCompanyInformation.js +1 -1
  210. package/dist/types/NewsroomContact.cjs +1 -0
  211. package/dist/types/NewsroomContact.js +1 -1
  212. package/dist/types/NewsroomDomain.cjs +24 -0
  213. package/dist/types/NewsroomDomain.js +2 -9
  214. package/dist/types/NewsroomGallery.cjs +16 -0
  215. package/dist/types/NewsroomGallery.js +2 -9
  216. package/dist/types/NewsroomLanguageSettings.cjs +1 -0
  217. package/dist/types/NewsroomLanguageSettings.js +1 -1
  218. package/dist/types/NewsroomTheme.cjs +38 -0
  219. package/dist/types/NewsroomTheme.js +4 -12
  220. package/dist/types/NewsroomWebhook.cjs +20 -0
  221. package/dist/types/NewsroomWebhook.js +2 -9
  222. package/dist/types/NotificationSubscription.cjs +17 -0
  223. package/dist/types/NotificationSubscription.js +2 -9
  224. package/dist/types/Permissions.cjs +18 -0
  225. package/dist/types/Permissions.js +2 -9
  226. package/dist/types/Plan.cjs +18 -0
  227. package/dist/types/Plan.js +2 -9
  228. package/dist/types/PrivacyRequest.cjs +24 -0
  229. package/dist/types/PrivacyRequest.js +2 -9
  230. package/dist/types/SEOSettings.cjs +1 -0
  231. package/dist/types/SEOSettings.js +1 -1
  232. package/dist/types/SenderAddress.cjs +16 -0
  233. package/dist/types/SenderAddress.js +2 -9
  234. package/dist/types/SenderDomain.cjs +18 -0
  235. package/dist/types/SenderDomain.js +2 -9
  236. package/dist/types/Snippet.cjs +1 -0
  237. package/dist/types/Snippet.js +1 -1
  238. package/dist/types/Story.cjs +89 -0
  239. package/dist/types/Story.js +2 -9
  240. package/dist/types/User.cjs +28 -0
  241. package/dist/types/User.js +2 -9
  242. package/dist/types/UserAccount.cjs +1 -0
  243. package/dist/types/UserAccount.js +1 -1
  244. package/dist/types/common/Notification.cjs +18 -0
  245. package/dist/types/common/Notification.js +2 -9
  246. package/dist/types/common/OEmbedInfo.cjs +18 -0
  247. package/dist/types/common/OEmbedInfo.js +2 -9
  248. package/dist/types/common/Pagination.cjs +15 -0
  249. package/dist/types/common/Pagination.js +4 -9
  250. package/dist/types/common/Query.cjs +21 -0
  251. package/dist/types/common/Query.js +3 -9
  252. package/dist/types/common/Utm.cjs +1 -0
  253. package/dist/types/common/Utm.js +1 -1
  254. package/dist/types/common/Warning.cjs +1 -0
  255. package/dist/types/common/Warning.js +1 -1
  256. package/dist/types/common/index.cjs +65 -0
  257. package/dist/types/common/index.js +6 -65
  258. package/dist/types/index.cjs +325 -0
  259. package/dist/types/index.js +33 -325
  260. package/dist/utils.cjs +30 -0
  261. package/dist/utils.js +2 -9
  262. package/package.json +16 -6
@@ -0,0 +1,290 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Client = void 0;
7
+ var _index = require("../../http/index.cjs");
8
+ var _routing = require("../../routing.cjs");
9
+ class Client {
10
+ constructor(apiClient) {
11
+ this.apiClient = apiClient;
12
+ }
13
+ async list(options) {
14
+ const {
15
+ limit,
16
+ offset,
17
+ sortOrder,
18
+ include
19
+ } = options ?? {};
20
+ return this.apiClient.get(_routing.routing.storiesUrl, {
21
+ query: {
22
+ limit,
23
+ offset,
24
+ sort: sortOrder,
25
+ include: include ? include.join(',') : undefined
26
+ }
27
+ });
28
+ }
29
+ async search(options) {
30
+ const {
31
+ limit,
32
+ offset,
33
+ sortOrder,
34
+ include,
35
+ query
36
+ } = options ?? {};
37
+ return this.apiClient.post(_routing.routing.storiesSearchUrl, {
38
+ payload: {
39
+ query,
40
+ limit,
41
+ offset,
42
+ sort: sortOrder,
43
+ include: include ? include.join(',') : undefined
44
+ }
45
+ });
46
+ }
47
+
48
+ /**
49
+ * Get story by UUID.
50
+ */
51
+
52
+ /**
53
+ * Implementation
54
+ */
55
+ async get(arg, options) {
56
+ const include = options?.include;
57
+ const isArray = Array.isArray(arg);
58
+ if (isArray && arg.length === 0) {
59
+ // No need to call the API.
60
+ return [];
61
+ }
62
+ if (isArray && typeof arg[0] === 'number') {
63
+ const {
64
+ stories
65
+ } = await this.search({
66
+ limit: arg.length,
67
+ query: {
68
+ id: {
69
+ $in: arg
70
+ }
71
+ },
72
+ include
73
+ });
74
+ return stories;
75
+ }
76
+ if (isArray && typeof arg[0] === 'string') {
77
+ const {
78
+ stories
79
+ } = await this.search({
80
+ limit: arg.length,
81
+ query: {
82
+ uuid: {
83
+ $in: arg
84
+ }
85
+ },
86
+ include
87
+ });
88
+ return stories;
89
+ }
90
+ const {
91
+ story
92
+ } = await this.apiClient.get(`${_routing.routing.storiesUrl}/${arg}`, {
93
+ query: {
94
+ include: include
95
+ }
96
+ });
97
+ return story;
98
+ }
99
+ async create(payload, options) {
100
+ const include = options?.include;
101
+ const {
102
+ story
103
+ } = await this.apiClient.post(_routing.routing.storiesUrl, {
104
+ payload,
105
+ query: {
106
+ include: include
107
+ }
108
+ });
109
+ return story;
110
+ }
111
+ async duplicate(id, options) {
112
+ const include = options?.include;
113
+ const url = `${_routing.routing.storiesUrl}/${id}/duplicate`;
114
+ const {
115
+ story
116
+ } = await this.apiClient.post(url, {
117
+ query: {
118
+ include: include
119
+ }
120
+ });
121
+ return story;
122
+ }
123
+ async translate(id, payload, options) {
124
+ const include = options?.include;
125
+ const url = `${_routing.routing.storiesUrl}/${id}/translate`;
126
+ const {
127
+ story
128
+ } = await this.apiClient.post(url, {
129
+ query: {
130
+ include: include
131
+ },
132
+ payload
133
+ });
134
+ return story;
135
+ }
136
+ async move(id, payload, options) {
137
+ const include = options?.include;
138
+ const force = options?.force;
139
+ const url = `${_routing.routing.storiesUrl}/${id}/move`;
140
+ try {
141
+ const {
142
+ story
143
+ } = await this.apiClient.post(url, {
144
+ query: {
145
+ include: include,
146
+ force
147
+ },
148
+ payload
149
+ });
150
+ return {
151
+ status: 'success',
152
+ story
153
+ };
154
+ } catch (error) {
155
+ if (error instanceof _index.ApiError && error.status === _index.HttpCodes.CONFLICT) {
156
+ return error.payload;
157
+ }
158
+ throw error;
159
+ }
160
+ }
161
+ async update(id, payload, options) {
162
+ const url = `${_routing.routing.storiesUrl}/${id}`;
163
+ const include = options?.include;
164
+ const {
165
+ story
166
+ } = await this.apiClient.patch(url, {
167
+ payload,
168
+ query: {
169
+ include: include
170
+ }
171
+ });
172
+ return story;
173
+ }
174
+
175
+ /**
176
+ * This operation is only allowed for V3 stories
177
+ */
178
+ async autosave(id, payload, options) {
179
+ const url = `${_routing.routing.storiesUrl}/${id}/autosave`;
180
+ const include = options?.include;
181
+ const {
182
+ story
183
+ } = await this.apiClient.patch(url, {
184
+ payload,
185
+ query: {
186
+ include: include
187
+ }
188
+ });
189
+ return story;
190
+ }
191
+
192
+ /**
193
+ * This operation is only allowed for V3 stories
194
+ */
195
+ async revert(id, payload, options) {
196
+ const url = `${_routing.routing.storiesUrl}/${id}/revert`;
197
+ const include = options?.include;
198
+ const {
199
+ story
200
+ } = await this.apiClient.post(url, {
201
+ payload,
202
+ query: {
203
+ include: include
204
+ }
205
+ });
206
+ return story;
207
+ }
208
+ async publish(id, payload, options) {
209
+ const url = `${_routing.routing.storiesUrl}/${id}/publish`;
210
+ const include = options?.include;
211
+ const {
212
+ story
213
+ } = await this.apiClient.post(url, {
214
+ payload,
215
+ query: {
216
+ include: include
217
+ }
218
+ });
219
+ return story;
220
+ }
221
+ async unpublish(id, payload, options) {
222
+ const url = `${_routing.routing.storiesUrl}/${id}/unpublish`;
223
+ const include = options?.include;
224
+ const {
225
+ story
226
+ } = await this.apiClient.post(url, {
227
+ payload,
228
+ query: {
229
+ include: include
230
+ }
231
+ });
232
+ return story;
233
+ }
234
+ async schedule(id, payload, options) {
235
+ const url = `${_routing.routing.storiesUrl}/${id}/schedule`;
236
+ const include = options?.include;
237
+ const {
238
+ story
239
+ } = await this.apiClient.post(url, {
240
+ payload,
241
+ query: {
242
+ include: include
243
+ }
244
+ });
245
+ return story;
246
+ }
247
+ async unschedule(id, payload, options) {
248
+ const url = `${_routing.routing.storiesUrl}/${id}/unpublish`;
249
+ const include = options?.include;
250
+ const {
251
+ story
252
+ } = await this.apiClient.post(url, {
253
+ payload,
254
+ query: {
255
+ include: include
256
+ }
257
+ });
258
+ return story;
259
+ }
260
+ async pin(id, options) {
261
+ const url = `${_routing.routing.storiesUrl}/${id}/pin`;
262
+ const include = options?.include;
263
+ const {
264
+ story
265
+ } = await this.apiClient.post(url, {
266
+ query: {
267
+ include: include,
268
+ force: options?.force || undefined
269
+ }
270
+ });
271
+ return story;
272
+ }
273
+ async unpin(id, options) {
274
+ const url = `${_routing.routing.storiesUrl}/${id}/unpin`;
275
+ const include = options?.include;
276
+ const {
277
+ story
278
+ } = await this.apiClient.post(url, {
279
+ query: {
280
+ include: include
281
+ }
282
+ });
283
+ return story;
284
+ }
285
+ async delete(id) {
286
+ const url = `${_routing.routing.storiesUrl}/${id}`;
287
+ await this.apiClient.delete(url);
288
+ }
289
+ }
290
+ exports.Client = Client;
@@ -5,52 +5,57 @@ import type { AutosaveRequest, ChangeNewsroomSuccessResponse, ChangeNewsroomUnsa
5
5
  * `uuid` is the preferred way of targeting a Story. Numeric `id` is considered deprecated.
6
6
  */
7
7
  declare type StoryId = Story['uuid'] | Story['id'];
8
+ /**
9
+ * Utility type to forbid arbitrary ad-hoc extensions of generic parameters.
10
+ * @see https://stackoverflow.com/a/69666350
11
+ */
12
+ declare type Exactly<T, X> = T & Record<Exclude<keyof X, keyof T>, never>;
8
13
  export declare class Client {
9
14
  private readonly apiClient;
10
15
  constructor(apiClient: DeferredJobsApiClient);
11
- list<Include extends readonly (keyof Story.ExtraFields)[], Options extends ListOptions<Include>, StoryRecord extends Story = Options['include'] extends Include ? Story & Pick<Story.ExtraFields, Options['include'][number]> : Story>(options?: Options): Promise<ListResponse<StoryRecord>>;
12
- search<Include extends readonly (keyof Story.ExtraFields)[], Options extends SearchOptions<Include>, StoryRecord extends Story = Options['include'] extends Include ? Story & Pick<Story.ExtraFields, Options['include'][number]> : Story>(options?: Options): Promise<ListResponse<StoryRecord>>;
16
+ list<Include extends readonly (keyof Story.ExtraFields)[], Options extends ListOptions<Include>, StoryRecord extends Story = Options['include'] extends Include ? Story & Pick<Story.ExtraFields, Options['include'][number]> : Story>(options?: Exactly<ListOptions<Include>, Options>): Promise<ListResponse<StoryRecord>>;
17
+ search<Include extends readonly (keyof Story.ExtraFields)[], Options extends SearchOptions<Include>, StoryRecord extends Story = Options['include'] extends Include ? Story & Pick<Story.ExtraFields, Options['include'][number]> : Story>(options?: Exactly<SearchOptions<Include>, Options>): Promise<ListResponse<StoryRecord>>;
13
18
  /**
14
19
  * Get story by UUID.
15
20
  */
16
- get<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: Story['uuid'], options?: Options): Promise<StoryRecord>;
21
+ get<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: Story['uuid'], options?: Exactly<IncludeOptions<Include>, Options>): Promise<StoryRecord>;
17
22
  /**
18
23
  * Get multiple stories by UUIDs.
19
24
  */
20
- get<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(ids: Story['uuid'][], options?: Options): Promise<StoryRecord[]>;
25
+ get<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(ids: Story['uuid'][], options?: Exactly<IncludeOptions<Include>, Options>): Promise<StoryRecord[]>;
21
26
  /**
22
27
  * Get story by deprecated numeric ID, or UUID.
23
28
  * @deprecated Please use UUID instead.
24
29
  */
25
- get<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: Story['id'] | Story['uuid'], options?: Options): Promise<StoryRecord>;
30
+ get<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: Story['id'] | Story['uuid'], options?: Exactly<IncludeOptions<Include>, Options>): Promise<StoryRecord>;
26
31
  /**
27
32
  * Get multiple stories by numeric IDs.
28
33
  * @deprecated Please use UUID instead.
29
34
  */
30
- get<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(ids: Story['id'][], options?: Options): Promise<StoryRecord[]>;
31
- create<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(payload: CreateRequest, options?: Options): Promise<StoryRecord>;
32
- duplicate<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: StoryId, options?: Options): Promise<StoryRecord>;
33
- translate<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: StoryId, payload: TranslateRequest, options?: Options): Promise<StoryRecord>;
34
- move<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include> & {
35
+ get<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(ids: Story['id'][], options?: Exactly<IncludeOptions<Include>, Options>): Promise<StoryRecord[]>;
36
+ create<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(payload: CreateRequest, options?: Exactly<IncludeOptions<Include>, Options>): Promise<StoryRecord>;
37
+ duplicate<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: StoryId, options?: Exactly<IncludeOptions<Include>, Options>): Promise<StoryRecord>;
38
+ translate<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: StoryId, payload: TranslateRequest, options?: Exactly<IncludeOptions<Include>, Options>): Promise<StoryRecord>;
39
+ move<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: StoryId, payload: MoveRequest, options?: Exactly<IncludeOptions<Include>, Options> & {
35
40
  force?: true;
36
- }, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: StoryId, payload: MoveRequest, options?: Options): Promise<ChangeNewsroomSuccessResponse<StoryRecord> | ChangeNewsroomUnsafeResponse>;
37
- update<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: StoryId, payload: UpdateRequest, options?: Options): Promise<StoryRecord>;
41
+ }): Promise<ChangeNewsroomSuccessResponse<StoryRecord> | ChangeNewsroomUnsafeResponse>;
42
+ update<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: StoryId, payload: UpdateRequest, options?: Exactly<IncludeOptions<Include>, Options>): Promise<StoryRecord>;
38
43
  /**
39
44
  * This operation is only allowed for V3 stories
40
45
  */
41
- autosave<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: StoryId, payload: AutosaveRequest, options?: Options): Promise<StoryRecord>;
46
+ autosave<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: StoryId, payload: AutosaveRequest, options?: Exactly<IncludeOptions<Include>, Options>): Promise<StoryRecord>;
42
47
  /**
43
48
  * This operation is only allowed for V3 stories
44
49
  */
45
- revert<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: StoryId, payload?: RevertRequest, options?: Options): Promise<StoryRecord>;
46
- publish<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: StoryId, payload?: PublishRequest, options?: Options): Promise<StoryRecord>;
47
- unpublish<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: StoryId, payload?: UnpublishRequest, options?: Options): Promise<StoryRecord>;
48
- schedule<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: StoryId, payload?: ScheduleRequest, options?: Options): Promise<StoryRecord>;
49
- unschedule<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: StoryId, payload?: UnscheduleRequest, options?: Options): Promise<StoryRecord>;
50
- pin<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: StoryId, options?: Options & {
50
+ revert<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: StoryId, payload?: RevertRequest, options?: Exactly<IncludeOptions<Include>, Options>): Promise<StoryRecord>;
51
+ publish<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: StoryId, payload?: PublishRequest, options?: Exactly<IncludeOptions<Include>, Options>): Promise<StoryRecord>;
52
+ unpublish<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: StoryId, payload?: UnpublishRequest, options?: Exactly<IncludeOptions<Include>, Options>): Promise<StoryRecord>;
53
+ schedule<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: StoryId, payload?: ScheduleRequest, options?: Exactly<IncludeOptions<Include>, Options>): Promise<StoryRecord>;
54
+ unschedule<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: StoryId, payload?: UnscheduleRequest, options?: Exactly<IncludeOptions<Include>, Options>): Promise<StoryRecord>;
55
+ pin<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: StoryId, options?: Exactly<IncludeOptions<Include>, Options> & {
51
56
  force?: boolean;
52
57
  }): Promise<StoryRecord>;
53
- unpin<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: StoryId, options?: Options): Promise<StoryRecord>;
58
+ unpin<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: StoryId, options?: Exactly<IncludeOptions<Include>, Options>): Promise<StoryRecord>;
54
59
  delete(id: StoryId): Promise<void>;
55
60
  }
56
61
  export {};
@@ -1,13 +1,6 @@
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 {
1
+ import { ApiError, HttpCodes } from "../../http/index.js";
2
+ import { routing } from "../../routing.js";
3
+ export class Client {
11
4
  constructor(apiClient) {
12
5
  this.apiClient = apiClient;
13
6
  }
@@ -18,7 +11,7 @@ class Client {
18
11
  sortOrder,
19
12
  include
20
13
  } = options ?? {};
21
- return this.apiClient.get(_routing.routing.storiesUrl, {
14
+ return this.apiClient.get(routing.storiesUrl, {
22
15
  query: {
23
16
  limit,
24
17
  offset,
@@ -35,7 +28,7 @@ class Client {
35
28
  include,
36
29
  query
37
30
  } = options ?? {};
38
- return this.apiClient.post(_routing.routing.storiesSearchUrl, {
31
+ return this.apiClient.post(routing.storiesSearchUrl, {
39
32
  payload: {
40
33
  query,
41
34
  limit,
@@ -90,7 +83,7 @@ class Client {
90
83
  }
91
84
  const {
92
85
  story
93
- } = await this.apiClient.get(`${_routing.routing.storiesUrl}/${arg}`, {
86
+ } = await this.apiClient.get(`${routing.storiesUrl}/${arg}`, {
94
87
  query: {
95
88
  include: include
96
89
  }
@@ -101,7 +94,7 @@ class Client {
101
94
  const include = options?.include;
102
95
  const {
103
96
  story
104
- } = await this.apiClient.post(_routing.routing.storiesUrl, {
97
+ } = await this.apiClient.post(routing.storiesUrl, {
105
98
  payload,
106
99
  query: {
107
100
  include: include
@@ -111,7 +104,7 @@ class Client {
111
104
  }
112
105
  async duplicate(id, options) {
113
106
  const include = options?.include;
114
- const url = `${_routing.routing.storiesUrl}/${id}/duplicate`;
107
+ const url = `${routing.storiesUrl}/${id}/duplicate`;
115
108
  const {
116
109
  story
117
110
  } = await this.apiClient.post(url, {
@@ -123,7 +116,7 @@ class Client {
123
116
  }
124
117
  async translate(id, payload, options) {
125
118
  const include = options?.include;
126
- const url = `${_routing.routing.storiesUrl}/${id}/translate`;
119
+ const url = `${routing.storiesUrl}/${id}/translate`;
127
120
  const {
128
121
  story
129
122
  } = await this.apiClient.post(url, {
@@ -137,7 +130,7 @@ class Client {
137
130
  async move(id, payload, options) {
138
131
  const include = options?.include;
139
132
  const force = options?.force;
140
- const url = `${_routing.routing.storiesUrl}/${id}/move`;
133
+ const url = `${routing.storiesUrl}/${id}/move`;
141
134
  try {
142
135
  const {
143
136
  story
@@ -153,14 +146,14 @@ class Client {
153
146
  story
154
147
  };
155
148
  } catch (error) {
156
- if (error instanceof _ApiError.ApiError && error.status === _index.HttpCodes.CONFLICT) {
149
+ if (error instanceof ApiError && error.status === HttpCodes.CONFLICT) {
157
150
  return error.payload;
158
151
  }
159
152
  throw error;
160
153
  }
161
154
  }
162
155
  async update(id, payload, options) {
163
- const url = `${_routing.routing.storiesUrl}/${id}`;
156
+ const url = `${routing.storiesUrl}/${id}`;
164
157
  const include = options?.include;
165
158
  const {
166
159
  story
@@ -177,7 +170,7 @@ class Client {
177
170
  * This operation is only allowed for V3 stories
178
171
  */
179
172
  async autosave(id, payload, options) {
180
- const url = `${_routing.routing.storiesUrl}/${id}/autosave`;
173
+ const url = `${routing.storiesUrl}/${id}/autosave`;
181
174
  const include = options?.include;
182
175
  const {
183
176
  story
@@ -194,7 +187,7 @@ class Client {
194
187
  * This operation is only allowed for V3 stories
195
188
  */
196
189
  async revert(id, payload, options) {
197
- const url = `${_routing.routing.storiesUrl}/${id}/revert`;
190
+ const url = `${routing.storiesUrl}/${id}/revert`;
198
191
  const include = options?.include;
199
192
  const {
200
193
  story
@@ -207,7 +200,7 @@ class Client {
207
200
  return story;
208
201
  }
209
202
  async publish(id, payload, options) {
210
- const url = `${_routing.routing.storiesUrl}/${id}/publish`;
203
+ const url = `${routing.storiesUrl}/${id}/publish`;
211
204
  const include = options?.include;
212
205
  const {
213
206
  story
@@ -220,7 +213,7 @@ class Client {
220
213
  return story;
221
214
  }
222
215
  async unpublish(id, payload, options) {
223
- const url = `${_routing.routing.storiesUrl}/${id}/unpublish`;
216
+ const url = `${routing.storiesUrl}/${id}/unpublish`;
224
217
  const include = options?.include;
225
218
  const {
226
219
  story
@@ -233,7 +226,7 @@ class Client {
233
226
  return story;
234
227
  }
235
228
  async schedule(id, payload, options) {
236
- const url = `${_routing.routing.storiesUrl}/${id}/schedule`;
229
+ const url = `${routing.storiesUrl}/${id}/schedule`;
237
230
  const include = options?.include;
238
231
  const {
239
232
  story
@@ -246,7 +239,7 @@ class Client {
246
239
  return story;
247
240
  }
248
241
  async unschedule(id, payload, options) {
249
- const url = `${_routing.routing.storiesUrl}/${id}/unpublish`;
242
+ const url = `${routing.storiesUrl}/${id}/unpublish`;
250
243
  const include = options?.include;
251
244
  const {
252
245
  story
@@ -259,7 +252,7 @@ class Client {
259
252
  return story;
260
253
  }
261
254
  async pin(id, options) {
262
- const url = `${_routing.routing.storiesUrl}/${id}/pin`;
255
+ const url = `${routing.storiesUrl}/${id}/pin`;
263
256
  const include = options?.include;
264
257
  const {
265
258
  story
@@ -272,7 +265,7 @@ class Client {
272
265
  return story;
273
266
  }
274
267
  async unpin(id, options) {
275
- const url = `${_routing.routing.storiesUrl}/${id}/unpin`;
268
+ const url = `${routing.storiesUrl}/${id}/unpin`;
276
269
  const include = options?.include;
277
270
  const {
278
271
  story
@@ -284,8 +277,7 @@ class Client {
284
277
  return story;
285
278
  }
286
279
  async delete(id) {
287
- const url = `${_routing.routing.storiesUrl}/${id}`;
280
+ const url = `${routing.storiesUrl}/${id}`;
288
281
  await this.apiClient.delete(url);
289
282
  }
290
- }
291
- exports.Client = Client;
283
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _Client = require("./Client.cjs");
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.cjs");
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.cjs");
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,35 +1,3 @@
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
+ export * from "./Client.js";
2
+ export * from "./types.js";
3
+ export * from "./scopes.js";
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Scope = void 0;
7
+ var _index = require("../../types/index.cjs");
8
+ const Scope = {
9
+ EXCLUDE_ARCHIVED_NEWSROOMS: {
10
+ 'newsroom.status': {
11
+ $nin: [_index.Newsroom.Status.ARCHIVED]
12
+ }
13
+ }
14
+ };
15
+ exports.Scope = Scope;
@@ -1,15 +1,8 @@
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 = {
1
+ import { Newsroom } from "../../types/index.js";
2
+ export const Scope = {
9
3
  EXCLUDE_ARCHIVED_NEWSROOMS: {
10
4
  'newsroom.status': {
11
- $nin: [_index.Newsroom.Status.ARCHIVED]
5
+ $nin: [Newsroom.Status.ARCHIVED]
12
6
  }
13
7
  }
14
- };
15
- exports.Scope = Scope;
8
+ };