@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.
- package/dist/Client.js +33 -27
- package/dist/api/ApiClient.js +19 -12
- package/dist/api/DeferredJobsApiClient.js +19 -12
- package/dist/api/constants.js +9 -2
- package/dist/api/index.js +19 -2
- package/dist/endpoints/Accounts/Client.js +13 -6
- package/dist/endpoints/Accounts/index.js +25 -2
- package/dist/endpoints/Accounts/types.js +1 -1
- package/dist/endpoints/Billing/Client.js +11 -4
- package/dist/endpoints/Billing/index.js +25 -2
- package/dist/endpoints/Billing/types.js +15 -6
- package/dist/endpoints/CampaignRecipients/Client.js +19 -12
- package/dist/endpoints/CampaignRecipients/index.js +37 -3
- package/dist/endpoints/CampaignRecipients/types.js +1 -1
- package/dist/endpoints/Campaigns/Client.js +25 -18
- package/dist/endpoints/Campaigns/index.js +25 -2
- package/dist/endpoints/Campaigns/types.js +1 -1
- package/dist/endpoints/ContactsExports/Client.js +15 -8
- package/dist/endpoints/ContactsExports/index.js +37 -3
- package/dist/endpoints/ContactsExports/types.js +1 -1
- package/dist/endpoints/Coverage/Client.js +19 -12
- package/dist/endpoints/Coverage/index.js +25 -2
- package/dist/endpoints/Coverage/types.js +1 -1
- package/dist/endpoints/Jobs/Client.js +11 -4
- package/dist/endpoints/Jobs/index.js +25 -2
- package/dist/endpoints/Jobs/types.js +1 -1
- package/dist/endpoints/Licenses/Client.js +11 -4
- package/dist/endpoints/Licenses/index.js +15 -1
- package/dist/endpoints/NewsroomCategories/Client.js +15 -8
- package/dist/endpoints/NewsroomCategories/index.js +25 -2
- package/dist/endpoints/NewsroomCategories/types.js +1 -1
- package/dist/endpoints/NewsroomContacts/Client.js +18 -11
- package/dist/endpoints/NewsroomContacts/index.js +25 -2
- package/dist/endpoints/NewsroomContacts/types.js +1 -1
- package/dist/endpoints/NewsroomDomains/Client.js +16 -9
- package/dist/endpoints/NewsroomDomains/index.js +25 -2
- package/dist/endpoints/NewsroomDomains/types.js +1 -1
- package/dist/endpoints/NewsroomGalleries/Client.js +20 -13
- package/dist/endpoints/NewsroomGalleries/index.js +25 -2
- package/dist/endpoints/NewsroomGalleries/types.js +1 -1
- package/dist/endpoints/NewsroomLanguages/Client.js +17 -10
- package/dist/endpoints/NewsroomLanguages/index.js +25 -2
- package/dist/endpoints/NewsroomLanguages/lib.js +7 -1
- package/dist/endpoints/NewsroomLanguages/types.js +1 -1
- package/dist/endpoints/NewsroomPrivacyRequests/Client.js +12 -5
- package/dist/endpoints/NewsroomPrivacyRequests/index.js +25 -2
- package/dist/endpoints/NewsroomPrivacyRequests/types.js +1 -1
- package/dist/endpoints/NewsroomSubscriptions/Client.js +11 -4
- package/dist/endpoints/NewsroomSubscriptions/index.js +25 -2
- package/dist/endpoints/NewsroomSubscriptions/types.js +1 -1
- package/dist/endpoints/NewsroomThemes/Client.js +14 -7
- package/dist/endpoints/NewsroomThemes/index.js +15 -1
- package/dist/endpoints/NewsroomWebhooks/Client.js +15 -8
- package/dist/endpoints/NewsroomWebhooks/index.js +25 -2
- package/dist/endpoints/NewsroomWebhooks/types.js +1 -1
- package/dist/endpoints/Newsrooms/Client.js +22 -15
- package/dist/endpoints/Newsrooms/index.js +25 -2
- package/dist/endpoints/Newsrooms/types.js +1 -1
- package/dist/endpoints/NotificationSubscriptions/Client.js +12 -5
- package/dist/endpoints/NotificationSubscriptions/index.js +25 -2
- package/dist/endpoints/NotificationSubscriptions/types.js +1 -1
- package/dist/endpoints/SenderAddresses/Client.js +15 -8
- package/dist/endpoints/SenderAddresses/index.js +25 -2
- package/dist/endpoints/SenderAddresses/types.js +1 -1
- package/dist/endpoints/Signup/Client.js +11 -4
- package/dist/endpoints/Signup/index.js +25 -2
- package/dist/endpoints/Signup/types.js +9 -2
- package/dist/endpoints/Snippets/Client.js +15 -8
- package/dist/endpoints/Snippets/index.js +25 -2
- package/dist/endpoints/Snippets/types.js +1 -1
- package/dist/endpoints/Stories/Client.js +30 -23
- package/dist/endpoints/Stories/index.js +35 -3
- package/dist/endpoints/Stories/scopes.js +11 -4
- package/dist/endpoints/Stories/types.js +10 -2
- package/dist/endpoints/Subscriptions/Client.js +15 -8
- package/dist/endpoints/Subscriptions/index.js +25 -2
- package/dist/endpoints/Subscriptions/types.js +9 -2
- package/dist/endpoints/index.js +56 -24
- package/dist/http/ApiError.js +9 -2
- package/dist/http/Http.js +21 -14
- package/dist/http/constants.js +12 -3
- package/dist/http/createRequest.js +20 -13
- package/dist/http/index.js +39 -4
- package/dist/http/lib.js +16 -6
- package/dist/http/types.js +12 -4
- package/dist/index.js +56 -5
- package/dist/routing.js +9 -2
- package/dist/types/Campaign.js +11 -4
- package/dist/types/Category.js +1 -1
- package/dist/types/Contact.js +9 -2
- package/dist/types/ContactDuplicateSuggestion.js +9 -2
- package/dist/types/ContactsExport.js +9 -2
- package/dist/types/ContactsScope.js +9 -2
- package/dist/types/Country.js +1 -1
- package/dist/types/CoverageEntry.js +9 -2
- package/dist/types/Culture.js +9 -2
- package/dist/types/Currency.js +9 -2
- package/dist/types/DnsConfigurationInstruction.js +1 -1
- package/dist/types/EmailRecipient.js +9 -2
- package/dist/types/EmailSubscription.js +1 -1
- package/dist/types/JobState.js +9 -2
- package/dist/types/License.js +9 -2
- package/dist/types/Newsroom.js +9 -2
- package/dist/types/NewsroomCompanyInformation.js +1 -1
- package/dist/types/NewsroomContact.js +1 -1
- package/dist/types/NewsroomDomain.js +9 -2
- package/dist/types/NewsroomGallery.js +9 -2
- package/dist/types/NewsroomLanguageSettings.js +1 -1
- package/dist/types/NewsroomTheme.js +12 -4
- package/dist/types/NewsroomWebhook.js +9 -2
- package/dist/types/NotificationSubscription.js +9 -2
- package/dist/types/Permissions.js +9 -2
- package/dist/types/Plan.js +9 -2
- package/dist/types/PrivacyRequest.js +9 -2
- package/dist/types/SEOSettings.js +1 -1
- package/dist/types/SenderAddress.js +9 -2
- package/dist/types/SenderDomain.js +9 -2
- package/dist/types/Snippet.js +1 -1
- package/dist/types/Story.js +9 -2
- package/dist/types/User.js +9 -2
- package/dist/types/UserAccount.js +1 -1
- package/dist/types/common/Notification.js +9 -2
- package/dist/types/common/OEmbedInfo.js +9 -2
- package/dist/types/common/Pagination.js +9 -4
- package/dist/types/common/Query.js +9 -3
- package/dist/types/common/Utm.js +1 -1
- package/dist/types/common/Warning.js +1 -1
- package/dist/types/common/index.js +65 -6
- package/dist/types/index.js +325 -33
- package/dist/utils.js +9 -2
- package/package.json +6 -5
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
}
|
|
@@ -13,7 +19,7 @@ export class Client {
|
|
|
13
19
|
offset,
|
|
14
20
|
sortOrder
|
|
15
21
|
} = options;
|
|
16
|
-
return this.apiClient.get(routing.contactsExportsUrl, {
|
|
22
|
+
return this.apiClient.get(_routing.routing.contactsExportsUrl, {
|
|
17
23
|
query: {
|
|
18
24
|
limit,
|
|
19
25
|
offset,
|
|
@@ -32,7 +38,7 @@ export class Client {
|
|
|
32
38
|
offset,
|
|
33
39
|
sortOrder
|
|
34
40
|
} = options;
|
|
35
|
-
const url = `${routing.contactsExportsUrl}/search`;
|
|
41
|
+
const url = `${_routing.routing.contactsExportsUrl}/search`;
|
|
36
42
|
return this.apiClient.post(url, {
|
|
37
43
|
payload: {
|
|
38
44
|
limit,
|
|
@@ -47,7 +53,7 @@ export class Client {
|
|
|
47
53
|
* Fetch Contacts Export object by its uuid.
|
|
48
54
|
*/
|
|
49
55
|
async get(uuid) {
|
|
50
|
-
const url = `${routing.contactsExportsUrl}/${uuid}`;
|
|
56
|
+
const url = `${_routing.routing.contactsExportsUrl}/${uuid}`;
|
|
51
57
|
const response = await this.apiClient.get(url);
|
|
52
58
|
return response.export;
|
|
53
59
|
}
|
|
@@ -65,7 +71,7 @@ export class Client {
|
|
|
65
71
|
query,
|
|
66
72
|
scope
|
|
67
73
|
} = selector;
|
|
68
|
-
const response = await this.apiClient.post(routing.contactsExportsUrl, {
|
|
74
|
+
const response = await this.apiClient.post(_routing.routing.contactsExportsUrl, {
|
|
69
75
|
payload: {
|
|
70
76
|
contacts: {
|
|
71
77
|
query,
|
|
@@ -82,10 +88,11 @@ export class Client {
|
|
|
82
88
|
* Fails with Method Not Allowed (405) error for pending and failed exports.
|
|
83
89
|
*/
|
|
84
90
|
async download(uuid) {
|
|
85
|
-
const url = `${routing.contactsExportsUrl}/${uuid}/download`;
|
|
91
|
+
const url = `${_routing.routing.contactsExportsUrl}/${uuid}/download`;
|
|
86
92
|
const response = await this.apiClient.post(url);
|
|
87
93
|
return {
|
|
88
94
|
downloadUrl: response.download_url
|
|
89
95
|
};
|
|
90
96
|
}
|
|
91
|
-
}
|
|
97
|
+
}
|
|
98
|
+
exports.Client = Client;
|
|
@@ -1,3 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
ContactsScope: true
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "ContactsScope", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return _index.ContactsScope;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
var _Client = require("./Client.js");
|
|
16
|
+
Object.keys(_Client).forEach(function (key) {
|
|
17
|
+
if (key === "default" || key === "__esModule") return;
|
|
18
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
19
|
+
Object.defineProperty(exports, key, {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () {
|
|
22
|
+
return _Client[key];
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
var _types = require("./types.js");
|
|
27
|
+
Object.keys(_types).forEach(function (key) {
|
|
28
|
+
if (key === "default" || key === "__esModule") return;
|
|
29
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
30
|
+
Object.defineProperty(exports, key, {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _types[key];
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
var _index = require("../../types/index.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
+
var _index = require("../../types/index.js");
|
|
9
|
+
class Client {
|
|
4
10
|
constructor(apiClient) {
|
|
5
11
|
this.apiClient = apiClient;
|
|
6
12
|
}
|
|
@@ -12,7 +18,7 @@ export class Client {
|
|
|
12
18
|
sortOrder
|
|
13
19
|
} = options;
|
|
14
20
|
// TODO: Switch to `scope` API parameter
|
|
15
|
-
const url = scope?.story ? routing.storyCoverageUrl.replace(':story_id', String(scope.story)) : routing.coverageUrl;
|
|
21
|
+
const url = scope?.story ? _routing.routing.storyCoverageUrl.replace(':story_id', String(scope.story)) : _routing.routing.coverageUrl;
|
|
16
22
|
return this.apiClient.get(url, {
|
|
17
23
|
query: {
|
|
18
24
|
include_deleted: includeDeleted ? 'on' : undefined,
|
|
@@ -31,12 +37,12 @@ export class Client {
|
|
|
31
37
|
sortOrder
|
|
32
38
|
} = options;
|
|
33
39
|
// TODO: Switch to `scope` API parameter
|
|
34
|
-
const url = scope?.story ? routing.storyCoverageUrl.replace(':story_id', String(scope.story)) : routing.coverageUrl;
|
|
40
|
+
const url = scope?.story ? _routing.routing.storyCoverageUrl.replace(':story_id', String(scope.story)) : _routing.routing.coverageUrl;
|
|
35
41
|
// TODO: Introduce dedicated Search POST API
|
|
36
42
|
return this.apiClient.get(url, {
|
|
37
43
|
query: {
|
|
38
44
|
include_deleted: includeDeleted ? 'on' : undefined,
|
|
39
|
-
query: Query.stringify(query),
|
|
45
|
+
query: _index.Query.stringify(query),
|
|
40
46
|
limit,
|
|
41
47
|
offset,
|
|
42
48
|
sort: sortOrder
|
|
@@ -44,7 +50,7 @@ export class Client {
|
|
|
44
50
|
});
|
|
45
51
|
}
|
|
46
52
|
async get(id, includeDeleted = false) {
|
|
47
|
-
const url = `${routing.coverageUrl}/${id}`;
|
|
53
|
+
const url = `${_routing.routing.coverageUrl}/${id}`;
|
|
48
54
|
const {
|
|
49
55
|
coverage
|
|
50
56
|
} = await this.apiClient.get(url, {
|
|
@@ -71,7 +77,7 @@ export class Client {
|
|
|
71
77
|
async create(payload) {
|
|
72
78
|
const {
|
|
73
79
|
coverage
|
|
74
|
-
} = await this.apiClient.post(routing.coverageUrl, {
|
|
80
|
+
} = await this.apiClient.post(_routing.routing.coverageUrl, {
|
|
75
81
|
payload
|
|
76
82
|
});
|
|
77
83
|
return coverage;
|
|
@@ -79,24 +85,25 @@ export class Client {
|
|
|
79
85
|
async update(id, payload) {
|
|
80
86
|
const {
|
|
81
87
|
coverage
|
|
82
|
-
} = await this.apiClient.patch(`${routing.coverageUrl}/${id}`, {
|
|
88
|
+
} = await this.apiClient.patch(`${_routing.routing.coverageUrl}/${id}`, {
|
|
83
89
|
payload
|
|
84
90
|
});
|
|
85
91
|
return coverage;
|
|
86
92
|
}
|
|
87
93
|
async remove(id) {
|
|
88
|
-
return this.apiClient.delete(`${routing.coverageUrl}/${id}`);
|
|
94
|
+
return this.apiClient.delete(`${_routing.routing.coverageUrl}/${id}`);
|
|
89
95
|
}
|
|
90
96
|
async bulkRemove(options) {
|
|
91
97
|
const {
|
|
92
98
|
selection,
|
|
93
99
|
query
|
|
94
100
|
} = options;
|
|
95
|
-
return this.apiClient.delete(routing.coverageUrl, {
|
|
101
|
+
return this.apiClient.delete(_routing.routing.coverageUrl, {
|
|
96
102
|
payload: {
|
|
97
103
|
selection,
|
|
98
104
|
query
|
|
99
105
|
}
|
|
100
106
|
});
|
|
101
107
|
}
|
|
102
|
-
}
|
|
108
|
+
}
|
|
109
|
+
exports.Client = Client;
|
|
@@ -1,2 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
|
|
1
|
+
"use strict";
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 get(id) {
|
|
7
13
|
const {
|
|
8
14
|
job
|
|
9
|
-
} = await this.apiClient.get(`${routing.jobsUrl}/${id}`);
|
|
15
|
+
} = await this.apiClient.get(`${_routing.routing.jobsUrl}/${id}`);
|
|
10
16
|
return job.state;
|
|
11
17
|
}
|
|
12
|
-
}
|
|
18
|
+
}
|
|
19
|
+
exports.Client = Client;
|
|
@@ -1,2 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
|
|
1
|
+
"use strict";
|
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 get() {
|
|
7
|
-
const url = routing.licenseUrl;
|
|
13
|
+
const url = _routing.routing.licenseUrl;
|
|
8
14
|
const {
|
|
9
15
|
license
|
|
10
16
|
} = await this.apiClient.get(`${url}/self`);
|
|
11
17
|
return license;
|
|
12
18
|
}
|
|
13
|
-
}
|
|
19
|
+
}
|
|
20
|
+
exports.Client = Client;
|
|
@@ -1 +1,15 @@
|
|
|
1
|
-
|
|
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
|
+
});
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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(newsroomId, {
|
|
7
13
|
sortOrder
|
|
8
14
|
} = {}) {
|
|
9
|
-
const url = routing.newsroomCategoriesUrl.replace(':newsroom_id', String(newsroomId));
|
|
15
|
+
const url = _routing.routing.newsroomCategoriesUrl.replace(':newsroom_id', String(newsroomId));
|
|
10
16
|
const {
|
|
11
17
|
categories
|
|
12
18
|
} = await this.apiClient.get(url, {
|
|
@@ -17,14 +23,14 @@ export class Client {
|
|
|
17
23
|
return categories;
|
|
18
24
|
}
|
|
19
25
|
async get(newsroomId, categoryId) {
|
|
20
|
-
const url = routing.newsroomCategoriesUrl.replace(':newsroom_id', String(newsroomId));
|
|
26
|
+
const url = _routing.routing.newsroomCategoriesUrl.replace(':newsroom_id', String(newsroomId));
|
|
21
27
|
const {
|
|
22
28
|
category
|
|
23
29
|
} = await this.apiClient.get(`${url}/${categoryId}`);
|
|
24
30
|
return category;
|
|
25
31
|
}
|
|
26
32
|
async create(newsroomId, payload) {
|
|
27
|
-
const url = routing.newsroomCategoriesUrl.replace(':newsroom_id', String(newsroomId));
|
|
33
|
+
const url = _routing.routing.newsroomCategoriesUrl.replace(':newsroom_id', String(newsroomId));
|
|
28
34
|
const {
|
|
29
35
|
category
|
|
30
36
|
} = await this.apiClient.post(url, {
|
|
@@ -33,7 +39,7 @@ export class Client {
|
|
|
33
39
|
return category;
|
|
34
40
|
}
|
|
35
41
|
async update(newsroomId, categoryId, payload) {
|
|
36
|
-
const url = routing.newsroomCategoriesUrl.replace(':newsroom_id', String(newsroomId));
|
|
42
|
+
const url = _routing.routing.newsroomCategoriesUrl.replace(':newsroom_id', String(newsroomId));
|
|
37
43
|
const {
|
|
38
44
|
category
|
|
39
45
|
} = await this.apiClient.patch(`${url}/${categoryId}`, {
|
|
@@ -42,7 +48,8 @@ export class Client {
|
|
|
42
48
|
return category;
|
|
43
49
|
}
|
|
44
50
|
async remove(newsroomId, categoryId) {
|
|
45
|
-
const url = routing.newsroomCategoriesUrl.replace(':newsroom_id', String(newsroomId));
|
|
51
|
+
const url = _routing.routing.newsroomCategoriesUrl.replace(':newsroom_id', String(newsroomId));
|
|
46
52
|
return this.apiClient.delete(`${url}/${categoryId}`);
|
|
47
53
|
}
|
|
48
|
-
}
|
|
54
|
+
}
|
|
55
|
+
exports.Client = Client;
|
|
@@ -1,2 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
|
|
1
|
+
"use strict";
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
+
var _index = require("../../types/index.js");
|
|
9
|
+
class Client {
|
|
4
10
|
constructor(apiClient) {
|
|
5
11
|
this.apiClient = apiClient;
|
|
6
12
|
}
|
|
7
13
|
async list(newsroomId, {
|
|
8
14
|
search
|
|
9
15
|
} = {}) {
|
|
10
|
-
const url = routing.newsroomContactsUrl.replace(':newsroom_id', String(newsroomId));
|
|
16
|
+
const url = _routing.routing.newsroomContactsUrl.replace(':newsroom_id', String(newsroomId));
|
|
11
17
|
const {
|
|
12
18
|
contacts
|
|
13
19
|
} = await this.apiClient.get(url, {
|
|
@@ -18,7 +24,7 @@ export class Client {
|
|
|
18
24
|
return contacts;
|
|
19
25
|
}
|
|
20
26
|
async get(newsroomId, contactId) {
|
|
21
|
-
const url = routing.newsroomContactsUrl.replace(':newsroom_id', String(newsroomId));
|
|
27
|
+
const url = _routing.routing.newsroomContactsUrl.replace(':newsroom_id', String(newsroomId));
|
|
22
28
|
const {
|
|
23
29
|
contact
|
|
24
30
|
} = await this.apiClient.get(`${url}/${contactId}`);
|
|
@@ -28,19 +34,19 @@ export class Client {
|
|
|
28
34
|
search,
|
|
29
35
|
query
|
|
30
36
|
} = {}) {
|
|
31
|
-
const url = routing.newsroomContactsUrl.replace(':newsroom_id', String(newsroomId));
|
|
37
|
+
const url = _routing.routing.newsroomContactsUrl.replace(':newsroom_id', String(newsroomId));
|
|
32
38
|
const {
|
|
33
39
|
contacts
|
|
34
40
|
} = await this.apiClient.get(url, {
|
|
35
41
|
query: {
|
|
36
42
|
search,
|
|
37
|
-
query: Query.stringify(query)
|
|
43
|
+
query: _index.Query.stringify(query)
|
|
38
44
|
}
|
|
39
45
|
});
|
|
40
46
|
return contacts;
|
|
41
47
|
}
|
|
42
48
|
async create(newsroomId, payload) {
|
|
43
|
-
const url = routing.newsroomContactsUrl.replace(':newsroom_id', String(newsroomId));
|
|
49
|
+
const url = _routing.routing.newsroomContactsUrl.replace(':newsroom_id', String(newsroomId));
|
|
44
50
|
const {
|
|
45
51
|
contact
|
|
46
52
|
} = await this.apiClient.post(url, {
|
|
@@ -49,7 +55,7 @@ export class Client {
|
|
|
49
55
|
return contact;
|
|
50
56
|
}
|
|
51
57
|
async update(newsroomId, contactId, payload) {
|
|
52
|
-
const url = routing.newsroomContactsUrl.replace(':newsroom_id', String(newsroomId));
|
|
58
|
+
const url = _routing.routing.newsroomContactsUrl.replace(':newsroom_id', String(newsroomId));
|
|
53
59
|
const {
|
|
54
60
|
contact
|
|
55
61
|
} = await this.apiClient.patch(`${url}/${contactId}`, {
|
|
@@ -58,7 +64,7 @@ export class Client {
|
|
|
58
64
|
return contact;
|
|
59
65
|
}
|
|
60
66
|
async remove(newsroomId, contactId, force = false) {
|
|
61
|
-
const url = routing.newsroomContactsUrl.replace(':newsroom_id', String(newsroomId));
|
|
67
|
+
const url = _routing.routing.newsroomContactsUrl.replace(':newsroom_id', String(newsroomId));
|
|
62
68
|
const query = force ? {
|
|
63
69
|
force: true
|
|
64
70
|
} : {};
|
|
@@ -66,4 +72,5 @@ export class Client {
|
|
|
66
72
|
query
|
|
67
73
|
});
|
|
68
74
|
}
|
|
69
|
-
}
|
|
75
|
+
}
|
|
76
|
+
exports.Client = Client;
|
|
@@ -1,2 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
|
|
1
|
+
"use strict";
|
|
@@ -1,22 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 get(newsroomId, domain) {
|
|
7
|
-
const url = routing.newsroomDomainsUrl.replace(':newsroom_id', String(newsroomId));
|
|
13
|
+
const url = _routing.routing.newsroomDomainsUrl.replace(':newsroom_id', String(newsroomId));
|
|
8
14
|
const response = await this.apiClient.get(`${url}/${domain}`);
|
|
9
15
|
return response.domain;
|
|
10
16
|
}
|
|
11
17
|
async list(newsroomId) {
|
|
12
|
-
const url = routing.newsroomDomainsUrl.replace(':newsroom_id', String(newsroomId));
|
|
18
|
+
const url = _routing.routing.newsroomDomainsUrl.replace(':newsroom_id', String(newsroomId));
|
|
13
19
|
const {
|
|
14
20
|
domains
|
|
15
21
|
} = await this.apiClient.get(url);
|
|
16
22
|
return domains;
|
|
17
23
|
}
|
|
18
24
|
async link(newsroomId, payload) {
|
|
19
|
-
const url = routing.newsroomDomainsUrl.replace(':newsroom_id', String(newsroomId));
|
|
25
|
+
const url = _routing.routing.newsroomDomainsUrl.replace(':newsroom_id', String(newsroomId));
|
|
20
26
|
const {
|
|
21
27
|
domain
|
|
22
28
|
} = await this.apiClient.post(url, {
|
|
@@ -25,17 +31,18 @@ export class Client {
|
|
|
25
31
|
return domain;
|
|
26
32
|
}
|
|
27
33
|
async unlink(newsroomId, domain) {
|
|
28
|
-
const url = routing.newsroomDomainsUrl.replace(':newsroom_id', String(newsroomId));
|
|
34
|
+
const url = _routing.routing.newsroomDomainsUrl.replace(':newsroom_id', String(newsroomId));
|
|
29
35
|
return this.apiClient.delete(`${url}/${domain}`);
|
|
30
36
|
}
|
|
31
37
|
async check(newsroomId, domain) {
|
|
32
|
-
const url = routing.newsroomDomainsUrl.replace(':newsroom_id', String(newsroomId));
|
|
38
|
+
const url = _routing.routing.newsroomDomainsUrl.replace(':newsroom_id', String(newsroomId));
|
|
33
39
|
const response = await this.apiClient.post(`${url}/${domain}/check`);
|
|
34
40
|
return response.domain;
|
|
35
41
|
}
|
|
36
42
|
async shareDnsInstructions(newsroomId, domain) {
|
|
37
|
-
const url = routing.newsroomDomainsUrl.replace(':newsroom_id', String(newsroomId));
|
|
43
|
+
const url = _routing.routing.newsroomDomainsUrl.replace(':newsroom_id', String(newsroomId));
|
|
38
44
|
const response = await this.apiClient.post(`${url}/${domain}/share`);
|
|
39
45
|
return response.sharable_dns_instructions;
|
|
40
46
|
}
|
|
41
|
-
}
|
|
47
|
+
}
|
|
48
|
+
exports.Client = Client;
|
|
@@ -1,2 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
|
|
1
|
+
"use strict";
|