@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
package/dist/Client.cjs
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createClient = createClient;
|
|
7
|
+
var _index = require("./api/index.cjs");
|
|
8
|
+
var _index2 = require("./endpoints/index.cjs");
|
|
9
|
+
const DEFAULT_BASE_URL = 'https://api.prezly.com';
|
|
10
|
+
function createClient({
|
|
11
|
+
accessToken,
|
|
12
|
+
baseUrl = DEFAULT_BASE_URL,
|
|
13
|
+
headers = {}
|
|
14
|
+
}) {
|
|
15
|
+
const apiClient = new _index.DeferredJobsApiClient(new _index.ApiClient({
|
|
16
|
+
accessToken,
|
|
17
|
+
baseUrl,
|
|
18
|
+
headers
|
|
19
|
+
}));
|
|
20
|
+
return {
|
|
21
|
+
accounts: new _index2.Accounts.Client(apiClient),
|
|
22
|
+
billing: new _index2.Billing.Client(apiClient),
|
|
23
|
+
campaigns: new _index2.Campaigns.Client(apiClient),
|
|
24
|
+
campaignRecipients: new _index2.CampaignRecipients.Client(apiClient),
|
|
25
|
+
contactsExports: new _index2.ContactsExports.Client(apiClient),
|
|
26
|
+
coverage: new _index2.Coverage.Client(apiClient),
|
|
27
|
+
jobs: new _index2.Jobs.Client(apiClient),
|
|
28
|
+
licenses: new _index2.Licenses.Client(apiClient),
|
|
29
|
+
newsrooms: new _index2.Newsrooms.Client(apiClient),
|
|
30
|
+
newsroomCategories: new _index2.NewsroomCategories.Client(apiClient),
|
|
31
|
+
newsroomContacts: new _index2.NewsroomContacts.Client(apiClient),
|
|
32
|
+
newsroomLanguages: new _index2.NewsroomLanguages.Client(apiClient),
|
|
33
|
+
newsroomThemes: new _index2.NewsroomThemes.Client(apiClient),
|
|
34
|
+
newsroomWebhooks: new _index2.NewsroomWebhooks.Client(apiClient),
|
|
35
|
+
newsroomPrivacyRequests: new _index2.NewsroomPrivacyRequests.Client(apiClient),
|
|
36
|
+
newsroomDomains: new _index2.NewsroomDomains.Client(apiClient),
|
|
37
|
+
newsroomGalleries: new _index2.NewsroomGalleries.Client(apiClient),
|
|
38
|
+
senderAddresses: new _index2.SenderAddresses.Client(apiClient),
|
|
39
|
+
signup: new _index2.Signup.Client(apiClient),
|
|
40
|
+
stories: new _index2.Stories.Client(apiClient),
|
|
41
|
+
snippets: new _index2.Snippets.Client(apiClient),
|
|
42
|
+
subscriptions: new _index2.Subscriptions.Client(apiClient),
|
|
43
|
+
notificationSubscriptions: new _index2.NotificationSubscriptions.Client(apiClient)
|
|
44
|
+
};
|
|
45
|
+
}
|
package/dist/Client.js
CHANGED
|
@@ -1,45 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createClient = createClient;
|
|
7
|
-
var _index = require("./api/index.js");
|
|
8
|
-
var _index2 = require("./endpoints/index.js");
|
|
1
|
+
import { ApiClient, DeferredJobsApiClient } from "./api/index.js";
|
|
2
|
+
import { Accounts, Billing, Campaigns, CampaignRecipients, ContactsExports, Coverage, Jobs, Licenses, Newsrooms, NewsroomCategories, NewsroomContacts, NewsroomLanguages, NewsroomThemes, NewsroomWebhooks, NewsroomPrivacyRequests, NewsroomDomains, NewsroomGalleries, SenderAddresses, Signup, Stories, Snippets, Subscriptions, NotificationSubscriptions } from "./endpoints/index.js";
|
|
9
3
|
const DEFAULT_BASE_URL = 'https://api.prezly.com';
|
|
10
|
-
function createClient({
|
|
4
|
+
export function createClient({
|
|
11
5
|
accessToken,
|
|
12
6
|
baseUrl = DEFAULT_BASE_URL,
|
|
13
7
|
headers = {}
|
|
14
8
|
}) {
|
|
15
|
-
const apiClient = new
|
|
9
|
+
const apiClient = new DeferredJobsApiClient(new ApiClient({
|
|
16
10
|
accessToken,
|
|
17
11
|
baseUrl,
|
|
18
12
|
headers
|
|
19
13
|
}));
|
|
20
14
|
return {
|
|
21
|
-
accounts: new
|
|
22
|
-
billing: new
|
|
23
|
-
campaigns: new
|
|
24
|
-
campaignRecipients: new
|
|
25
|
-
contactsExports: new
|
|
26
|
-
coverage: new
|
|
27
|
-
jobs: new
|
|
28
|
-
licenses: new
|
|
29
|
-
newsrooms: new
|
|
30
|
-
newsroomCategories: new
|
|
31
|
-
newsroomContacts: new
|
|
32
|
-
newsroomLanguages: new
|
|
33
|
-
newsroomThemes: new
|
|
34
|
-
newsroomWebhooks: new
|
|
35
|
-
newsroomPrivacyRequests: new
|
|
36
|
-
newsroomDomains: new
|
|
37
|
-
newsroomGalleries: new
|
|
38
|
-
senderAddresses: new
|
|
39
|
-
signup: new
|
|
40
|
-
stories: new
|
|
41
|
-
snippets: new
|
|
42
|
-
subscriptions: new
|
|
43
|
-
notificationSubscriptions: new
|
|
15
|
+
accounts: new Accounts.Client(apiClient),
|
|
16
|
+
billing: new Billing.Client(apiClient),
|
|
17
|
+
campaigns: new Campaigns.Client(apiClient),
|
|
18
|
+
campaignRecipients: new CampaignRecipients.Client(apiClient),
|
|
19
|
+
contactsExports: new ContactsExports.Client(apiClient),
|
|
20
|
+
coverage: new Coverage.Client(apiClient),
|
|
21
|
+
jobs: new Jobs.Client(apiClient),
|
|
22
|
+
licenses: new Licenses.Client(apiClient),
|
|
23
|
+
newsrooms: new Newsrooms.Client(apiClient),
|
|
24
|
+
newsroomCategories: new NewsroomCategories.Client(apiClient),
|
|
25
|
+
newsroomContacts: new NewsroomContacts.Client(apiClient),
|
|
26
|
+
newsroomLanguages: new NewsroomLanguages.Client(apiClient),
|
|
27
|
+
newsroomThemes: new NewsroomThemes.Client(apiClient),
|
|
28
|
+
newsroomWebhooks: new NewsroomWebhooks.Client(apiClient),
|
|
29
|
+
newsroomPrivacyRequests: new NewsroomPrivacyRequests.Client(apiClient),
|
|
30
|
+
newsroomDomains: new NewsroomDomains.Client(apiClient),
|
|
31
|
+
newsroomGalleries: new NewsroomGalleries.Client(apiClient),
|
|
32
|
+
senderAddresses: new SenderAddresses.Client(apiClient),
|
|
33
|
+
signup: new Signup.Client(apiClient),
|
|
34
|
+
stories: new Stories.Client(apiClient),
|
|
35
|
+
snippets: new Snippets.Client(apiClient),
|
|
36
|
+
subscriptions: new Subscriptions.Client(apiClient),
|
|
37
|
+
notificationSubscriptions: new NotificationSubscriptions.Client(apiClient)
|
|
44
38
|
};
|
|
45
39
|
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ApiClient = void 0;
|
|
7
|
+
var _index = require("../http/index.cjs");
|
|
8
|
+
var _utils = require("../utils.cjs");
|
|
9
|
+
var _constants = require("./constants.cjs");
|
|
10
|
+
class ApiClient {
|
|
11
|
+
constructor({
|
|
12
|
+
accessToken,
|
|
13
|
+
baseUrl,
|
|
14
|
+
headers
|
|
15
|
+
}) {
|
|
16
|
+
this.baseUrl = baseUrl;
|
|
17
|
+
this.headers = {
|
|
18
|
+
authorization: `Bearer ${accessToken}`,
|
|
19
|
+
'User-Agent': _constants.DEFAULT_USER_AGENT,
|
|
20
|
+
...headers
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
get(endpointUri, {
|
|
24
|
+
headers,
|
|
25
|
+
query
|
|
26
|
+
} = {}) {
|
|
27
|
+
return _index.Http.get(this.buildEndpointUrl(endpointUri), {
|
|
28
|
+
headers: {
|
|
29
|
+
...this.headers,
|
|
30
|
+
...headers
|
|
31
|
+
},
|
|
32
|
+
query
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
post(endpointUri, {
|
|
36
|
+
headers,
|
|
37
|
+
payload,
|
|
38
|
+
query
|
|
39
|
+
} = {}) {
|
|
40
|
+
return _index.Http.post(this.buildEndpointUrl(endpointUri), {
|
|
41
|
+
headers: {
|
|
42
|
+
...this.headers,
|
|
43
|
+
...headers
|
|
44
|
+
},
|
|
45
|
+
payload,
|
|
46
|
+
query
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
put(endpointUri, {
|
|
50
|
+
headers,
|
|
51
|
+
payload,
|
|
52
|
+
query
|
|
53
|
+
} = {}) {
|
|
54
|
+
return _index.Http.put(this.buildEndpointUrl(endpointUri), {
|
|
55
|
+
headers: {
|
|
56
|
+
...this.headers,
|
|
57
|
+
...headers
|
|
58
|
+
},
|
|
59
|
+
payload,
|
|
60
|
+
query
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
patch(endpointUri, {
|
|
64
|
+
headers,
|
|
65
|
+
payload,
|
|
66
|
+
query
|
|
67
|
+
} = {}) {
|
|
68
|
+
return _index.Http.patch(this.buildEndpointUrl(endpointUri), {
|
|
69
|
+
headers: {
|
|
70
|
+
...this.headers,
|
|
71
|
+
...headers
|
|
72
|
+
},
|
|
73
|
+
payload,
|
|
74
|
+
query
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
delete(endpointUri, {
|
|
78
|
+
headers,
|
|
79
|
+
payload,
|
|
80
|
+
query
|
|
81
|
+
} = {}) {
|
|
82
|
+
return _index.Http.delete(this.buildEndpointUrl(endpointUri), {
|
|
83
|
+
headers: {
|
|
84
|
+
...this.headers,
|
|
85
|
+
...headers
|
|
86
|
+
},
|
|
87
|
+
payload,
|
|
88
|
+
query
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
buildEndpointUrl(endpointUri) {
|
|
92
|
+
return `${(0, _utils.stripSlashes)(this.baseUrl)}/${(0, _utils.stripSlashes)(endpointUri)}`;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
exports.ApiClient = ApiClient;
|
package/dist/api/ApiClient.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
exports.ApiClient = void 0;
|
|
7
|
-
var _index = require("../http/index.js");
|
|
8
|
-
var _utils = require("../utils.js");
|
|
9
|
-
var _constants = require("./constants.js");
|
|
10
|
-
class ApiClient {
|
|
1
|
+
import { Http } from "../http/index.js";
|
|
2
|
+
import { stripSlashes } from "../utils.js";
|
|
3
|
+
import { DEFAULT_USER_AGENT } from "./constants.js";
|
|
4
|
+
export class ApiClient {
|
|
11
5
|
constructor({
|
|
12
6
|
accessToken,
|
|
13
7
|
baseUrl,
|
|
@@ -16,7 +10,7 @@ class ApiClient {
|
|
|
16
10
|
this.baseUrl = baseUrl;
|
|
17
11
|
this.headers = {
|
|
18
12
|
authorization: `Bearer ${accessToken}`,
|
|
19
|
-
'User-Agent':
|
|
13
|
+
'User-Agent': DEFAULT_USER_AGENT,
|
|
20
14
|
...headers
|
|
21
15
|
};
|
|
22
16
|
}
|
|
@@ -24,7 +18,7 @@ class ApiClient {
|
|
|
24
18
|
headers,
|
|
25
19
|
query
|
|
26
20
|
} = {}) {
|
|
27
|
-
return
|
|
21
|
+
return Http.get(this.buildEndpointUrl(endpointUri), {
|
|
28
22
|
headers: {
|
|
29
23
|
...this.headers,
|
|
30
24
|
...headers
|
|
@@ -37,7 +31,7 @@ class ApiClient {
|
|
|
37
31
|
payload,
|
|
38
32
|
query
|
|
39
33
|
} = {}) {
|
|
40
|
-
return
|
|
34
|
+
return Http.post(this.buildEndpointUrl(endpointUri), {
|
|
41
35
|
headers: {
|
|
42
36
|
...this.headers,
|
|
43
37
|
...headers
|
|
@@ -51,7 +45,7 @@ class ApiClient {
|
|
|
51
45
|
payload,
|
|
52
46
|
query
|
|
53
47
|
} = {}) {
|
|
54
|
-
return
|
|
48
|
+
return Http.put(this.buildEndpointUrl(endpointUri), {
|
|
55
49
|
headers: {
|
|
56
50
|
...this.headers,
|
|
57
51
|
...headers
|
|
@@ -65,7 +59,7 @@ class ApiClient {
|
|
|
65
59
|
payload,
|
|
66
60
|
query
|
|
67
61
|
} = {}) {
|
|
68
|
-
return
|
|
62
|
+
return Http.patch(this.buildEndpointUrl(endpointUri), {
|
|
69
63
|
headers: {
|
|
70
64
|
...this.headers,
|
|
71
65
|
...headers
|
|
@@ -79,7 +73,7 @@ class ApiClient {
|
|
|
79
73
|
payload,
|
|
80
74
|
query
|
|
81
75
|
} = {}) {
|
|
82
|
-
return
|
|
76
|
+
return Http.delete(this.buildEndpointUrl(endpointUri), {
|
|
83
77
|
headers: {
|
|
84
78
|
...this.headers,
|
|
85
79
|
...headers
|
|
@@ -89,7 +83,6 @@ class ApiClient {
|
|
|
89
83
|
});
|
|
90
84
|
}
|
|
91
85
|
buildEndpointUrl(endpointUri) {
|
|
92
|
-
return `${
|
|
86
|
+
return `${stripSlashes(this.baseUrl)}/${stripSlashes(endpointUri)}`;
|
|
93
87
|
}
|
|
94
|
-
}
|
|
95
|
-
exports.ApiClient = ApiClient;
|
|
88
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DeferredJobsApiClient = void 0;
|
|
7
|
+
var _progressPromise = require("@prezly/progress-promise");
|
|
8
|
+
var _index = require("../http/index.cjs");
|
|
9
|
+
var _routing = require("../routing.cjs");
|
|
10
|
+
var _index2 = require("../types/index.cjs");
|
|
11
|
+
const JOB_STATUS_POLLING_INTERVAL = 2000; // ms
|
|
12
|
+
|
|
13
|
+
async function sleep(milliseconds) {
|
|
14
|
+
return new Promise(resolve => setTimeout(resolve, milliseconds));
|
|
15
|
+
}
|
|
16
|
+
async function handleDeferredJob(request) {
|
|
17
|
+
const response = await request;
|
|
18
|
+
if (response.status === _index.HttpCodes.ACCEPTED && (0, _index.isDeferredJobResponse)(response.payload)) {
|
|
19
|
+
return new _progressPromise.ProgressPromise(async function (resolve, reject, progress) {
|
|
20
|
+
do {
|
|
21
|
+
const response = await _index.Http.get(_routing.routing.jobsUrl);
|
|
22
|
+
const {
|
|
23
|
+
job
|
|
24
|
+
} = response.payload;
|
|
25
|
+
if (job.status === _index2.JobStatus.RESOLVED) {
|
|
26
|
+
resolve(job.value);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (job.status === _index2.JobStatus.REJECTED) {
|
|
30
|
+
reject(job.value);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
progress(job.progress, job.value);
|
|
34
|
+
await sleep(JOB_STATUS_POLLING_INTERVAL);
|
|
35
|
+
} while (true); // eslint-disable-line no-constant-condition
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return _progressPromise.ProgressPromise.resolve(response.payload);
|
|
40
|
+
}
|
|
41
|
+
class DeferredJobsApiClient {
|
|
42
|
+
constructor(apiClient) {
|
|
43
|
+
this.apiClient = apiClient;
|
|
44
|
+
}
|
|
45
|
+
get(endpointUri, {
|
|
46
|
+
headers,
|
|
47
|
+
query
|
|
48
|
+
} = {}) {
|
|
49
|
+
return handleDeferredJob(this.apiClient.get(endpointUri, {
|
|
50
|
+
headers,
|
|
51
|
+
query
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
post(endpointUri, {
|
|
55
|
+
headers,
|
|
56
|
+
payload,
|
|
57
|
+
query
|
|
58
|
+
} = {}) {
|
|
59
|
+
return handleDeferredJob(this.apiClient.post(endpointUri, {
|
|
60
|
+
headers,
|
|
61
|
+
payload,
|
|
62
|
+
query
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
put(endpointUri, {
|
|
66
|
+
headers,
|
|
67
|
+
payload,
|
|
68
|
+
query
|
|
69
|
+
} = {}) {
|
|
70
|
+
return handleDeferredJob(this.apiClient.put(endpointUri, {
|
|
71
|
+
headers,
|
|
72
|
+
payload,
|
|
73
|
+
query
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
patch(endpointUri, {
|
|
77
|
+
headers,
|
|
78
|
+
payload,
|
|
79
|
+
query
|
|
80
|
+
} = {}) {
|
|
81
|
+
return handleDeferredJob(this.apiClient.patch(endpointUri, {
|
|
82
|
+
headers,
|
|
83
|
+
payload,
|
|
84
|
+
query
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
delete(endpointUri, {
|
|
88
|
+
headers,
|
|
89
|
+
payload,
|
|
90
|
+
query
|
|
91
|
+
} = {}) {
|
|
92
|
+
return handleDeferredJob(this.apiClient.delete(endpointUri, {
|
|
93
|
+
headers,
|
|
94
|
+
payload,
|
|
95
|
+
query
|
|
96
|
+
}));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.DeferredJobsApiClient = DeferredJobsApiClient;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
exports.DeferredJobsApiClient = void 0;
|
|
7
|
-
var _progressPromise = require("@prezly/progress-promise");
|
|
8
|
-
var _index = require("../http/index.js");
|
|
9
|
-
var _routing = require("../routing.js");
|
|
10
|
-
var _index2 = require("../types/index.js");
|
|
1
|
+
import { ProgressPromise } from '@prezly/progress-promise';
|
|
2
|
+
import { Http, HttpCodes, isDeferredJobResponse } from "../http/index.js";
|
|
3
|
+
import { routing } from "../routing.js";
|
|
4
|
+
import { JobStatus } from "../types/index.js";
|
|
11
5
|
const JOB_STATUS_POLLING_INTERVAL = 2000; // ms
|
|
12
6
|
|
|
13
7
|
async function sleep(milliseconds) {
|
|
@@ -15,18 +9,18 @@ async function sleep(milliseconds) {
|
|
|
15
9
|
}
|
|
16
10
|
async function handleDeferredJob(request) {
|
|
17
11
|
const response = await request;
|
|
18
|
-
if (response.status ===
|
|
19
|
-
return new
|
|
12
|
+
if (response.status === HttpCodes.ACCEPTED && isDeferredJobResponse(response.payload)) {
|
|
13
|
+
return new ProgressPromise(async function (resolve, reject, progress) {
|
|
20
14
|
do {
|
|
21
|
-
const response = await
|
|
15
|
+
const response = await Http.get(routing.jobsUrl);
|
|
22
16
|
const {
|
|
23
17
|
job
|
|
24
18
|
} = response.payload;
|
|
25
|
-
if (job.status ===
|
|
19
|
+
if (job.status === JobStatus.RESOLVED) {
|
|
26
20
|
resolve(job.value);
|
|
27
21
|
return;
|
|
28
22
|
}
|
|
29
|
-
if (job.status ===
|
|
23
|
+
if (job.status === JobStatus.REJECTED) {
|
|
30
24
|
reject(job.value);
|
|
31
25
|
return;
|
|
32
26
|
}
|
|
@@ -36,9 +30,9 @@ async function handleDeferredJob(request) {
|
|
|
36
30
|
});
|
|
37
31
|
}
|
|
38
32
|
|
|
39
|
-
return
|
|
33
|
+
return ProgressPromise.resolve(response.payload);
|
|
40
34
|
}
|
|
41
|
-
class DeferredJobsApiClient {
|
|
35
|
+
export class DeferredJobsApiClient {
|
|
42
36
|
constructor(apiClient) {
|
|
43
37
|
this.apiClient = apiClient;
|
|
44
38
|
}
|
|
@@ -95,5 +89,4 @@ class DeferredJobsApiClient {
|
|
|
95
89
|
query
|
|
96
90
|
}));
|
|
97
91
|
}
|
|
98
|
-
}
|
|
99
|
-
exports.DeferredJobsApiClient = DeferredJobsApiClient;
|
|
92
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DEFAULT_USER_AGENT = void 0;
|
|
7
|
+
const VERSION = "11.8.1-0";
|
|
8
|
+
const URL = 'https://github.com/prezly/javascript-sdk';
|
|
9
|
+
const DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
|
|
10
|
+
exports.DEFAULT_USER_AGENT = DEFAULT_USER_AGENT;
|
package/dist/api/constants.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.DEFAULT_USER_AGENT = void 0;
|
|
7
|
-
const VERSION = "11.8.0";
|
|
1
|
+
const VERSION = "11.8.1-0";
|
|
8
2
|
const URL = 'https://github.com/prezly/javascript-sdk';
|
|
9
|
-
const DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
|
|
10
|
-
exports.DEFAULT_USER_AGENT = DEFAULT_USER_AGENT;
|
|
3
|
+
export const DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "ApiClient", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _ApiClient.ApiClient;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "DeferredJobsApiClient", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _DeferredJobsApiClient.DeferredJobsApiClient;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var _ApiClient = require("./ApiClient.cjs");
|
|
19
|
+
var _DeferredJobsApiClient = require("./DeferredJobsApiClient.cjs");
|
package/dist/api/index.js
CHANGED
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "ApiClient", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _ApiClient.ApiClient;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "DeferredJobsApiClient", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _DeferredJobsApiClient.DeferredJobsApiClient;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
var _ApiClient = require("./ApiClient.js");
|
|
19
|
-
var _DeferredJobsApiClient = require("./DeferredJobsApiClient.js");
|
|
1
|
+
export { ApiClient } from "./ApiClient.js";
|
|
2
|
+
export { DeferredJobsApiClient } from "./DeferredJobsApiClient.js";
|
|
@@ -0,0 +1,29 @@
|
|
|
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() {
|
|
13
|
+
const url = _routing.routing.accounts;
|
|
14
|
+
return this.apiClient.get(url);
|
|
15
|
+
}
|
|
16
|
+
async create(payload) {
|
|
17
|
+
const url = _routing.routing.accounts;
|
|
18
|
+
return this.apiClient.post(url, {
|
|
19
|
+
payload
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
async update(id, payload) {
|
|
23
|
+
const url = `${_routing.routing.accounts}/${id}`;
|
|
24
|
+
return this.apiClient.patch(url, {
|
|
25
|
+
payload
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.Client = Client;
|
|
@@ -1,29 +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 list() {
|
|
13
|
-
const url =
|
|
7
|
+
const url = routing.accounts;
|
|
14
8
|
return this.apiClient.get(url);
|
|
15
9
|
}
|
|
16
10
|
async create(payload) {
|
|
17
|
-
const url =
|
|
11
|
+
const url = routing.accounts;
|
|
18
12
|
return this.apiClient.post(url, {
|
|
19
13
|
payload
|
|
20
14
|
});
|
|
21
15
|
}
|
|
22
16
|
async update(id, payload) {
|
|
23
|
-
const url = `${
|
|
17
|
+
const url = `${routing.accounts}/${id}`;
|
|
24
18
|
return this.apiClient.patch(url, {
|
|
25
19
|
payload
|
|
26
20
|
});
|
|
27
21
|
}
|
|
28
|
-
}
|
|
29
|
-
exports.Client = Client;
|
|
22
|
+
}
|
|
@@ -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 signup(payload) {
|
|
13
|
+
const url = `${_routing.routing.billing}/signup`;
|
|
14
|
+
return this.apiClient.post(url, {
|
|
15
|
+
payload
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.Client = Client;
|