@prezly/sdk 11.8.1-cjs → 11.9.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.
- package/dist/Client.cjs +45 -0
- package/dist/Client.js +27 -33
- package/dist/api/ApiClient.cjs +95 -0
- package/dist/api/ApiClient.js +12 -19
- package/dist/api/DeferredJobsApiClient.cjs +99 -0
- package/dist/api/DeferredJobsApiClient.js +12 -19
- package/dist/api/constants.cjs +10 -0
- package/dist/api/constants.js +2 -9
- package/dist/api/index.cjs +19 -0
- package/dist/api/index.js +2 -19
- package/dist/endpoints/Accounts/Client.cjs +29 -0
- package/dist/endpoints/Accounts/Client.js +6 -13
- package/dist/endpoints/Accounts/index.cjs +25 -0
- package/dist/endpoints/Accounts/index.js +2 -25
- package/dist/endpoints/Accounts/types.cjs +1 -0
- package/dist/endpoints/Accounts/types.js +1 -1
- package/dist/endpoints/Billing/Client.cjs +19 -0
- package/dist/endpoints/Billing/Client.js +4 -11
- package/dist/endpoints/Billing/index.cjs +25 -0
- package/dist/endpoints/Billing/index.js +2 -25
- package/dist/endpoints/Billing/types.cjs +25 -0
- package/dist/endpoints/Billing/types.js +6 -15
- package/dist/endpoints/CampaignRecipients/Client.cjs +85 -0
- package/dist/endpoints/CampaignRecipients/Client.js +12 -19
- package/dist/endpoints/CampaignRecipients/index.cjs +37 -0
- package/dist/endpoints/CampaignRecipients/index.js +3 -37
- package/dist/endpoints/CampaignRecipients/types.cjs +1 -0
- package/dist/endpoints/CampaignRecipients/types.js +1 -1
- package/dist/endpoints/Campaigns/Client.cjs +92 -0
- package/dist/endpoints/Campaigns/Client.js +18 -25
- package/dist/endpoints/Campaigns/index.cjs +25 -0
- package/dist/endpoints/Campaigns/index.js +2 -25
- package/dist/endpoints/Campaigns/types.cjs +1 -0
- package/dist/endpoints/Campaigns/types.js +1 -1
- package/dist/endpoints/ContactsExports/Client.cjs +98 -0
- package/dist/endpoints/ContactsExports/Client.js +8 -15
- package/dist/endpoints/ContactsExports/index.cjs +37 -0
- package/dist/endpoints/ContactsExports/index.js +3 -37
- package/dist/endpoints/ContactsExports/types.cjs +1 -0
- package/dist/endpoints/ContactsExports/types.js +1 -1
- package/dist/endpoints/Coverage/Client.cjs +109 -0
- package/dist/endpoints/Coverage/Client.js +12 -19
- package/dist/endpoints/Coverage/index.cjs +25 -0
- package/dist/endpoints/Coverage/index.js +2 -25
- package/dist/endpoints/Coverage/types.cjs +1 -0
- package/dist/endpoints/Coverage/types.js +1 -1
- package/dist/endpoints/Jobs/Client.cjs +19 -0
- package/dist/endpoints/Jobs/Client.js +4 -11
- package/dist/endpoints/Jobs/index.cjs +25 -0
- package/dist/endpoints/Jobs/index.js +2 -25
- package/dist/endpoints/Jobs/types.cjs +1 -0
- package/dist/endpoints/Jobs/types.js +1 -1
- package/dist/endpoints/Licenses/Client.cjs +20 -0
- package/dist/endpoints/Licenses/Client.js +4 -11
- package/dist/endpoints/Licenses/index.cjs +15 -0
- package/dist/endpoints/Licenses/index.js +1 -15
- package/dist/endpoints/NewsroomCategories/Client.cjs +55 -0
- package/dist/endpoints/NewsroomCategories/Client.js +8 -15
- package/dist/endpoints/NewsroomCategories/index.cjs +25 -0
- package/dist/endpoints/NewsroomCategories/index.js +2 -25
- package/dist/endpoints/NewsroomCategories/types.cjs +1 -0
- package/dist/endpoints/NewsroomCategories/types.js +1 -1
- package/dist/endpoints/NewsroomContacts/Client.cjs +76 -0
- package/dist/endpoints/NewsroomContacts/Client.js +11 -18
- package/dist/endpoints/NewsroomContacts/index.cjs +25 -0
- package/dist/endpoints/NewsroomContacts/index.js +2 -25
- package/dist/endpoints/NewsroomContacts/types.cjs +1 -0
- package/dist/endpoints/NewsroomContacts/types.js +1 -1
- package/dist/endpoints/NewsroomDomains/Client.cjs +48 -0
- package/dist/endpoints/NewsroomDomains/Client.js +9 -16
- package/dist/endpoints/NewsroomDomains/index.cjs +25 -0
- package/dist/endpoints/NewsroomDomains/index.js +2 -25
- package/dist/endpoints/NewsroomDomains/types.cjs +1 -0
- package/dist/endpoints/NewsroomDomains/types.js +1 -1
- package/dist/endpoints/NewsroomGalleries/Client.cjs +82 -0
- package/dist/endpoints/NewsroomGalleries/Client.js +13 -20
- package/dist/endpoints/NewsroomGalleries/index.cjs +25 -0
- package/dist/endpoints/NewsroomGalleries/index.js +2 -25
- package/dist/endpoints/NewsroomGalleries/types.cjs +1 -0
- package/dist/endpoints/NewsroomGalleries/types.js +1 -1
- package/dist/endpoints/NewsroomLanguages/Client.cjs +100 -0
- package/dist/endpoints/NewsroomLanguages/Client.js +10 -17
- package/dist/endpoints/NewsroomLanguages/index.cjs +25 -0
- package/dist/endpoints/NewsroomLanguages/index.js +2 -25
- package/dist/endpoints/NewsroomLanguages/lib.cjs +9 -0
- package/dist/endpoints/NewsroomLanguages/lib.js +1 -7
- package/dist/endpoints/NewsroomLanguages/types.cjs +1 -0
- package/dist/endpoints/NewsroomLanguages/types.js +1 -1
- package/dist/endpoints/NewsroomPrivacyRequests/Client.cjs +29 -0
- package/dist/endpoints/NewsroomPrivacyRequests/Client.js +5 -12
- package/dist/endpoints/NewsroomPrivacyRequests/index.cjs +25 -0
- package/dist/endpoints/NewsroomPrivacyRequests/index.js +2 -25
- package/dist/endpoints/NewsroomPrivacyRequests/types.cjs +1 -0
- package/dist/endpoints/NewsroomPrivacyRequests/types.js +1 -1
- package/dist/endpoints/NewsroomSubscriptions/Client.cjs +22 -0
- package/dist/endpoints/NewsroomSubscriptions/Client.js +4 -11
- package/dist/endpoints/NewsroomSubscriptions/index.cjs +25 -0
- package/dist/endpoints/NewsroomSubscriptions/index.js +2 -25
- package/dist/endpoints/NewsroomSubscriptions/types.cjs +1 -0
- package/dist/endpoints/NewsroomSubscriptions/types.js +1 -1
- package/dist/endpoints/NewsroomThemes/Client.cjs +43 -0
- package/dist/endpoints/NewsroomThemes/Client.js +7 -14
- package/dist/endpoints/NewsroomThemes/index.cjs +15 -0
- package/dist/endpoints/NewsroomThemes/index.js +1 -15
- package/dist/endpoints/NewsroomWebhooks/Client.cjs +49 -0
- package/dist/endpoints/NewsroomWebhooks/Client.js +8 -15
- package/dist/endpoints/NewsroomWebhooks/index.cjs +25 -0
- package/dist/endpoints/NewsroomWebhooks/index.js +2 -25
- package/dist/endpoints/NewsroomWebhooks/types.cjs +1 -0
- package/dist/endpoints/NewsroomWebhooks/types.js +1 -1
- package/dist/endpoints/Newsrooms/Client.cjs +97 -0
- package/dist/endpoints/Newsrooms/Client.js +15 -22
- package/dist/endpoints/Newsrooms/index.cjs +25 -0
- package/dist/endpoints/Newsrooms/index.js +2 -25
- package/dist/endpoints/Newsrooms/types.cjs +1 -0
- package/dist/endpoints/Newsrooms/types.js +1 -1
- package/dist/endpoints/NotificationSubscriptions/Client.cjs +29 -0
- package/dist/endpoints/NotificationSubscriptions/Client.js +5 -12
- package/dist/endpoints/NotificationSubscriptions/index.cjs +25 -0
- package/dist/endpoints/NotificationSubscriptions/index.js +2 -25
- package/dist/endpoints/NotificationSubscriptions/types.cjs +1 -0
- package/dist/endpoints/NotificationSubscriptions/types.js +1 -1
- package/dist/endpoints/SenderAddresses/Client.cjs +44 -0
- package/dist/endpoints/SenderAddresses/Client.js +8 -15
- package/dist/endpoints/SenderAddresses/index.cjs +25 -0
- package/dist/endpoints/SenderAddresses/index.js +2 -25
- package/dist/endpoints/SenderAddresses/types.cjs +1 -0
- package/dist/endpoints/SenderAddresses/types.js +1 -1
- package/dist/endpoints/Signup/Client.cjs +21 -0
- package/dist/endpoints/Signup/Client.js +4 -11
- package/dist/endpoints/Signup/index.cjs +25 -0
- package/dist/endpoints/Signup/index.js +2 -25
- package/dist/endpoints/Signup/types.cjs +12 -0
- package/dist/endpoints/Signup/types.js +2 -9
- package/dist/endpoints/Snippets/Client.cjs +49 -0
- package/dist/endpoints/Snippets/Client.js +8 -15
- package/dist/endpoints/Snippets/index.cjs +25 -0
- package/dist/endpoints/Snippets/index.js +2 -25
- package/dist/endpoints/Snippets/types.cjs +1 -0
- package/dist/endpoints/Snippets/types.js +1 -1
- package/dist/endpoints/Stories/Client.cjs +291 -0
- package/dist/endpoints/Stories/Client.js +23 -30
- package/dist/endpoints/Stories/index.cjs +35 -0
- package/dist/endpoints/Stories/index.js +3 -35
- package/dist/endpoints/Stories/scopes.cjs +15 -0
- package/dist/endpoints/Stories/scopes.js +4 -11
- package/dist/endpoints/Stories/types.cjs +51 -0
- package/dist/endpoints/Stories/types.js +2 -10
- package/dist/endpoints/Subscriptions/Client.cjs +58 -0
- package/dist/endpoints/Subscriptions/Client.js +8 -15
- package/dist/endpoints/Subscriptions/index.cjs +25 -0
- package/dist/endpoints/Subscriptions/index.js +2 -25
- package/dist/endpoints/Subscriptions/types.cjs +15 -0
- package/dist/endpoints/Subscriptions/types.js +2 -9
- package/dist/endpoints/index.cjs +56 -0
- package/dist/endpoints/index.js +24 -56
- package/dist/http/ApiError.cjs +21 -0
- package/dist/http/ApiError.js +2 -9
- package/dist/http/Http.cjs +69 -0
- package/dist/http/Http.js +14 -21
- package/dist/http/constants.cjs +12 -0
- package/dist/http/constants.js +3 -12
- package/dist/http/createRequest.cjs +106 -0
- package/dist/http/createRequest.js +13 -20
- package/dist/http/index.cjs +39 -0
- package/dist/http/index.js +4 -39
- package/dist/http/lib.cjs +39 -0
- package/dist/http/lib.js +6 -16
- package/dist/http/types.cjs +25 -0
- package/dist/http/types.js +4 -12
- package/dist/index.cjs +56 -0
- package/dist/index.js +5 -56
- package/dist/routing.cjs +38 -0
- package/dist/routing.js +2 -9
- package/dist/types/Campaign.cjs +69 -0
- package/dist/types/Campaign.js +4 -11
- package/dist/types/Category.cjs +1 -0
- package/dist/types/Category.js +1 -1
- package/dist/types/Contact.cjs +82 -0
- package/dist/types/Contact.js +2 -9
- package/dist/types/ContactDuplicateSuggestion.cjs +17 -0
- package/dist/types/ContactDuplicateSuggestion.js +2 -9
- package/dist/types/ContactsExport.cjs +17 -0
- package/dist/types/ContactsExport.js +2 -9
- package/dist/types/ContactsScope.cjs +19 -0
- package/dist/types/ContactsScope.js +2 -9
- package/dist/types/Country.cjs +1 -0
- package/dist/types/Country.js +1 -1
- package/dist/types/CoverageEntry.cjs +32 -0
- package/dist/types/CoverageEntry.js +2 -9
- package/dist/types/Culture.cjs +16 -0
- package/dist/types/Culture.js +2 -9
- package/dist/types/Currency.cjs +13 -0
- package/dist/types/Currency.js +2 -9
- package/dist/types/DnsConfigurationInstruction.cjs +1 -0
- package/dist/types/DnsConfigurationInstruction.js +1 -1
- package/dist/types/EmailRecipient.cjs +18 -0
- package/dist/types/EmailRecipient.js +2 -9
- package/dist/types/EmailSubscription.cjs +1 -0
- package/dist/types/EmailSubscription.js +1 -1
- package/dist/types/JobState.cjs +13 -0
- package/dist/types/JobState.js +2 -9
- package/dist/types/License.cjs +31 -0
- package/dist/types/License.js +2 -9
- package/dist/types/Newsroom.cjs +30 -0
- package/dist/types/Newsroom.js +2 -9
- package/dist/types/NewsroomCompanyInformation.cjs +1 -0
- package/dist/types/NewsroomCompanyInformation.js +1 -1
- package/dist/types/NewsroomContact.cjs +1 -0
- package/dist/types/NewsroomContact.js +1 -1
- package/dist/types/NewsroomDomain.cjs +24 -0
- package/dist/types/NewsroomDomain.js +2 -9
- package/dist/types/NewsroomGallery.cjs +16 -0
- package/dist/types/NewsroomGallery.js +2 -9
- package/dist/types/NewsroomLanguageSettings.cjs +1 -0
- package/dist/types/NewsroomLanguageSettings.js +1 -1
- package/dist/types/NewsroomTheme.cjs +38 -0
- package/dist/types/NewsroomTheme.js +4 -12
- package/dist/types/NewsroomWebhook.cjs +20 -0
- package/dist/types/NewsroomWebhook.js +2 -9
- package/dist/types/NotificationSubscription.cjs +17 -0
- package/dist/types/NotificationSubscription.js +2 -9
- package/dist/types/Permissions.cjs +18 -0
- package/dist/types/Permissions.js +2 -9
- package/dist/types/Plan.cjs +18 -0
- package/dist/types/Plan.js +2 -9
- package/dist/types/PrivacyRequest.cjs +24 -0
- package/dist/types/PrivacyRequest.js +2 -9
- package/dist/types/SEOSettings.cjs +1 -0
- package/dist/types/SEOSettings.js +1 -1
- package/dist/types/SenderAddress.cjs +16 -0
- package/dist/types/SenderAddress.js +2 -9
- package/dist/types/SenderDomain.cjs +18 -0
- package/dist/types/SenderDomain.js +2 -9
- package/dist/types/Snippet.cjs +1 -0
- package/dist/types/Snippet.js +1 -1
- package/dist/types/Story.cjs +89 -0
- package/dist/types/Story.js +2 -9
- package/dist/types/User.cjs +28 -0
- package/dist/types/User.js +2 -9
- package/dist/types/UserAccount.cjs +1 -0
- package/dist/types/UserAccount.js +1 -1
- package/dist/types/common/Notification.cjs +18 -0
- package/dist/types/common/Notification.js +2 -9
- package/dist/types/common/OEmbedInfo.cjs +18 -0
- package/dist/types/common/OEmbedInfo.js +2 -9
- package/dist/types/common/Pagination.cjs +15 -0
- package/dist/types/common/Pagination.js +4 -9
- package/dist/types/common/Query.cjs +21 -0
- package/dist/types/common/Query.js +3 -9
- package/dist/types/common/Utm.cjs +1 -0
- package/dist/types/common/Utm.js +1 -1
- package/dist/types/common/Warning.cjs +1 -0
- package/dist/types/common/Warning.js +1 -1
- package/dist/types/common/index.cjs +65 -0
- package/dist/types/common/index.js +6 -65
- package/dist/types/index.cjs +325 -0
- package/dist/types/index.js +33 -325
- package/dist/utils.cjs +30 -0
- package/dist/utils.js +2 -9
- package/package.json +16 -6
|
@@ -1,15 +1 @@
|
|
|
1
|
-
|
|
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
|
-
});
|
|
1
|
+
export * from "./Client.js";
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Client = void 0;
|
|
7
|
+
var _routing = require("../../routing.cjs");
|
|
8
|
+
class Client {
|
|
9
|
+
constructor(apiClient) {
|
|
10
|
+
this.apiClient = apiClient;
|
|
11
|
+
}
|
|
12
|
+
async list(newsroomId, {
|
|
13
|
+
sortOrder
|
|
14
|
+
} = {}) {
|
|
15
|
+
const url = _routing.routing.newsroomCategoriesUrl.replace(':newsroom_id', String(newsroomId));
|
|
16
|
+
const {
|
|
17
|
+
categories
|
|
18
|
+
} = await this.apiClient.get(url, {
|
|
19
|
+
query: {
|
|
20
|
+
sort: sortOrder
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
return categories;
|
|
24
|
+
}
|
|
25
|
+
async get(newsroomId, categoryId) {
|
|
26
|
+
const url = _routing.routing.newsroomCategoriesUrl.replace(':newsroom_id', String(newsroomId));
|
|
27
|
+
const {
|
|
28
|
+
category
|
|
29
|
+
} = await this.apiClient.get(`${url}/${categoryId}`);
|
|
30
|
+
return category;
|
|
31
|
+
}
|
|
32
|
+
async create(newsroomId, payload) {
|
|
33
|
+
const url = _routing.routing.newsroomCategoriesUrl.replace(':newsroom_id', String(newsroomId));
|
|
34
|
+
const {
|
|
35
|
+
category
|
|
36
|
+
} = await this.apiClient.post(url, {
|
|
37
|
+
payload
|
|
38
|
+
});
|
|
39
|
+
return category;
|
|
40
|
+
}
|
|
41
|
+
async update(newsroomId, categoryId, payload) {
|
|
42
|
+
const url = _routing.routing.newsroomCategoriesUrl.replace(':newsroom_id', String(newsroomId));
|
|
43
|
+
const {
|
|
44
|
+
category
|
|
45
|
+
} = await this.apiClient.patch(`${url}/${categoryId}`, {
|
|
46
|
+
payload
|
|
47
|
+
});
|
|
48
|
+
return category;
|
|
49
|
+
}
|
|
50
|
+
async remove(newsroomId, categoryId) {
|
|
51
|
+
const url = _routing.routing.newsroomCategoriesUrl.replace(':newsroom_id', String(newsroomId));
|
|
52
|
+
return this.apiClient.delete(`${url}/${categoryId}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.Client = Client;
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Client = void 0;
|
|
7
|
-
var _routing = require("../../routing.js");
|
|
8
|
-
class Client {
|
|
1
|
+
import { routing } from "../../routing.js";
|
|
2
|
+
export class Client {
|
|
9
3
|
constructor(apiClient) {
|
|
10
4
|
this.apiClient = apiClient;
|
|
11
5
|
}
|
|
12
6
|
async list(newsroomId, {
|
|
13
7
|
sortOrder
|
|
14
8
|
} = {}) {
|
|
15
|
-
const url =
|
|
9
|
+
const url = routing.newsroomCategoriesUrl.replace(':newsroom_id', String(newsroomId));
|
|
16
10
|
const {
|
|
17
11
|
categories
|
|
18
12
|
} = await this.apiClient.get(url, {
|
|
@@ -23,14 +17,14 @@ class Client {
|
|
|
23
17
|
return categories;
|
|
24
18
|
}
|
|
25
19
|
async get(newsroomId, categoryId) {
|
|
26
|
-
const url =
|
|
20
|
+
const url = routing.newsroomCategoriesUrl.replace(':newsroom_id', String(newsroomId));
|
|
27
21
|
const {
|
|
28
22
|
category
|
|
29
23
|
} = await this.apiClient.get(`${url}/${categoryId}`);
|
|
30
24
|
return category;
|
|
31
25
|
}
|
|
32
26
|
async create(newsroomId, payload) {
|
|
33
|
-
const url =
|
|
27
|
+
const url = routing.newsroomCategoriesUrl.replace(':newsroom_id', String(newsroomId));
|
|
34
28
|
const {
|
|
35
29
|
category
|
|
36
30
|
} = await this.apiClient.post(url, {
|
|
@@ -39,7 +33,7 @@ class Client {
|
|
|
39
33
|
return category;
|
|
40
34
|
}
|
|
41
35
|
async update(newsroomId, categoryId, payload) {
|
|
42
|
-
const url =
|
|
36
|
+
const url = routing.newsroomCategoriesUrl.replace(':newsroom_id', String(newsroomId));
|
|
43
37
|
const {
|
|
44
38
|
category
|
|
45
39
|
} = await this.apiClient.patch(`${url}/${categoryId}`, {
|
|
@@ -48,8 +42,7 @@ class Client {
|
|
|
48
42
|
return category;
|
|
49
43
|
}
|
|
50
44
|
async remove(newsroomId, categoryId) {
|
|
51
|
-
const url =
|
|
45
|
+
const url = routing.newsroomCategoriesUrl.replace(':newsroom_id', String(newsroomId));
|
|
52
46
|
return this.apiClient.delete(`${url}/${categoryId}`);
|
|
53
47
|
}
|
|
54
|
-
}
|
|
55
|
-
exports.Client = Client;
|
|
48
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
});
|
|
@@ -1,25 +1,2 @@
|
|
|
1
|
-
|
|
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
|
+
export * from "./Client.js";
|
|
2
|
+
export * from "./types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Client = void 0;
|
|
7
|
+
var _routing = require("../../routing.cjs");
|
|
8
|
+
var _index = require("../../types/index.cjs");
|
|
9
|
+
class Client {
|
|
10
|
+
constructor(apiClient) {
|
|
11
|
+
this.apiClient = apiClient;
|
|
12
|
+
}
|
|
13
|
+
async list(newsroomId, {
|
|
14
|
+
search
|
|
15
|
+
} = {}) {
|
|
16
|
+
const url = _routing.routing.newsroomContactsUrl.replace(':newsroom_id', String(newsroomId));
|
|
17
|
+
const {
|
|
18
|
+
contacts
|
|
19
|
+
} = await this.apiClient.get(url, {
|
|
20
|
+
query: {
|
|
21
|
+
search
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
return contacts;
|
|
25
|
+
}
|
|
26
|
+
async get(newsroomId, contactId) {
|
|
27
|
+
const url = _routing.routing.newsroomContactsUrl.replace(':newsroom_id', String(newsroomId));
|
|
28
|
+
const {
|
|
29
|
+
contact
|
|
30
|
+
} = await this.apiClient.get(`${url}/${contactId}`);
|
|
31
|
+
return contact;
|
|
32
|
+
}
|
|
33
|
+
async search(newsroomId, {
|
|
34
|
+
search,
|
|
35
|
+
query
|
|
36
|
+
} = {}) {
|
|
37
|
+
const url = _routing.routing.newsroomContactsUrl.replace(':newsroom_id', String(newsroomId));
|
|
38
|
+
const {
|
|
39
|
+
contacts
|
|
40
|
+
} = await this.apiClient.get(url, {
|
|
41
|
+
query: {
|
|
42
|
+
search,
|
|
43
|
+
query: _index.Query.stringify(query)
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
return contacts;
|
|
47
|
+
}
|
|
48
|
+
async create(newsroomId, payload) {
|
|
49
|
+
const url = _routing.routing.newsroomContactsUrl.replace(':newsroom_id', String(newsroomId));
|
|
50
|
+
const {
|
|
51
|
+
contact
|
|
52
|
+
} = await this.apiClient.post(url, {
|
|
53
|
+
payload
|
|
54
|
+
});
|
|
55
|
+
return contact;
|
|
56
|
+
}
|
|
57
|
+
async update(newsroomId, contactId, payload) {
|
|
58
|
+
const url = _routing.routing.newsroomContactsUrl.replace(':newsroom_id', String(newsroomId));
|
|
59
|
+
const {
|
|
60
|
+
contact
|
|
61
|
+
} = await this.apiClient.patch(`${url}/${contactId}`, {
|
|
62
|
+
payload
|
|
63
|
+
});
|
|
64
|
+
return contact;
|
|
65
|
+
}
|
|
66
|
+
async remove(newsroomId, contactId, force = false) {
|
|
67
|
+
const url = _routing.routing.newsroomContactsUrl.replace(':newsroom_id', String(newsroomId));
|
|
68
|
+
const query = force ? {
|
|
69
|
+
force: true
|
|
70
|
+
} : {};
|
|
71
|
+
return this.apiClient.delete(`${url}/${contactId}`, {
|
|
72
|
+
query
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.Client = Client;
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Client = void 0;
|
|
7
|
-
var _routing = require("../../routing.js");
|
|
8
|
-
var _index = require("../../types/index.js");
|
|
9
|
-
class Client {
|
|
1
|
+
import { routing } from "../../routing.js";
|
|
2
|
+
import { Query } from "../../types/index.js";
|
|
3
|
+
export class Client {
|
|
10
4
|
constructor(apiClient) {
|
|
11
5
|
this.apiClient = apiClient;
|
|
12
6
|
}
|
|
13
7
|
async list(newsroomId, {
|
|
14
8
|
search
|
|
15
9
|
} = {}) {
|
|
16
|
-
const url =
|
|
10
|
+
const url = routing.newsroomContactsUrl.replace(':newsroom_id', String(newsroomId));
|
|
17
11
|
const {
|
|
18
12
|
contacts
|
|
19
13
|
} = await this.apiClient.get(url, {
|
|
@@ -24,7 +18,7 @@ class Client {
|
|
|
24
18
|
return contacts;
|
|
25
19
|
}
|
|
26
20
|
async get(newsroomId, contactId) {
|
|
27
|
-
const url =
|
|
21
|
+
const url = routing.newsroomContactsUrl.replace(':newsroom_id', String(newsroomId));
|
|
28
22
|
const {
|
|
29
23
|
contact
|
|
30
24
|
} = await this.apiClient.get(`${url}/${contactId}`);
|
|
@@ -34,19 +28,19 @@ class Client {
|
|
|
34
28
|
search,
|
|
35
29
|
query
|
|
36
30
|
} = {}) {
|
|
37
|
-
const url =
|
|
31
|
+
const url = routing.newsroomContactsUrl.replace(':newsroom_id', String(newsroomId));
|
|
38
32
|
const {
|
|
39
33
|
contacts
|
|
40
34
|
} = await this.apiClient.get(url, {
|
|
41
35
|
query: {
|
|
42
36
|
search,
|
|
43
|
-
query:
|
|
37
|
+
query: Query.stringify(query)
|
|
44
38
|
}
|
|
45
39
|
});
|
|
46
40
|
return contacts;
|
|
47
41
|
}
|
|
48
42
|
async create(newsroomId, payload) {
|
|
49
|
-
const url =
|
|
43
|
+
const url = routing.newsroomContactsUrl.replace(':newsroom_id', String(newsroomId));
|
|
50
44
|
const {
|
|
51
45
|
contact
|
|
52
46
|
} = await this.apiClient.post(url, {
|
|
@@ -55,7 +49,7 @@ class Client {
|
|
|
55
49
|
return contact;
|
|
56
50
|
}
|
|
57
51
|
async update(newsroomId, contactId, payload) {
|
|
58
|
-
const url =
|
|
52
|
+
const url = routing.newsroomContactsUrl.replace(':newsroom_id', String(newsroomId));
|
|
59
53
|
const {
|
|
60
54
|
contact
|
|
61
55
|
} = await this.apiClient.patch(`${url}/${contactId}`, {
|
|
@@ -64,7 +58,7 @@ class Client {
|
|
|
64
58
|
return contact;
|
|
65
59
|
}
|
|
66
60
|
async remove(newsroomId, contactId, force = false) {
|
|
67
|
-
const url =
|
|
61
|
+
const url = routing.newsroomContactsUrl.replace(':newsroom_id', String(newsroomId));
|
|
68
62
|
const query = force ? {
|
|
69
63
|
force: true
|
|
70
64
|
} : {};
|
|
@@ -72,5 +66,4 @@ class Client {
|
|
|
72
66
|
query
|
|
73
67
|
});
|
|
74
68
|
}
|
|
75
|
-
}
|
|
76
|
-
exports.Client = Client;
|
|
69
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
});
|
|
@@ -1,25 +1,2 @@
|
|
|
1
|
-
|
|
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
|
+
export * from "./Client.js";
|
|
2
|
+
export * from "./types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Client = void 0;
|
|
7
|
+
var _routing = require("../../routing.cjs");
|
|
8
|
+
class Client {
|
|
9
|
+
constructor(apiClient) {
|
|
10
|
+
this.apiClient = apiClient;
|
|
11
|
+
}
|
|
12
|
+
async get(newsroomId, domain) {
|
|
13
|
+
const url = _routing.routing.newsroomDomainsUrl.replace(':newsroom_id', String(newsroomId));
|
|
14
|
+
const response = await this.apiClient.get(`${url}/${domain}`);
|
|
15
|
+
return response.domain;
|
|
16
|
+
}
|
|
17
|
+
async list(newsroomId) {
|
|
18
|
+
const url = _routing.routing.newsroomDomainsUrl.replace(':newsroom_id', String(newsroomId));
|
|
19
|
+
const {
|
|
20
|
+
domains
|
|
21
|
+
} = await this.apiClient.get(url);
|
|
22
|
+
return domains;
|
|
23
|
+
}
|
|
24
|
+
async link(newsroomId, payload) {
|
|
25
|
+
const url = _routing.routing.newsroomDomainsUrl.replace(':newsroom_id', String(newsroomId));
|
|
26
|
+
const {
|
|
27
|
+
domain
|
|
28
|
+
} = await this.apiClient.post(url, {
|
|
29
|
+
payload
|
|
30
|
+
});
|
|
31
|
+
return domain;
|
|
32
|
+
}
|
|
33
|
+
async unlink(newsroomId, domain) {
|
|
34
|
+
const url = _routing.routing.newsroomDomainsUrl.replace(':newsroom_id', String(newsroomId));
|
|
35
|
+
return this.apiClient.delete(`${url}/${domain}`);
|
|
36
|
+
}
|
|
37
|
+
async check(newsroomId, domain) {
|
|
38
|
+
const url = _routing.routing.newsroomDomainsUrl.replace(':newsroom_id', String(newsroomId));
|
|
39
|
+
const response = await this.apiClient.post(`${url}/${domain}/check`);
|
|
40
|
+
return response.domain;
|
|
41
|
+
}
|
|
42
|
+
async shareDnsInstructions(newsroomId, domain) {
|
|
43
|
+
const url = _routing.routing.newsroomDomainsUrl.replace(':newsroom_id', String(newsroomId));
|
|
44
|
+
const response = await this.apiClient.post(`${url}/${domain}/share`);
|
|
45
|
+
return response.sharable_dns_instructions;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.Client = Client;
|
|
@@ -1,28 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Client = void 0;
|
|
7
|
-
var _routing = require("../../routing.js");
|
|
8
|
-
class Client {
|
|
1
|
+
import { routing } from "../../routing.js";
|
|
2
|
+
export class Client {
|
|
9
3
|
constructor(apiClient) {
|
|
10
4
|
this.apiClient = apiClient;
|
|
11
5
|
}
|
|
12
6
|
async get(newsroomId, domain) {
|
|
13
|
-
const url =
|
|
7
|
+
const url = routing.newsroomDomainsUrl.replace(':newsroom_id', String(newsroomId));
|
|
14
8
|
const response = await this.apiClient.get(`${url}/${domain}`);
|
|
15
9
|
return response.domain;
|
|
16
10
|
}
|
|
17
11
|
async list(newsroomId) {
|
|
18
|
-
const url =
|
|
12
|
+
const url = routing.newsroomDomainsUrl.replace(':newsroom_id', String(newsroomId));
|
|
19
13
|
const {
|
|
20
14
|
domains
|
|
21
15
|
} = await this.apiClient.get(url);
|
|
22
16
|
return domains;
|
|
23
17
|
}
|
|
24
18
|
async link(newsroomId, payload) {
|
|
25
|
-
const url =
|
|
19
|
+
const url = routing.newsroomDomainsUrl.replace(':newsroom_id', String(newsroomId));
|
|
26
20
|
const {
|
|
27
21
|
domain
|
|
28
22
|
} = await this.apiClient.post(url, {
|
|
@@ -31,18 +25,17 @@ class Client {
|
|
|
31
25
|
return domain;
|
|
32
26
|
}
|
|
33
27
|
async unlink(newsroomId, domain) {
|
|
34
|
-
const url =
|
|
28
|
+
const url = routing.newsroomDomainsUrl.replace(':newsroom_id', String(newsroomId));
|
|
35
29
|
return this.apiClient.delete(`${url}/${domain}`);
|
|
36
30
|
}
|
|
37
31
|
async check(newsroomId, domain) {
|
|
38
|
-
const url =
|
|
32
|
+
const url = routing.newsroomDomainsUrl.replace(':newsroom_id', String(newsroomId));
|
|
39
33
|
const response = await this.apiClient.post(`${url}/${domain}/check`);
|
|
40
34
|
return response.domain;
|
|
41
35
|
}
|
|
42
36
|
async shareDnsInstructions(newsroomId, domain) {
|
|
43
|
-
const url =
|
|
37
|
+
const url = routing.newsroomDomainsUrl.replace(':newsroom_id', String(newsroomId));
|
|
44
38
|
const response = await this.apiClient.post(`${url}/${domain}/share`);
|
|
45
39
|
return response.sharable_dns_instructions;
|
|
46
40
|
}
|
|
47
|
-
}
|
|
48
|
-
exports.Client = Client;
|
|
41
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
});
|
|
@@ -1,25 +1,2 @@
|
|
|
1
|
-
|
|
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
|
+
export * from "./Client.js";
|
|
2
|
+
export * from "./types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Client = void 0;
|
|
7
|
+
var _routing = require("../../routing.cjs");
|
|
8
|
+
var _index = require("../../types/index.cjs");
|
|
9
|
+
class Client {
|
|
10
|
+
constructor(apiClient) {
|
|
11
|
+
this.apiClient = apiClient;
|
|
12
|
+
}
|
|
13
|
+
async get(newsroomId, id) {
|
|
14
|
+
const url = _routing.routing.newsroomGalleriesUrl.replace(':newsroom_id', String(newsroomId));
|
|
15
|
+
const response = await this.apiClient.get(`${url}/${id}`);
|
|
16
|
+
return response.gallery;
|
|
17
|
+
}
|
|
18
|
+
async list(newsroomId, options = {}) {
|
|
19
|
+
const {
|
|
20
|
+
sortOrder,
|
|
21
|
+
limit,
|
|
22
|
+
offset
|
|
23
|
+
} = options;
|
|
24
|
+
const url = _routing.routing.newsroomGalleriesUrl.replace(':newsroom_id', String(newsroomId));
|
|
25
|
+
return this.apiClient.get(url, {
|
|
26
|
+
query: {
|
|
27
|
+
sort: sortOrder,
|
|
28
|
+
limit: limit,
|
|
29
|
+
offset: offset
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
async search(newsroomId, options = {}) {
|
|
34
|
+
const {
|
|
35
|
+
scope,
|
|
36
|
+
query,
|
|
37
|
+
sortOrder,
|
|
38
|
+
limit,
|
|
39
|
+
offset
|
|
40
|
+
} = options;
|
|
41
|
+
// TODO: Introduce dedicated Search POST API
|
|
42
|
+
const url = _routing.routing.newsroomGalleriesUrl.replace(':newsroom_id', String(newsroomId));
|
|
43
|
+
return this.apiClient.get(url, {
|
|
44
|
+
query: {
|
|
45
|
+
scope: _index.Query.stringify(scope),
|
|
46
|
+
query: _index.Query.stringify(query),
|
|
47
|
+
sort: sortOrder,
|
|
48
|
+
limit: limit,
|
|
49
|
+
offset: offset
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
async order(newsroomId, payload) {
|
|
54
|
+
const url = _routing.routing.newsroomGalleriesUrl.replace(':newsroom_id', String(newsroomId));
|
|
55
|
+
this.apiClient.post(`${url}/order`, {
|
|
56
|
+
payload
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
async create(newsroomId, payload) {
|
|
60
|
+
const url = _routing.routing.newsroomGalleriesUrl.replace(':newsroom_id', String(newsroomId));
|
|
61
|
+
const {
|
|
62
|
+
gallery
|
|
63
|
+
} = await this.apiClient.post(url, {
|
|
64
|
+
payload
|
|
65
|
+
});
|
|
66
|
+
return gallery;
|
|
67
|
+
}
|
|
68
|
+
async update(newsroomId, galleryId, payload) {
|
|
69
|
+
const url = _routing.routing.newsroomGalleriesUrl.replace(':newsroom_id', String(newsroomId));
|
|
70
|
+
const {
|
|
71
|
+
gallery
|
|
72
|
+
} = await this.apiClient.patch(`${url}/${galleryId}`, {
|
|
73
|
+
payload
|
|
74
|
+
});
|
|
75
|
+
return gallery;
|
|
76
|
+
}
|
|
77
|
+
async remove(newsroomId, galleryId) {
|
|
78
|
+
const url = _routing.routing.newsroomGalleriesUrl.replace(':newsroom_id', String(newsroomId));
|
|
79
|
+
return this.apiClient.delete(`${url}/${galleryId}`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.Client = Client;
|