@prezly/sdk 7.12.0 → 9.0.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/README.md +8 -8
- package/dist/Client.d.ts +29 -0
- package/dist/Client.js +35 -0
- package/dist/{Sdk → api}/ApiClient.d.ts +2 -2
- package/dist/api/ApiClient.js +88 -0
- package/dist/{Sdk → api}/DeferredJobsApiClient.d.ts +3 -3
- package/dist/api/DeferredJobsApiClient.js +92 -0
- package/dist/{Sdk → api}/constants.d.ts +0 -0
- package/dist/api/constants.js +3 -0
- package/dist/api/index.d.ts +2 -0
- package/dist/api/index.js +2 -0
- package/dist/endpoints/Accounts/Client.d.ts +10 -0
- package/dist/endpoints/Accounts/Client.js +22 -0
- package/dist/endpoints/Accounts/index.d.ts +2 -0
- package/dist/endpoints/Accounts/index.js +2 -0
- package/dist/endpoints/Accounts/types.d.ts +16 -0
- package/dist/endpoints/Accounts/types.js +1 -0
- package/dist/endpoints/CampaignRecipients/Client.d.ts +29 -0
- package/dist/endpoints/CampaignRecipients/Client.js +78 -0
- package/dist/endpoints/CampaignRecipients/index.d.ts +3 -0
- package/dist/endpoints/CampaignRecipients/index.js +3 -0
- package/dist/endpoints/CampaignRecipients/scopes.d.ts +27 -0
- package/dist/endpoints/CampaignRecipients/scopes.js +1 -0
- package/dist/endpoints/CampaignRecipients/types.d.ts +14 -0
- package/dist/endpoints/CampaignRecipients/types.js +1 -0
- package/dist/endpoints/Campaigns/Client.d.ts +21 -0
- package/dist/endpoints/Campaigns/Client.js +85 -0
- package/dist/endpoints/Campaigns/index.d.ts +2 -0
- package/dist/endpoints/Campaigns/index.js +2 -0
- package/dist/{Sdk → endpoints}/Campaigns/types.d.ts +11 -9
- package/dist/endpoints/Campaigns/types.js +1 -0
- package/dist/endpoints/Coverage/Client.d.ts +23 -0
- package/dist/endpoints/Coverage/Client.js +102 -0
- package/dist/endpoints/Coverage/index.d.ts +2 -0
- package/dist/endpoints/Coverage/index.js +2 -0
- package/dist/{Sdk → endpoints}/Coverage/types.d.ts +14 -12
- package/dist/endpoints/Coverage/types.js +1 -0
- package/dist/endpoints/Jobs/Client.d.ts +7 -0
- package/dist/endpoints/Jobs/Client.js +12 -0
- package/dist/endpoints/Jobs/index.d.ts +2 -0
- package/dist/endpoints/Jobs/index.js +2 -0
- package/dist/endpoints/Jobs/types.d.ts +7 -0
- package/dist/endpoints/Jobs/types.js +1 -0
- package/dist/endpoints/Licenses/Client.d.ts +7 -0
- package/dist/endpoints/Licenses/Client.js +13 -0
- package/dist/endpoints/Licenses/index.d.ts +1 -0
- package/dist/endpoints/Licenses/index.js +1 -0
- package/dist/endpoints/NewsroomCategories/Client.d.ts +14 -0
- package/dist/endpoints/NewsroomCategories/Client.js +48 -0
- package/dist/endpoints/NewsroomCategories/index.d.ts +2 -0
- package/dist/endpoints/NewsroomCategories/index.js +2 -0
- package/dist/{Sdk → endpoints}/NewsroomCategories/types.d.ts +3 -3
- package/dist/endpoints/NewsroomCategories/types.js +1 -0
- package/dist/endpoints/NewsroomContacts/Client.d.ts +16 -0
- package/dist/endpoints/NewsroomContacts/Client.js +69 -0
- package/dist/endpoints/NewsroomContacts/index.d.ts +2 -0
- package/dist/endpoints/NewsroomContacts/index.js +2 -0
- package/dist/{Sdk → endpoints}/NewsroomContacts/types.d.ts +7 -11
- package/dist/endpoints/NewsroomContacts/types.js +1 -0
- package/dist/endpoints/NewsroomDomains/Client.d.ts +15 -0
- package/dist/endpoints/NewsroomDomains/Client.js +41 -0
- package/dist/endpoints/NewsroomDomains/index.d.ts +2 -0
- package/dist/endpoints/NewsroomDomains/index.js +2 -0
- package/dist/endpoints/NewsroomDomains/types.d.ts +3 -0
- package/dist/endpoints/NewsroomDomains/types.js +1 -0
- package/dist/endpoints/NewsroomGalleries/Client.d.ts +17 -0
- package/dist/endpoints/NewsroomGalleries/Client.js +75 -0
- package/dist/endpoints/NewsroomGalleries/index.d.ts +2 -0
- package/dist/endpoints/NewsroomGalleries/index.js +2 -0
- package/dist/{Sdk → endpoints}/NewsroomGalleries/types.d.ts +13 -11
- package/dist/endpoints/NewsroomGalleries/types.js +1 -0
- package/dist/{Sdk/NewsroomLanguages/NewsroomLanguages.d.ts → endpoints/NewsroomLanguages/Client.d.ts} +9 -11
- package/dist/endpoints/NewsroomLanguages/Client.js +93 -0
- package/dist/endpoints/NewsroomLanguages/index.d.ts +2 -0
- package/dist/endpoints/NewsroomLanguages/index.js +2 -0
- package/dist/endpoints/NewsroomLanguages/lib.d.ts +2 -0
- package/dist/endpoints/NewsroomLanguages/lib.js +3 -0
- package/dist/{Sdk → endpoints}/NewsroomLanguages/types.d.ts +5 -5
- package/dist/endpoints/NewsroomLanguages/types.js +1 -0
- package/dist/endpoints/NewsroomPrivacyRequests/Client.d.ts +9 -0
- package/dist/endpoints/NewsroomPrivacyRequests/Client.js +22 -0
- package/dist/endpoints/NewsroomPrivacyRequests/index.d.ts +2 -0
- package/dist/endpoints/NewsroomPrivacyRequests/index.js +2 -0
- package/dist/{Sdk → endpoints}/NewsroomPrivacyRequests/types.d.ts +5 -5
- package/dist/endpoints/NewsroomPrivacyRequests/types.js +1 -0
- package/dist/endpoints/NewsroomSubscriptions/Client.d.ts +13 -0
- package/dist/endpoints/NewsroomSubscriptions/Client.js +15 -0
- package/dist/endpoints/NewsroomSubscriptions/index.d.ts +2 -0
- package/dist/endpoints/NewsroomSubscriptions/index.js +2 -0
- package/dist/{Sdk → endpoints}/NewsroomSubscriptions/types.d.ts +3 -3
- package/dist/endpoints/NewsroomSubscriptions/types.js +1 -0
- package/dist/{Sdk/NewsroomThemes/NewsroomThemes.d.ts → endpoints/NewsroomThemes/Client.d.ts} +4 -6
- package/dist/endpoints/NewsroomThemes/Client.js +36 -0
- package/dist/endpoints/NewsroomThemes/index.d.ts +1 -0
- package/dist/endpoints/NewsroomThemes/index.js +1 -0
- package/dist/endpoints/NewsroomWebhooks/Client.d.ts +14 -0
- package/dist/endpoints/NewsroomWebhooks/Client.js +42 -0
- package/dist/endpoints/NewsroomWebhooks/index.d.ts +2 -0
- package/dist/endpoints/NewsroomWebhooks/index.js +2 -0
- package/dist/endpoints/NewsroomWebhooks/types.d.ts +15 -0
- package/dist/endpoints/NewsroomWebhooks/types.js +1 -0
- package/dist/endpoints/Newsrooms/Client.d.ts +19 -0
- package/dist/endpoints/Newsrooms/Client.js +90 -0
- package/dist/endpoints/Newsrooms/index.d.ts +2 -0
- package/dist/endpoints/Newsrooms/index.js +2 -0
- package/dist/{Sdk → endpoints}/Newsrooms/types.d.ts +11 -11
- package/dist/endpoints/Newsrooms/types.js +1 -0
- package/dist/endpoints/SenderAddresses/Client.d.ts +12 -0
- package/dist/endpoints/SenderAddresses/Client.js +37 -0
- package/dist/endpoints/SenderAddresses/index.d.ts +2 -0
- package/dist/endpoints/SenderAddresses/index.js +2 -0
- package/dist/{Sdk → endpoints}/SenderAddresses/types.d.ts +2 -2
- package/dist/endpoints/SenderAddresses/types.js +1 -0
- package/dist/endpoints/Snippets/Client.d.ts +14 -0
- package/dist/endpoints/Snippets/Client.js +42 -0
- package/dist/endpoints/Snippets/index.d.ts +2 -0
- package/dist/endpoints/Snippets/index.js +2 -0
- package/dist/{Sdk → endpoints}/Snippets/types.d.ts +2 -2
- package/dist/endpoints/Snippets/types.js +1 -0
- package/dist/endpoints/Stories/Client.d.ts +17 -0
- package/dist/endpoints/Stories/Client.js +63 -0
- package/dist/endpoints/Stories/index.d.ts +2 -0
- package/dist/endpoints/Stories/index.js +2 -0
- package/dist/{Sdk → endpoints}/Stories/types.d.ts +19 -18
- package/dist/endpoints/Stories/types.js +1 -0
- package/dist/{Sdk/Subscriptions/Subscriptions.d.ts → endpoints/Subscriptions/Client.d.ts} +6 -8
- package/dist/endpoints/Subscriptions/Client.js +51 -0
- package/dist/endpoints/Subscriptions/index.d.ts +2 -0
- package/dist/endpoints/Subscriptions/index.js +2 -0
- package/dist/{Sdk → endpoints}/Subscriptions/types.d.ts +13 -6
- package/dist/endpoints/Subscriptions/types.js +8 -0
- package/dist/endpoints/index.d.ts +20 -0
- package/dist/endpoints/index.js +20 -0
- package/dist/{Api → http}/ApiError.d.ts +2 -2
- package/dist/http/ApiError.js +14 -0
- package/dist/http/Http.d.ts +8 -0
- package/dist/http/Http.js +62 -0
- package/dist/{Api → http}/constants.d.ts +0 -0
- package/dist/http/constants.js +3 -0
- package/dist/{Api → http}/createRequest.d.ts +2 -2
- package/dist/http/createRequest.js +99 -0
- package/dist/http/index.d.ts +3 -0
- package/dist/http/index.js +3 -0
- package/dist/http/lib.d.ts +3 -0
- package/dist/http/lib.js +29 -0
- package/dist/{Api → http}/types.d.ts +0 -0
- package/dist/http/types.js +16 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +4 -22
- package/dist/{Sdk/routing.d.ts → routing.d.ts} +1 -2
- package/dist/routing.js +27 -0
- package/dist/types/Campaign.d.ts +33 -31
- package/dist/types/Campaign.js +23 -20
- package/dist/types/Category.d.ts +1 -1
- package/dist/types/Category.js +1 -3
- package/dist/types/Contact.d.ts +83 -69
- package/dist/types/Contact.js +34 -26
- package/dist/types/ContactDuplicateSuggestion.d.ts +9 -7
- package/dist/types/ContactDuplicateSuggestion.js +7 -7
- package/dist/types/{CountryRef.d.ts → Country.d.ts} +0 -0
- package/dist/types/Country.js +1 -0
- package/dist/types/{Coverage.d.ts → CoverageEntry.d.ts} +32 -30
- package/dist/types/CoverageEntry.js +25 -0
- package/dist/types/Culture.d.ts +14 -0
- package/dist/types/Culture.js +9 -0
- package/dist/types/DnsConfigurationInstruction.js +1 -3
- package/dist/types/EmailRecipient.d.ts +14 -12
- package/dist/types/EmailRecipient.js +7 -7
- package/dist/types/EmailSubscription.js +1 -3
- package/dist/types/Entity.js +1 -3
- package/dist/types/JobState.js +5 -9
- package/dist/types/License.d.ts +12 -2
- package/dist/types/License.js +14 -3
- package/dist/types/Newsroom.d.ts +30 -14
- package/dist/types/Newsroom.js +23 -10
- package/dist/types/NewsroomCompanyInformation.js +1 -3
- package/dist/types/NewsroomContact.d.ts +2 -2
- package/dist/types/NewsroomContact.js +1 -3
- package/dist/types/NewsroomDomain.d.ts +7 -1
- package/dist/types/NewsroomDomain.js +2 -3
- package/dist/types/NewsroomGallery.d.ts +17 -5
- package/dist/types/NewsroomGallery.js +9 -3
- package/dist/types/NewsroomLanguageSettings.d.ts +3 -3
- package/dist/types/NewsroomLanguageSettings.js +1 -3
- package/dist/types/NewsroomTheme.d.ts +53 -0
- package/dist/types/NewsroomTheme.js +25 -0
- package/dist/types/NewsroomWebhook.d.ts +11 -9
- package/dist/types/NewsroomWebhook.js +13 -13
- package/dist/types/Permissions.js +10 -14
- package/dist/types/PrivacyRequest.d.ts +13 -11
- package/dist/types/PrivacyRequest.js +17 -16
- package/dist/types/SenderAddress.d.ts +8 -6
- package/dist/types/SenderAddress.js +9 -9
- package/dist/types/SenderDomain.d.ts +8 -6
- package/dist/types/SenderDomain.js +10 -10
- package/dist/types/Snippet.d.ts +1 -1
- package/dist/types/Snippet.js +1 -3
- package/dist/types/Story.d.ts +66 -64
- package/dist/types/Story.js +33 -30
- package/dist/types/{UserRef.d.ts → User.d.ts} +0 -0
- package/dist/types/User.js +1 -0
- package/dist/types/UserAccount.d.ts +3 -3
- package/dist/types/UserAccount.js +1 -3
- package/dist/types/common/Notification.d.ts +14 -12
- package/dist/types/common/Notification.js +11 -11
- package/dist/types/common/OEmbedInfo.js +1 -3
- package/dist/types/common/Pagination.js +9 -9
- package/dist/types/common/Query.d.ts +4 -1
- package/dist/types/common/Query.js +15 -3
- package/dist/types/common/Utm.js +1 -3
- package/dist/types/common/Warning.js +1 -3
- package/dist/types/common/index.js +6 -19
- package/dist/types/index.d.ts +12 -23
- package/dist/types/index.js +28 -53
- package/dist/{Sdk/utils.d.ts → utils.d.ts} +1 -1
- package/dist/utils.js +23 -0
- package/package.json +20 -6
- package/dist/Api/Api.d.ts +0 -9
- package/dist/Api/Api.js +0 -55
- package/dist/Api/ApiError.js +0 -30
- package/dist/Api/constants.js +0 -7
- package/dist/Api/createRequest.js +0 -154
- package/dist/Api/index.d.ts +0 -3
- package/dist/Api/index.js +0 -14
- package/dist/Api/lib.d.ts +0 -12
- package/dist/Api/lib.js +0 -67
- package/dist/Api/types.js +0 -20
- package/dist/Sdk/Accounts/Accounts.d.ts +0 -12
- package/dist/Sdk/Accounts/Accounts.js +0 -79
- package/dist/Sdk/Accounts/index.d.ts +0 -2
- package/dist/Sdk/Accounts/index.js +0 -15
- package/dist/Sdk/Accounts/types.d.ts +0 -16
- package/dist/Sdk/Accounts/types.js +0 -3
- package/dist/Sdk/ApiClient.js +0 -68
- package/dist/Sdk/CampaignRecipients/CampaignRecipients.d.ts +0 -28
- package/dist/Sdk/CampaignRecipients/CampaignRecipients.js +0 -126
- package/dist/Sdk/CampaignRecipients/index.d.ts +0 -2
- package/dist/Sdk/CampaignRecipients/index.js +0 -20
- package/dist/Sdk/CampaignRecipients/types.d.ts +0 -12
- package/dist/Sdk/CampaignRecipients/types.js +0 -3
- package/dist/Sdk/Campaigns/Campaigns.d.ts +0 -23
- package/dist/Sdk/Campaigns/Campaigns.js +0 -168
- package/dist/Sdk/Campaigns/index.d.ts +0 -2
- package/dist/Sdk/Campaigns/index.js +0 -9
- package/dist/Sdk/Campaigns/types.js +0 -3
- package/dist/Sdk/Coverage/Coverage.d.ts +0 -24
- package/dist/Sdk/Coverage/Coverage.js +0 -159
- package/dist/Sdk/Coverage/index.d.ts +0 -2
- package/dist/Sdk/Coverage/index.js +0 -9
- package/dist/Sdk/Coverage/types.js +0 -3
- package/dist/Sdk/DeferredJobsApiClient.js +0 -126
- package/dist/Sdk/Jobs/Jobs.d.ts +0 -9
- package/dist/Sdk/Jobs/Jobs.js +0 -64
- package/dist/Sdk/Jobs/index.d.ts +0 -2
- package/dist/Sdk/Jobs/index.js +0 -9
- package/dist/Sdk/Jobs/types.d.ts +0 -7
- package/dist/Sdk/Jobs/types.js +0 -3
- package/dist/Sdk/Licenses/Licenses.d.ts +0 -9
- package/dist/Sdk/Licenses/Licenses.js +0 -66
- package/dist/Sdk/Licenses/index.d.ts +0 -1
- package/dist/Sdk/Licenses/index.js +0 -9
- package/dist/Sdk/NewsroomCategories/NewsroomCategories.d.ts +0 -16
- package/dist/Sdk/NewsroomCategories/NewsroomCategories.js +0 -129
- package/dist/Sdk/NewsroomCategories/index.d.ts +0 -2
- package/dist/Sdk/NewsroomCategories/index.js +0 -9
- package/dist/Sdk/NewsroomCategories/types.js +0 -3
- package/dist/Sdk/NewsroomContacts/NewsroomContacts.d.ts +0 -18
- package/dist/Sdk/NewsroomContacts/NewsroomContacts.js +0 -145
- package/dist/Sdk/NewsroomContacts/index.d.ts +0 -2
- package/dist/Sdk/NewsroomContacts/index.js +0 -9
- package/dist/Sdk/NewsroomContacts/types.js +0 -3
- package/dist/Sdk/NewsroomDomains/NewsroomDomains.d.ts +0 -17
- package/dist/Sdk/NewsroomDomains/NewsroomDomains.js +0 -137
- package/dist/Sdk/NewsroomDomains/index.d.ts +0 -2
- package/dist/Sdk/NewsroomDomains/index.js +0 -9
- package/dist/Sdk/NewsroomDomains/types.d.ts +0 -3
- package/dist/Sdk/NewsroomDomains/types.js +0 -3
- package/dist/Sdk/NewsroomGalleries/NewsroomGalleries.d.ts +0 -19
- package/dist/Sdk/NewsroomGalleries/NewsroomGalleries.js +0 -140
- package/dist/Sdk/NewsroomGalleries/index.d.ts +0 -1
- package/dist/Sdk/NewsroomGalleries/index.js +0 -9
- package/dist/Sdk/NewsroomGalleries/types.js +0 -3
- package/dist/Sdk/NewsroomLanguages/NewsroomLanguages.js +0 -173
- package/dist/Sdk/NewsroomLanguages/index.d.ts +0 -2
- package/dist/Sdk/NewsroomLanguages/index.js +0 -9
- package/dist/Sdk/NewsroomLanguages/lib.d.ts +0 -2
- package/dist/Sdk/NewsroomLanguages/lib.js +0 -15
- package/dist/Sdk/NewsroomLanguages/types.js +0 -3
- package/dist/Sdk/NewsroomPrivacyRequests/NewsroomPrivacyRequests.d.ts +0 -11
- package/dist/Sdk/NewsroomPrivacyRequests/NewsroomPrivacyRequests.js +0 -83
- package/dist/Sdk/NewsroomPrivacyRequests/index.d.ts +0 -2
- package/dist/Sdk/NewsroomPrivacyRequests/index.js +0 -9
- package/dist/Sdk/NewsroomPrivacyRequests/types.js +0 -3
- package/dist/Sdk/NewsroomSubscriptions/NewsroomSubscriptions.d.ts +0 -15
- package/dist/Sdk/NewsroomSubscriptions/NewsroomSubscriptions.js +0 -65
- package/dist/Sdk/NewsroomSubscriptions/index.d.ts +0 -2
- package/dist/Sdk/NewsroomSubscriptions/index.js +0 -9
- package/dist/Sdk/NewsroomSubscriptions/types.js +0 -3
- package/dist/Sdk/NewsroomThemes/NewsroomThemes.js +0 -111
- package/dist/Sdk/NewsroomThemes/index.d.ts +0 -1
- package/dist/Sdk/NewsroomThemes/index.js +0 -9
- package/dist/Sdk/NewsroomWebhooks/NewsroomWebhooks.d.ts +0 -16
- package/dist/Sdk/NewsroomWebhooks/NewsroomWebhooks.js +0 -124
- package/dist/Sdk/NewsroomWebhooks/index.d.ts +0 -2
- package/dist/Sdk/NewsroomWebhooks/index.js +0 -9
- package/dist/Sdk/NewsroomWebhooks/types.d.ts +0 -15
- package/dist/Sdk/NewsroomWebhooks/types.js +0 -3
- package/dist/Sdk/Newsrooms/Newsrooms.d.ts +0 -21
- package/dist/Sdk/Newsrooms/Newsrooms.js +0 -184
- package/dist/Sdk/Newsrooms/index.d.ts +0 -2
- package/dist/Sdk/Newsrooms/index.js +0 -9
- package/dist/Sdk/Newsrooms/types.js +0 -3
- package/dist/Sdk/Sdk.d.ts +0 -42
- package/dist/Sdk/Sdk.js +0 -59
- package/dist/Sdk/SenderAddresses/SenderAddresses.d.ts +0 -14
- package/dist/Sdk/SenderAddresses/SenderAddresses.js +0 -110
- package/dist/Sdk/SenderAddresses/index.d.ts +0 -2
- package/dist/Sdk/SenderAddresses/index.js +0 -9
- package/dist/Sdk/SenderAddresses/types.js +0 -3
- package/dist/Sdk/Snippets/Snippets.d.ts +0 -16
- package/dist/Sdk/Snippets/Snippets.js +0 -124
- package/dist/Sdk/Snippets/index.d.ts +0 -2
- package/dist/Sdk/Snippets/index.js +0 -9
- package/dist/Sdk/Snippets/types.js +0 -3
- package/dist/Sdk/Stories/Stories.d.ts +0 -19
- package/dist/Sdk/Stories/Stories.js +0 -129
- package/dist/Sdk/Stories/index.d.ts +0 -2
- package/dist/Sdk/Stories/index.js +0 -9
- package/dist/Sdk/Stories/types.js +0 -3
- package/dist/Sdk/Subscriptions/Subscriptions.js +0 -136
- package/dist/Sdk/Subscriptions/index.d.ts +0 -2
- package/dist/Sdk/Subscriptions/index.js +0 -9
- package/dist/Sdk/Subscriptions/types.js +0 -3
- package/dist/Sdk/constants.js +0 -8
- package/dist/Sdk/index.d.ts +0 -14
- package/dist/Sdk/index.js +0 -32
- package/dist/Sdk/routing.js +0 -31
- package/dist/Sdk/types.d.ts +0 -6
- package/dist/Sdk/types.js +0 -3
- package/dist/Sdk/utils.js +0 -40
- package/dist/types/ContactRef.d.ts +0 -12
- package/dist/types/ContactRef.js +0 -3
- package/dist/types/CountryRef.js +0 -3
- package/dist/types/Coverage.js +0 -24
- package/dist/types/CultureRef.d.ts +0 -12
- package/dist/types/CultureRef.js +0 -9
- package/dist/types/EmailBranding.d.ts +0 -8
- package/dist/types/EmailBranding.js +0 -3
- package/dist/types/EmailBrandingMode.d.ts +0 -4
- package/dist/types/EmailBrandingMode.js +0 -9
- package/dist/types/GalleryStatus.d.ts +0 -4
- package/dist/types/GalleryStatus.js +0 -9
- package/dist/types/LicenseStatus.d.ts +0 -9
- package/dist/types/LicenseStatus.js +0 -14
- package/dist/types/NewsroomDomainShareInstructions.d.ts +0 -4
- package/dist/types/NewsroomDomainShareInstructions.js +0 -3
- package/dist/types/NewsroomGalleryImage.d.ts +0 -8
- package/dist/types/NewsroomGalleryImage.js +0 -3
- package/dist/types/NewsroomThemePreset.d.ts +0 -36
- package/dist/types/NewsroomThemePreset.js +0 -3
- package/dist/types/ThemeFeature.d.ts +0 -12
- package/dist/types/ThemeFeature.js +0 -17
- package/dist/types/ThemeStatus.d.ts +0 -4
- package/dist/types/ThemeStatus.js +0 -9
- package/dist/types/TrackingPolicy.d.ts +0 -5
- package/dist/types/TrackingPolicy.js +0 -10
- package/dist/types/UnsubscribeReason.d.ts +0 -7
- package/dist/types/UnsubscribeReason.js +0 -12
- package/dist/types/UserRef.js +0 -3
- package/dist/types/scopes/AllContactsScope.d.ts +0 -6
- package/dist/types/scopes/AllContactsScope.js +0 -3
- package/dist/types/scopes/CampaignRecipientsScope.d.ts +0 -8
- package/dist/types/scopes/CampaignRecipientsScope.js +0 -3
- package/dist/types/scopes/CampaignReportScope.d.ts +0 -9
- package/dist/types/scopes/CampaignReportScope.js +0 -3
- package/dist/types/scopes/ContactEmployeesScope.d.ts +0 -7
- package/dist/types/scopes/ContactEmployeesScope.js +0 -3
- package/dist/types/scopes/ContactOrganisationsScope.d.ts +0 -7
- package/dist/types/scopes/ContactOrganisationsScope.js +0 -3
- package/dist/types/scopes/ContactsScope.d.ts +0 -6
- package/dist/types/scopes/ContactsScope.js +0 -3
- package/dist/types/scopes/index.d.ts +0 -6
- package/dist/types/scopes/index.js +0 -19
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { UploadedImage } from '@prezly/uploads';
|
|
2
|
-
import { Contact,
|
|
1
|
+
import type { UploadedImage } from '@prezly/uploads';
|
|
2
|
+
import type { Contact, Utm } from '../../types';
|
|
3
3
|
interface Person {
|
|
4
|
-
contact_type:
|
|
4
|
+
contact_type: Contact.Type.PERSON;
|
|
5
5
|
first_name?: Contact['first_name'];
|
|
6
6
|
last_name?: Contact['last_name'];
|
|
7
7
|
gender?: Contact['gender'];
|
|
@@ -9,17 +9,17 @@ interface Person {
|
|
|
9
9
|
organisations?: string[];
|
|
10
10
|
}
|
|
11
11
|
interface Organisation {
|
|
12
|
-
contact_type:
|
|
12
|
+
contact_type: Contact.Type.ORGANISATION;
|
|
13
13
|
company_name: Contact['company_name'];
|
|
14
14
|
}
|
|
15
|
-
export interface SubscribeRequest<Type extends
|
|
15
|
+
export interface SubscribeRequest<Type extends Contact.Type> {
|
|
16
16
|
email_address: string;
|
|
17
17
|
locale?: string;
|
|
18
18
|
url?: string;
|
|
19
19
|
visitor_uid?: string;
|
|
20
20
|
session_uid?: string;
|
|
21
21
|
comment?: string;
|
|
22
|
-
contact?: (Type extends
|
|
22
|
+
contact?: (Type extends Contact.Type.PERSON ? Person : Organisation) & {
|
|
23
23
|
avatar_image?: UploadedImage | null;
|
|
24
24
|
languages?: string[];
|
|
25
25
|
emails?: Contact['emails'];
|
|
@@ -33,6 +33,13 @@ export interface SubscribeRequest<Type extends ContactType> {
|
|
|
33
33
|
address?: Partial<Contact['address']>;
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
+
export declare enum UnsubscribeReason {
|
|
37
|
+
UNKNOWN = "unknown",
|
|
38
|
+
UNWANTED = "unwanted",
|
|
39
|
+
SPAM = "spam",
|
|
40
|
+
NEVER_SIGNED_UP = "never_signed_up",
|
|
41
|
+
OTHER = "other"
|
|
42
|
+
}
|
|
36
43
|
export interface UnsubscribeRequest {
|
|
37
44
|
/**
|
|
38
45
|
* Either utm.utm_id or email_address must be provided
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export let UnsubscribeReason;
|
|
2
|
+
(function (UnsubscribeReason) {
|
|
3
|
+
UnsubscribeReason["UNKNOWN"] = "unknown";
|
|
4
|
+
UnsubscribeReason["UNWANTED"] = "unwanted";
|
|
5
|
+
UnsubscribeReason["SPAM"] = "spam";
|
|
6
|
+
UnsubscribeReason["NEVER_SIGNED_UP"] = "never_signed_up";
|
|
7
|
+
UnsubscribeReason["OTHER"] = "other";
|
|
8
|
+
})(UnsubscribeReason || (UnsubscribeReason = {}));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * as Accounts from './Accounts';
|
|
2
|
+
export * as CampaignRecipients from './CampaignRecipients';
|
|
3
|
+
export * as Campaigns from './Campaigns';
|
|
4
|
+
export * as Coverage from './Coverage';
|
|
5
|
+
export * as Jobs from './Jobs';
|
|
6
|
+
export * as Licenses from './Licenses';
|
|
7
|
+
export * as NewsroomCategories from './NewsroomCategories';
|
|
8
|
+
export * as NewsroomContacts from './NewsroomContacts';
|
|
9
|
+
export * as NewsroomDomains from './NewsroomDomains';
|
|
10
|
+
export * as NewsroomGalleries from './NewsroomGalleries';
|
|
11
|
+
export * as NewsroomLanguages from './NewsroomLanguages';
|
|
12
|
+
export * as NewsroomPrivacyRequests from './NewsroomPrivacyRequests';
|
|
13
|
+
export * as Newsrooms from './Newsrooms';
|
|
14
|
+
export * as NewsroomSubscriptions from './NewsroomSubscriptions';
|
|
15
|
+
export * as NewsroomThemes from './NewsroomThemes';
|
|
16
|
+
export * as NewsroomWebhooks from './NewsroomWebhooks';
|
|
17
|
+
export * as SenderAddresses from './SenderAddresses';
|
|
18
|
+
export * as Snippets from './Snippets';
|
|
19
|
+
export * as Stories from './Stories';
|
|
20
|
+
export * as Subscriptions from './Subscriptions';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * as Accounts from "./Accounts/index.js";
|
|
2
|
+
export * as CampaignRecipients from "./CampaignRecipients/index.js";
|
|
3
|
+
export * as Campaigns from "./Campaigns/index.js";
|
|
4
|
+
export * as Coverage from "./Coverage/index.js";
|
|
5
|
+
export * as Jobs from "./Jobs/index.js";
|
|
6
|
+
export * as Licenses from "./Licenses/index.js";
|
|
7
|
+
export * as NewsroomCategories from "./NewsroomCategories/index.js";
|
|
8
|
+
export * as NewsroomContacts from "./NewsroomContacts/index.js";
|
|
9
|
+
export * as NewsroomDomains from "./NewsroomDomains/index.js";
|
|
10
|
+
export * as NewsroomGalleries from "./NewsroomGalleries/index.js";
|
|
11
|
+
export * as NewsroomLanguages from "./NewsroomLanguages/index.js";
|
|
12
|
+
export * as NewsroomPrivacyRequests from "./NewsroomPrivacyRequests/index.js";
|
|
13
|
+
export * as Newsrooms from "./Newsrooms/index.js";
|
|
14
|
+
export * as NewsroomSubscriptions from "./NewsroomSubscriptions/index.js";
|
|
15
|
+
export * as NewsroomThemes from "./NewsroomThemes/index.js";
|
|
16
|
+
export * as NewsroomWebhooks from "./NewsroomWebhooks/index.js";
|
|
17
|
+
export * as SenderAddresses from "./SenderAddresses/index.js";
|
|
18
|
+
export * as Snippets from "./Snippets/index.js";
|
|
19
|
+
export * as Stories from "./Stories/index.js";
|
|
20
|
+
export * as Subscriptions from "./Subscriptions/index.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ApiErrorPayload, HeadersMap, ApiResponse } from './types';
|
|
2
|
-
export
|
|
1
|
+
import type { ApiErrorPayload, HeadersMap, ApiResponse } from './types';
|
|
2
|
+
export declare class ApiError<P = ApiErrorPayload> extends Error implements ApiResponse<P> {
|
|
3
3
|
payload: P;
|
|
4
4
|
status: number;
|
|
5
5
|
statusText: string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export class ApiError extends Error {
|
|
2
|
+
constructor({
|
|
3
|
+
payload,
|
|
4
|
+
status = 0,
|
|
5
|
+
statusText = 'Unspecified error',
|
|
6
|
+
headers = {}
|
|
7
|
+
}) {
|
|
8
|
+
super(`API Error (${status}): ${statusText}`);
|
|
9
|
+
this.payload = payload;
|
|
10
|
+
this.status = status;
|
|
11
|
+
this.statusText = statusText;
|
|
12
|
+
this.headers = headers;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ApiResponse, Params, ParamsWithPayload } from './types';
|
|
2
|
+
export declare const Http: {
|
|
3
|
+
get<V = any>(url: string, { headers, query }?: Params): Promise<ApiResponse<V>>;
|
|
4
|
+
post<V_1 = any>(url: string, { headers, payload, query }?: ParamsWithPayload): Promise<ApiResponse<V_1>>;
|
|
5
|
+
put<V_2 = any>(url: string, { headers, payload, query }?: ParamsWithPayload): Promise<ApiResponse<V_2>>;
|
|
6
|
+
patch<V_3 = any>(url: string, { headers, payload, query }?: ParamsWithPayload): Promise<ApiResponse<V_3>>;
|
|
7
|
+
delete<V_4 = any>(url: string, { headers, payload, query }?: ParamsWithPayload): Promise<ApiResponse<V_4>>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { createRequest } from "./createRequest.js";
|
|
2
|
+
import { Method } from "./types.js";
|
|
3
|
+
export const Http = {
|
|
4
|
+
get(url, {
|
|
5
|
+
headers,
|
|
6
|
+
query
|
|
7
|
+
} = {}) {
|
|
8
|
+
return createRequest(url, {
|
|
9
|
+
headers,
|
|
10
|
+
method: Method.GET,
|
|
11
|
+
query
|
|
12
|
+
});
|
|
13
|
+
},
|
|
14
|
+
post(url, {
|
|
15
|
+
headers,
|
|
16
|
+
payload,
|
|
17
|
+
query
|
|
18
|
+
} = {}) {
|
|
19
|
+
return createRequest(url, {
|
|
20
|
+
headers,
|
|
21
|
+
method: Method.POST,
|
|
22
|
+
payload,
|
|
23
|
+
query
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
put(url, {
|
|
27
|
+
headers,
|
|
28
|
+
payload,
|
|
29
|
+
query
|
|
30
|
+
} = {}) {
|
|
31
|
+
return createRequest(url, {
|
|
32
|
+
headers,
|
|
33
|
+
method: Method.PUT,
|
|
34
|
+
payload,
|
|
35
|
+
query
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
patch(url, {
|
|
39
|
+
headers,
|
|
40
|
+
payload,
|
|
41
|
+
query
|
|
42
|
+
} = {}) {
|
|
43
|
+
return createRequest(url, {
|
|
44
|
+
headers,
|
|
45
|
+
method: Method.PATCH,
|
|
46
|
+
payload,
|
|
47
|
+
query
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
delete(url, {
|
|
51
|
+
headers,
|
|
52
|
+
payload,
|
|
53
|
+
query
|
|
54
|
+
} = {}) {
|
|
55
|
+
return createRequest(url, {
|
|
56
|
+
headers,
|
|
57
|
+
method: Method.DELETE,
|
|
58
|
+
payload,
|
|
59
|
+
query
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
};
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Method, HeadersMap, ApiResponse } from './types';
|
|
1
|
+
import type { Method, HeadersMap, ApiResponse } from './types';
|
|
2
2
|
export declare function createFakeErrorPayload({ status, statusText, }: {
|
|
3
3
|
status?: number;
|
|
4
4
|
statusText?: string;
|
|
@@ -13,7 +13,7 @@ export declare function createFakeErrorPayload({ status, statusText, }: {
|
|
|
13
13
|
}[];
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
|
-
export
|
|
16
|
+
export declare function createRequest<P = any>(url: string, { headers, method, payload, query, }: {
|
|
17
17
|
headers?: HeadersMap;
|
|
18
18
|
method: Method;
|
|
19
19
|
payload?: object;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { ApiError } from "./ApiError.js";
|
|
2
|
+
import { CONTENT_TYPE, INVALID_URL_ERROR_MESSAGE, NETWORK_PROBLEM_ERROR_MESSAGE } from "./constants.js";
|
|
3
|
+
import { createUrlWithQuery } from "./lib.js";
|
|
4
|
+
import { HttpCodes } from "./types.js";
|
|
5
|
+
function extractHeaders(headers) {
|
|
6
|
+
const result = {};
|
|
7
|
+
headers.forEach((value, key) => {
|
|
8
|
+
result[key] = value;
|
|
9
|
+
});
|
|
10
|
+
return result;
|
|
11
|
+
}
|
|
12
|
+
function extractResponse(response) {
|
|
13
|
+
return {
|
|
14
|
+
status: response.status,
|
|
15
|
+
statusText: response.statusText,
|
|
16
|
+
headers: extractHeaders(response.headers)
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export function createFakeErrorPayload({
|
|
20
|
+
status,
|
|
21
|
+
statusText
|
|
22
|
+
}) {
|
|
23
|
+
return {
|
|
24
|
+
status: 'error',
|
|
25
|
+
code: status,
|
|
26
|
+
message: `Something went wrong: ${[status, statusText].filter(Boolean).join(' ')}`,
|
|
27
|
+
errors: {
|
|
28
|
+
':global': [{
|
|
29
|
+
code: status,
|
|
30
|
+
message: statusText
|
|
31
|
+
}]
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export async function createRequest(url, {
|
|
36
|
+
headers,
|
|
37
|
+
method,
|
|
38
|
+
payload,
|
|
39
|
+
query
|
|
40
|
+
}) {
|
|
41
|
+
try {
|
|
42
|
+
const urlWithQuery = createUrlWithQuery(url, query);
|
|
43
|
+
const response = await fetch(urlWithQuery.href, {
|
|
44
|
+
method,
|
|
45
|
+
headers: {
|
|
46
|
+
Accept: 'application/json',
|
|
47
|
+
'Content-Type': CONTENT_TYPE,
|
|
48
|
+
...headers
|
|
49
|
+
},
|
|
50
|
+
body: payload ? JSON.stringify(payload) : undefined
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// Fetch correctly throws an error in browser environment,
|
|
54
|
+
// but when running in test environment (Jest), it fails silently
|
|
55
|
+
// and 'response' becomes undefined, hence this extra condition.
|
|
56
|
+
if (!response) {
|
|
57
|
+
throw new Error(INVALID_URL_ERROR_MESSAGE);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Response code is not between 200 - 299
|
|
61
|
+
if (!response.ok) {
|
|
62
|
+
// Try to parse the response as JSON, if it contains any error messages
|
|
63
|
+
// from backend. If not, fake the error message.
|
|
64
|
+
let responsePayload;
|
|
65
|
+
try {
|
|
66
|
+
responsePayload = await response.json();
|
|
67
|
+
} catch (error) {
|
|
68
|
+
responsePayload = createFakeErrorPayload(response);
|
|
69
|
+
}
|
|
70
|
+
throw new ApiError({
|
|
71
|
+
payload: responsePayload,
|
|
72
|
+
...extractResponse(response)
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
const responsePayload = response.status === HttpCodes.NO_CONTENT ? undefined : await response.json();
|
|
76
|
+
return {
|
|
77
|
+
payload: responsePayload,
|
|
78
|
+
...extractResponse(response)
|
|
79
|
+
};
|
|
80
|
+
} catch (error) {
|
|
81
|
+
// Fetch throws an error, if there is a connection problem (eg. network is down).
|
|
82
|
+
// We do not have access to response, so we need to fake the error payload.
|
|
83
|
+
// Since we also throw when response is not ok, re-throw the response data if available.
|
|
84
|
+
const {
|
|
85
|
+
status,
|
|
86
|
+
statusText = error.message || NETWORK_PROBLEM_ERROR_MESSAGE,
|
|
87
|
+
payload: errorPayload
|
|
88
|
+
} = error;
|
|
89
|
+
throw new ApiError({
|
|
90
|
+
payload: errorPayload || createFakeErrorPayload({
|
|
91
|
+
status,
|
|
92
|
+
statusText
|
|
93
|
+
}),
|
|
94
|
+
status,
|
|
95
|
+
statusText,
|
|
96
|
+
headers: error.headers || {}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
package/dist/http/lib.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import queryString from 'query-string';
|
|
2
|
+
import * as nodeUrl from 'url';
|
|
3
|
+
const URL = typeof window === 'undefined' ? nodeUrl.URL : window.URL;
|
|
4
|
+
function parseUrlParams(query) {
|
|
5
|
+
return queryString.parse(query, {
|
|
6
|
+
arrayFormat: 'bracket'
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
function stringifyUrlParams(params) {
|
|
10
|
+
return queryString.stringify(params, {
|
|
11
|
+
arrayFormat: 'bracket'
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export function createUrlWithQuery(url = '', query) {
|
|
15
|
+
const urlWithQuery = new URL(url);
|
|
16
|
+
if (typeof query === 'object' && query !== null) {
|
|
17
|
+
urlWithQuery.search = stringifyUrlParams({
|
|
18
|
+
...parseUrlParams(urlWithQuery.search),
|
|
19
|
+
...query
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return urlWithQuery;
|
|
23
|
+
}
|
|
24
|
+
function isObject(value) {
|
|
25
|
+
return value !== null && typeof value === 'object';
|
|
26
|
+
}
|
|
27
|
+
export function isDeferredJobResponse(value) {
|
|
28
|
+
return isObject(value) && typeof value.status === 'string' && isObject(value.progress) && typeof value.progress.id === 'string' && Array.isArray(value.progress.links) && value.progress.links.every(link => typeof link === 'string');
|
|
29
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export let HttpCodes;
|
|
2
|
+
(function (HttpCodes) {
|
|
3
|
+
HttpCodes[HttpCodes["ACCEPTED"] = 202] = "ACCEPTED";
|
|
4
|
+
HttpCodes[HttpCodes["NO_CONTENT"] = 204] = "NO_CONTENT";
|
|
5
|
+
HttpCodes[HttpCodes["NOT_FOUND"] = 404] = "NOT_FOUND";
|
|
6
|
+
HttpCodes[HttpCodes["GONE"] = 410] = "GONE";
|
|
7
|
+
HttpCodes[HttpCodes["PRECONDITION_FAILED"] = 412] = "PRECONDITION_FAILED";
|
|
8
|
+
})(HttpCodes || (HttpCodes = {}));
|
|
9
|
+
export let Method;
|
|
10
|
+
(function (Method) {
|
|
11
|
+
Method["DELETE"] = "DELETE";
|
|
12
|
+
Method["GET"] = "GET";
|
|
13
|
+
Method["PATCH"] = "PATCH";
|
|
14
|
+
Method["POST"] = "POST";
|
|
15
|
+
Method["PUT"] = "PUT";
|
|
16
|
+
})(Method || (Method = {}));
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from '@prezly/uploads';
|
|
2
|
-
export {
|
|
3
|
-
export
|
|
2
|
+
export { type Client as PrezlyClient, createClient as createPrezlyClient } from './Client';
|
|
3
|
+
export type { HeadersMap } from './http';
|
|
4
|
+
export * from './endpoints';
|
|
4
5
|
export * from './types';
|
package/dist/index.js
CHANGED
|
@@ -1,22 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
|
-
};
|
|
15
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.default = void 0;
|
|
17
|
-
__exportStar(require("@prezly/uploads"), exports);
|
|
18
|
-
var Sdk_1 = require("./Sdk");
|
|
19
|
-
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(Sdk_1).default; } });
|
|
20
|
-
__exportStar(require("./Sdk"), exports);
|
|
21
|
-
__exportStar(require("./types"), exports);
|
|
22
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLGtEQUFnQztBQUVoQyw2QkFBZ0M7QUFBdkIsK0dBQUEsT0FBTyxPQUFBO0FBQ2hCLHdDQUFzQjtBQUN0QiwwQ0FBd0IiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICdAcHJlemx5L3VwbG9hZHMnO1xuXG5leHBvcnQgeyBkZWZhdWx0IH0gZnJvbSAnLi9TZGsnO1xuZXhwb3J0ICogZnJvbSAnLi9TZGsnO1xuZXhwb3J0ICogZnJvbSAnLi90eXBlcyc7XG4iXX0=
|
|
1
|
+
export * from '@prezly/uploads';
|
|
2
|
+
export { createClient as createPrezlyClient } from "./Client.js";
|
|
3
|
+
export * from "./endpoints/index.js";
|
|
4
|
+
export * from "./types/index.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const routing: {
|
|
1
|
+
export declare const routing: {
|
|
2
2
|
accounts: string;
|
|
3
3
|
campaignsUrl: string;
|
|
4
4
|
campaignRecipientsUrl: string;
|
|
@@ -25,4 +25,3 @@ declare const routing: {
|
|
|
25
25
|
storyCoverageUrl: string;
|
|
26
26
|
snippetsUrl: string;
|
|
27
27
|
};
|
|
28
|
-
export default routing;
|
package/dist/routing.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const routing = {
|
|
2
|
+
accounts: '/v2/accounts',
|
|
3
|
+
campaignsUrl: '/v2/campaigns',
|
|
4
|
+
campaignRecipientsUrl: '/v2/campaigns/:campaign_id/recipients',
|
|
5
|
+
coverageUrl: '/v2/coverage',
|
|
6
|
+
jobsUrl: '/v2/jobs',
|
|
7
|
+
licenseUrl: '/v2/licenses',
|
|
8
|
+
licenseUnsubscribeUrl: '/v2/unsubscribe',
|
|
9
|
+
newsroomsUrl: '/v2/newsrooms',
|
|
10
|
+
newsroomCategoriesUrl: '/v2/newsrooms/:newsroom_id/categories',
|
|
11
|
+
newsroomContactsUrl: '/v2/newsrooms/:newsroom_id/contacts',
|
|
12
|
+
newsroomLanguagesUrl: '/v2/newsrooms/:newsroom_id/languages',
|
|
13
|
+
/** @deprecated Please use newsroomSubscribeUrl instead */
|
|
14
|
+
newsroomSubscriptionsUrl: '/v2/newsrooms/:newsroom_id/subscriptions',
|
|
15
|
+
newsroomSubscribeUrl: '/v2/newsrooms/:newsroom_id/subscribe',
|
|
16
|
+
newsroomUnsubscribeUrl: '/v2/newsrooms/:newsroom_id/unsubscribe',
|
|
17
|
+
newsroomThemesUrl: '/v2/newsrooms/:newsroom_id/themes',
|
|
18
|
+
newsroomWebhooksUrl: '/v2/newsrooms/:newsroom_id/webhooks',
|
|
19
|
+
newsroomPrivacyRequestsUrl: '/v2/newsrooms/:newsroom_id/privacy-requests',
|
|
20
|
+
newsroomDomainsUrl: '/v2/newsrooms/:newsroom_id/domains',
|
|
21
|
+
newsroomGalleriesUrl: '/v2/newsrooms/:newsroom_id/galleries',
|
|
22
|
+
senderAddressesUrl: '/v2/sender-addresses',
|
|
23
|
+
storiesUrl: '/v2/stories',
|
|
24
|
+
storiesSearchUrl: '/v2/stories/search',
|
|
25
|
+
storyCoverageUrl: '/v1/stories/:story_id/reports/coverage',
|
|
26
|
+
snippetsUrl: '/v2/snippets'
|
|
27
|
+
};
|
package/dist/types/Campaign.d.ts
CHANGED
|
@@ -1,33 +1,12 @@
|
|
|
1
|
-
import { NewsroomRef } from './Newsroom';
|
|
2
|
-
import { SenderAddress } from './SenderAddress';
|
|
3
|
-
import {
|
|
4
|
-
import { StoryRef } from './Story';
|
|
5
|
-
import { UserRef } from './
|
|
6
|
-
export declare enum CampaignLifecycleStatus {
|
|
7
|
-
DRAFT = "draft",
|
|
8
|
-
SCHEDULED = "scheduled",
|
|
9
|
-
PENDING = "pending",
|
|
10
|
-
SENT = "sent"
|
|
11
|
-
}
|
|
12
|
-
export declare enum StoryAlignment {
|
|
13
|
-
CENTER = "center",
|
|
14
|
-
LEFT = "left",
|
|
15
|
-
RIGHT = "right"
|
|
16
|
-
}
|
|
17
|
-
export declare enum StoryAppearance {
|
|
18
|
-
INTRO = "intro",
|
|
19
|
-
FULL = "full"
|
|
20
|
-
}
|
|
21
|
-
export declare enum SenderDomainVerificationStatus {
|
|
22
|
-
UNKNOWN = "unknown",
|
|
23
|
-
VALID = "valid",
|
|
24
|
-
INVALID = "invalid",
|
|
25
|
-
NOT_APPLICABLE = "not-applicable"
|
|
26
|
-
}
|
|
1
|
+
import type { NewsroomRef } from './Newsroom';
|
|
2
|
+
import type { SenderAddress } from './SenderAddress';
|
|
3
|
+
import type { SenderDomain } from './SenderDomain';
|
|
4
|
+
import type { StoryRef } from './Story';
|
|
5
|
+
import type { UserRef } from './User';
|
|
27
6
|
export interface Campaign {
|
|
28
7
|
id: number;
|
|
29
8
|
author: UserRef;
|
|
30
|
-
lifecycle_status:
|
|
9
|
+
lifecycle_status: Campaign.LifecycleStatus;
|
|
31
10
|
subject: string;
|
|
32
11
|
/**
|
|
33
12
|
* JSON-serialized document in Prezly Content Format
|
|
@@ -37,11 +16,11 @@ export interface Campaign {
|
|
|
37
16
|
thumbnail_url: string;
|
|
38
17
|
story: StoryRef | null;
|
|
39
18
|
newsroom: NewsroomRef | null;
|
|
40
|
-
story_alignment: StoryAlignment;
|
|
41
|
-
story_appearance: StoryAppearance;
|
|
19
|
+
story_alignment: Campaign.StoryAlignment;
|
|
20
|
+
story_appearance: Campaign.StoryAppearance;
|
|
42
21
|
sender: SenderAddress | null;
|
|
43
|
-
sender_domain_verification_flow:
|
|
44
|
-
sender_domain_verification_status: SenderDomainVerificationStatus;
|
|
22
|
+
sender_domain_verification_flow: SenderDomain.VerificationFlowVersion | null;
|
|
23
|
+
sender_domain_verification_status: Campaign.SenderDomainVerificationStatus;
|
|
45
24
|
created_at: string;
|
|
46
25
|
updated_at: string;
|
|
47
26
|
scheduled_at: string | null;
|
|
@@ -60,3 +39,26 @@ export interface Campaign {
|
|
|
60
39
|
unsubscribes_rate: number;
|
|
61
40
|
};
|
|
62
41
|
}
|
|
42
|
+
export declare namespace Campaign {
|
|
43
|
+
enum LifecycleStatus {
|
|
44
|
+
DRAFT = "draft",
|
|
45
|
+
SCHEDULED = "scheduled",
|
|
46
|
+
PENDING = "pending",
|
|
47
|
+
SENT = "sent"
|
|
48
|
+
}
|
|
49
|
+
enum StoryAlignment {
|
|
50
|
+
CENTER = "center",
|
|
51
|
+
LEFT = "left",
|
|
52
|
+
RIGHT = "right"
|
|
53
|
+
}
|
|
54
|
+
enum StoryAppearance {
|
|
55
|
+
INTRO = "intro",
|
|
56
|
+
FULL = "full"
|
|
57
|
+
}
|
|
58
|
+
enum SenderDomainVerificationStatus {
|
|
59
|
+
UNKNOWN = "unknown",
|
|
60
|
+
VALID = "valid",
|
|
61
|
+
INVALID = "invalid",
|
|
62
|
+
NOT_APPLICABLE = "not-applicable"
|
|
63
|
+
}
|
|
64
|
+
}
|
package/dist/types/Campaign.js
CHANGED
|
@@ -1,29 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
(function (StoryAlignment) {
|
|
1
|
+
export let Campaign;
|
|
2
|
+
(function (_Campaign) {
|
|
3
|
+
let LifecycleStatus;
|
|
4
|
+
(function (LifecycleStatus) {
|
|
5
|
+
LifecycleStatus["DRAFT"] = "draft";
|
|
6
|
+
LifecycleStatus["SCHEDULED"] = "scheduled";
|
|
7
|
+
LifecycleStatus["PENDING"] = "pending";
|
|
8
|
+
LifecycleStatus["SENT"] = "sent";
|
|
9
|
+
})(LifecycleStatus || (LifecycleStatus = {}));
|
|
10
|
+
_Campaign.LifecycleStatus = LifecycleStatus;
|
|
11
|
+
let StoryAlignment;
|
|
12
|
+
(function (StoryAlignment) {
|
|
13
13
|
StoryAlignment["CENTER"] = "center";
|
|
14
14
|
StoryAlignment["LEFT"] = "left";
|
|
15
15
|
StoryAlignment["RIGHT"] = "right";
|
|
16
|
-
})(StoryAlignment
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
})(StoryAlignment || (StoryAlignment = {}));
|
|
17
|
+
_Campaign.StoryAlignment = StoryAlignment;
|
|
18
|
+
let StoryAppearance;
|
|
19
|
+
(function (StoryAppearance) {
|
|
19
20
|
StoryAppearance["INTRO"] = "intro";
|
|
20
21
|
StoryAppearance["FULL"] = "full";
|
|
21
|
-
})(StoryAppearance
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
})(StoryAppearance || (StoryAppearance = {}));
|
|
23
|
+
_Campaign.StoryAppearance = StoryAppearance;
|
|
24
|
+
let SenderDomainVerificationStatus;
|
|
25
|
+
(function (SenderDomainVerificationStatus) {
|
|
24
26
|
SenderDomainVerificationStatus["UNKNOWN"] = "unknown";
|
|
25
27
|
SenderDomainVerificationStatus["VALID"] = "valid";
|
|
26
28
|
SenderDomainVerificationStatus["INVALID"] = "invalid";
|
|
27
29
|
SenderDomainVerificationStatus["NOT_APPLICABLE"] = "not-applicable";
|
|
28
|
-
})(SenderDomainVerificationStatus
|
|
29
|
-
|
|
30
|
+
})(SenderDomainVerificationStatus || (SenderDomainVerificationStatus = {}));
|
|
31
|
+
_Campaign.SenderDomainVerificationStatus = SenderDomainVerificationStatus;
|
|
32
|
+
})(Campaign || (Campaign = {}));
|
package/dist/types/Category.d.ts
CHANGED
package/dist/types/Category.js
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ2F0ZWdvcnkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdHlwZXMvQ2F0ZWdvcnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEN1bHR1cmVSZWYgfSBmcm9tICcuL0N1bHR1cmVSZWYnO1xuXG5leHBvcnQgaW50ZXJmYWNlIENhdGVnb3J5IHtcbiAgICBkaXNwbGF5X2Rlc2NyaXB0aW9uOiBzdHJpbmcgfCBudWxsO1xuICAgIGRpc3BsYXlfbmFtZTogc3RyaW5nO1xuICAgIGkxOG46IHtcbiAgICAgICAgW2xvY2FsZUNvZGU6IHN0cmluZ106IHtcbiAgICAgICAgICAgIGRlc2NyaXB0aW9uOiBzdHJpbmcgfCBudWxsO1xuICAgICAgICAgICAgbG9jYWxlOiBDdWx0dXJlUmVmO1xuICAgICAgICAgICAgbmFtZTogc3RyaW5nO1xuICAgICAgICAgICAgc2x1Zzogc3RyaW5nIHwgbnVsbDtcbiAgICAgICAgfTtcbiAgICB9O1xuICAgIGlkOiBudW1iZXI7XG4gICAgc3Rvcmllc19udW1iZXI6IG51bWJlcjtcbn1cbiJdfQ==
|
|
1
|
+
export {};
|