@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
|
@@ -0,0 +1,98 @@
|
|
|
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
|
+
|
|
13
|
+
/**
|
|
14
|
+
* List Contacts Exports with sorting, and pagination.
|
|
15
|
+
*/
|
|
16
|
+
async list(options) {
|
|
17
|
+
const {
|
|
18
|
+
limit,
|
|
19
|
+
offset,
|
|
20
|
+
sortOrder
|
|
21
|
+
} = options;
|
|
22
|
+
return this.apiClient.get(_routing.routing.contactsExportsUrl, {
|
|
23
|
+
query: {
|
|
24
|
+
limit,
|
|
25
|
+
offset,
|
|
26
|
+
sort: sortOrder
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* List Contacts Exports with sorting, pagination, and filtering.
|
|
33
|
+
*/
|
|
34
|
+
async search(options) {
|
|
35
|
+
const {
|
|
36
|
+
query,
|
|
37
|
+
limit,
|
|
38
|
+
offset,
|
|
39
|
+
sortOrder
|
|
40
|
+
} = options;
|
|
41
|
+
const url = `${_routing.routing.contactsExportsUrl}/search`;
|
|
42
|
+
return this.apiClient.post(url, {
|
|
43
|
+
payload: {
|
|
44
|
+
limit,
|
|
45
|
+
offset,
|
|
46
|
+
query,
|
|
47
|
+
sort: sortOrder
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Fetch Contacts Export object by its uuid.
|
|
54
|
+
*/
|
|
55
|
+
async get(uuid) {
|
|
56
|
+
const url = `${_routing.routing.contactsExportsUrl}/${uuid}`;
|
|
57
|
+
const response = await this.apiClient.get(url);
|
|
58
|
+
return response.export;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Request export of the given selection of Contacts.
|
|
63
|
+
* If the selection size is small enough, it can be processed right away,
|
|
64
|
+
* returning an export with `status: "done"`.
|
|
65
|
+
*
|
|
66
|
+
* Otherwise, returns an export with `status: "new"`,
|
|
67
|
+
* and will notify the user over email when it's done.
|
|
68
|
+
*/
|
|
69
|
+
async create(selector) {
|
|
70
|
+
const {
|
|
71
|
+
query,
|
|
72
|
+
scope
|
|
73
|
+
} = selector;
|
|
74
|
+
const response = await this.apiClient.post(_routing.routing.contactsExportsUrl, {
|
|
75
|
+
payload: {
|
|
76
|
+
contacts: {
|
|
77
|
+
query,
|
|
78
|
+
scope
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
return response.export;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Fetch a download URL to retrieve the given Contacts Export file.
|
|
87
|
+
* Only works for exports with status = "done"
|
|
88
|
+
* Fails with Method Not Allowed (405) error for pending and failed exports.
|
|
89
|
+
*/
|
|
90
|
+
async download(uuid) {
|
|
91
|
+
const url = `${_routing.routing.contactsExportsUrl}/${uuid}/download`;
|
|
92
|
+
const response = await this.apiClient.post(url);
|
|
93
|
+
return {
|
|
94
|
+
downloadUrl: response.download_url
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exports.Client = Client;
|
|
@@ -1,11 +1,5 @@
|
|
|
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
|
}
|
|
@@ -19,7 +13,7 @@ class Client {
|
|
|
19
13
|
offset,
|
|
20
14
|
sortOrder
|
|
21
15
|
} = options;
|
|
22
|
-
return this.apiClient.get(
|
|
16
|
+
return this.apiClient.get(routing.contactsExportsUrl, {
|
|
23
17
|
query: {
|
|
24
18
|
limit,
|
|
25
19
|
offset,
|
|
@@ -38,7 +32,7 @@ class Client {
|
|
|
38
32
|
offset,
|
|
39
33
|
sortOrder
|
|
40
34
|
} = options;
|
|
41
|
-
const url = `${
|
|
35
|
+
const url = `${routing.contactsExportsUrl}/search`;
|
|
42
36
|
return this.apiClient.post(url, {
|
|
43
37
|
payload: {
|
|
44
38
|
limit,
|
|
@@ -53,7 +47,7 @@ class Client {
|
|
|
53
47
|
* Fetch Contacts Export object by its uuid.
|
|
54
48
|
*/
|
|
55
49
|
async get(uuid) {
|
|
56
|
-
const url = `${
|
|
50
|
+
const url = `${routing.contactsExportsUrl}/${uuid}`;
|
|
57
51
|
const response = await this.apiClient.get(url);
|
|
58
52
|
return response.export;
|
|
59
53
|
}
|
|
@@ -71,7 +65,7 @@ class Client {
|
|
|
71
65
|
query,
|
|
72
66
|
scope
|
|
73
67
|
} = selector;
|
|
74
|
-
const response = await this.apiClient.post(
|
|
68
|
+
const response = await this.apiClient.post(routing.contactsExportsUrl, {
|
|
75
69
|
payload: {
|
|
76
70
|
contacts: {
|
|
77
71
|
query,
|
|
@@ -88,11 +82,10 @@ class Client {
|
|
|
88
82
|
* Fails with Method Not Allowed (405) error for pending and failed exports.
|
|
89
83
|
*/
|
|
90
84
|
async download(uuid) {
|
|
91
|
-
const url = `${
|
|
85
|
+
const url = `${routing.contactsExportsUrl}/${uuid}/download`;
|
|
92
86
|
const response = await this.apiClient.post(url);
|
|
93
87
|
return {
|
|
94
88
|
downloadUrl: response.download_url
|
|
95
89
|
};
|
|
96
90
|
}
|
|
97
|
-
}
|
|
98
|
-
exports.Client = Client;
|
|
91
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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.cjs");
|
|
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.cjs");
|
|
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.cjs");
|
|
@@ -1,37 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
+
export * from "./Client.js";
|
|
2
|
+
export * from "./types.js";
|
|
3
|
+
export { ContactsScope } from "../../types/index.js"; // convenience shortcut
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,109 @@
|
|
|
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(options = {}, scope) {
|
|
14
|
+
const {
|
|
15
|
+
includeDeleted,
|
|
16
|
+
limit,
|
|
17
|
+
offset,
|
|
18
|
+
sortOrder
|
|
19
|
+
} = options;
|
|
20
|
+
// TODO: Switch to `scope` API parameter
|
|
21
|
+
const url = scope?.story ? _routing.routing.storyCoverageUrl.replace(':story_id', String(scope.story)) : _routing.routing.coverageUrl;
|
|
22
|
+
return this.apiClient.get(url, {
|
|
23
|
+
query: {
|
|
24
|
+
include_deleted: includeDeleted ? 'on' : undefined,
|
|
25
|
+
limit,
|
|
26
|
+
offset,
|
|
27
|
+
sort: sortOrder
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
async search(options = {}, scope) {
|
|
32
|
+
const {
|
|
33
|
+
includeDeleted,
|
|
34
|
+
query,
|
|
35
|
+
limit,
|
|
36
|
+
offset,
|
|
37
|
+
sortOrder
|
|
38
|
+
} = options;
|
|
39
|
+
// TODO: Switch to `scope` API parameter
|
|
40
|
+
const url = scope?.story ? _routing.routing.storyCoverageUrl.replace(':story_id', String(scope.story)) : _routing.routing.coverageUrl;
|
|
41
|
+
// TODO: Introduce dedicated Search POST API
|
|
42
|
+
return this.apiClient.get(url, {
|
|
43
|
+
query: {
|
|
44
|
+
include_deleted: includeDeleted ? 'on' : undefined,
|
|
45
|
+
query: _index.Query.stringify(query),
|
|
46
|
+
limit,
|
|
47
|
+
offset,
|
|
48
|
+
sort: sortOrder
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
async get(id, includeDeleted = false) {
|
|
53
|
+
const url = `${_routing.routing.coverageUrl}/${id}`;
|
|
54
|
+
const {
|
|
55
|
+
coverage
|
|
56
|
+
} = await this.apiClient.get(url, {
|
|
57
|
+
query: {
|
|
58
|
+
include_deleted: includeDeleted ? 'on' : undefined
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
return coverage;
|
|
62
|
+
}
|
|
63
|
+
async getByExternalReferenceId(externalReferenceId) {
|
|
64
|
+
const query = JSON.stringify({
|
|
65
|
+
external_reference_id: {
|
|
66
|
+
$in: [externalReferenceId]
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
const {
|
|
70
|
+
coverage
|
|
71
|
+
} = await this.search({
|
|
72
|
+
includeDeleted: true,
|
|
73
|
+
query
|
|
74
|
+
});
|
|
75
|
+
return coverage[0] || null;
|
|
76
|
+
}
|
|
77
|
+
async create(payload) {
|
|
78
|
+
const {
|
|
79
|
+
coverage
|
|
80
|
+
} = await this.apiClient.post(_routing.routing.coverageUrl, {
|
|
81
|
+
payload
|
|
82
|
+
});
|
|
83
|
+
return coverage;
|
|
84
|
+
}
|
|
85
|
+
async update(id, payload) {
|
|
86
|
+
const {
|
|
87
|
+
coverage
|
|
88
|
+
} = await this.apiClient.patch(`${_routing.routing.coverageUrl}/${id}`, {
|
|
89
|
+
payload
|
|
90
|
+
});
|
|
91
|
+
return coverage;
|
|
92
|
+
}
|
|
93
|
+
async remove(id) {
|
|
94
|
+
return this.apiClient.delete(`${_routing.routing.coverageUrl}/${id}`);
|
|
95
|
+
}
|
|
96
|
+
async bulkRemove(options) {
|
|
97
|
+
const {
|
|
98
|
+
selection,
|
|
99
|
+
query
|
|
100
|
+
} = options;
|
|
101
|
+
return this.apiClient.delete(_routing.routing.coverageUrl, {
|
|
102
|
+
payload: {
|
|
103
|
+
selection,
|
|
104
|
+
query
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
exports.Client = Client;
|
|
@@ -1,12 +1,6 @@
|
|
|
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
|
}
|
|
@@ -18,7 +12,7 @@ class Client {
|
|
|
18
12
|
sortOrder
|
|
19
13
|
} = options;
|
|
20
14
|
// TODO: Switch to `scope` API parameter
|
|
21
|
-
const url = scope?.story ?
|
|
15
|
+
const url = scope?.story ? routing.storyCoverageUrl.replace(':story_id', String(scope.story)) : routing.coverageUrl;
|
|
22
16
|
return this.apiClient.get(url, {
|
|
23
17
|
query: {
|
|
24
18
|
include_deleted: includeDeleted ? 'on' : undefined,
|
|
@@ -37,12 +31,12 @@ class Client {
|
|
|
37
31
|
sortOrder
|
|
38
32
|
} = options;
|
|
39
33
|
// TODO: Switch to `scope` API parameter
|
|
40
|
-
const url = scope?.story ?
|
|
34
|
+
const url = scope?.story ? routing.storyCoverageUrl.replace(':story_id', String(scope.story)) : routing.coverageUrl;
|
|
41
35
|
// TODO: Introduce dedicated Search POST API
|
|
42
36
|
return this.apiClient.get(url, {
|
|
43
37
|
query: {
|
|
44
38
|
include_deleted: includeDeleted ? 'on' : undefined,
|
|
45
|
-
query:
|
|
39
|
+
query: Query.stringify(query),
|
|
46
40
|
limit,
|
|
47
41
|
offset,
|
|
48
42
|
sort: sortOrder
|
|
@@ -50,7 +44,7 @@ class Client {
|
|
|
50
44
|
});
|
|
51
45
|
}
|
|
52
46
|
async get(id, includeDeleted = false) {
|
|
53
|
-
const url = `${
|
|
47
|
+
const url = `${routing.coverageUrl}/${id}`;
|
|
54
48
|
const {
|
|
55
49
|
coverage
|
|
56
50
|
} = await this.apiClient.get(url, {
|
|
@@ -77,7 +71,7 @@ class Client {
|
|
|
77
71
|
async create(payload) {
|
|
78
72
|
const {
|
|
79
73
|
coverage
|
|
80
|
-
} = await this.apiClient.post(
|
|
74
|
+
} = await this.apiClient.post(routing.coverageUrl, {
|
|
81
75
|
payload
|
|
82
76
|
});
|
|
83
77
|
return coverage;
|
|
@@ -85,25 +79,24 @@ class Client {
|
|
|
85
79
|
async update(id, payload) {
|
|
86
80
|
const {
|
|
87
81
|
coverage
|
|
88
|
-
} = await this.apiClient.patch(`${
|
|
82
|
+
} = await this.apiClient.patch(`${routing.coverageUrl}/${id}`, {
|
|
89
83
|
payload
|
|
90
84
|
});
|
|
91
85
|
return coverage;
|
|
92
86
|
}
|
|
93
87
|
async remove(id) {
|
|
94
|
-
return this.apiClient.delete(`${
|
|
88
|
+
return this.apiClient.delete(`${routing.coverageUrl}/${id}`);
|
|
95
89
|
}
|
|
96
90
|
async bulkRemove(options) {
|
|
97
91
|
const {
|
|
98
92
|
selection,
|
|
99
93
|
query
|
|
100
94
|
} = options;
|
|
101
|
-
return this.apiClient.delete(
|
|
95
|
+
return this.apiClient.delete(routing.coverageUrl, {
|
|
102
96
|
payload: {
|
|
103
97
|
selection,
|
|
104
98
|
query
|
|
105
99
|
}
|
|
106
100
|
});
|
|
107
101
|
}
|
|
108
|
-
}
|
|
109
|
-
exports.Client = Client;
|
|
102
|
+
}
|
|
@@ -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,19 @@
|
|
|
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(id) {
|
|
13
|
+
const {
|
|
14
|
+
job
|
|
15
|
+
} = await this.apiClient.get(`${_routing.routing.jobsUrl}/${id}`);
|
|
16
|
+
return job.state;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.Client = Client;
|
|
@@ -1,19 +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 get(id) {
|
|
13
7
|
const {
|
|
14
8
|
job
|
|
15
|
-
} = await this.apiClient.get(`${
|
|
9
|
+
} = await this.apiClient.get(`${routing.jobsUrl}/${id}`);
|
|
16
10
|
return job.state;
|
|
17
11
|
}
|
|
18
|
-
}
|
|
19
|
-
exports.Client = Client;
|
|
12
|
+
}
|
|
@@ -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,20 @@
|
|
|
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() {
|
|
13
|
+
const url = _routing.routing.licenseUrl;
|
|
14
|
+
const {
|
|
15
|
+
license
|
|
16
|
+
} = await this.apiClient.get(`${url}/self`);
|
|
17
|
+
return license;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.Client = Client;
|
|
@@ -1,20 +1,13 @@
|
|
|
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() {
|
|
13
|
-
const url =
|
|
7
|
+
const url = routing.licenseUrl;
|
|
14
8
|
const {
|
|
15
9
|
license
|
|
16
10
|
} = await this.apiClient.get(`${url}/self`);
|
|
17
11
|
return license;
|
|
18
12
|
}
|
|
19
|
-
}
|
|
20
|
-
exports.Client = Client;
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
});
|