@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
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { NewsroomWebhook } from '../../types';
|
|
2
|
+
export interface CreateRequest {
|
|
3
|
+
name: string;
|
|
4
|
+
url: string;
|
|
5
|
+
events?: NewsroomWebhook.Event[];
|
|
6
|
+
secret?: string | null;
|
|
7
|
+
is_active?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface UpdateRequest {
|
|
10
|
+
name?: string;
|
|
11
|
+
url?: string;
|
|
12
|
+
events?: NewsroomWebhook.Event[];
|
|
13
|
+
secret?: string | null;
|
|
14
|
+
is_active?: boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DeferredJobsApiClient } from '../../api';
|
|
2
|
+
import type { Newsroom } from '../../types';
|
|
3
|
+
import type { CreateRequest, ListOptions, ListResponse, SearchOptions, UpdateRequest } from './types';
|
|
4
|
+
declare type NewsroomId = Newsroom['uuid'] | Newsroom['id'];
|
|
5
|
+
export declare class Client {
|
|
6
|
+
private readonly apiClient;
|
|
7
|
+
constructor(apiClient: DeferredJobsApiClient);
|
|
8
|
+
list({ limit, offset, search, sortOrder }?: ListOptions): Promise<ListResponse>;
|
|
9
|
+
search(options?: SearchOptions): Promise<ListResponse>;
|
|
10
|
+
get(id: NewsroomId): Promise<Newsroom>;
|
|
11
|
+
create(payload: CreateRequest): Promise<Newsroom>;
|
|
12
|
+
update(id: NewsroomId, payload: UpdateRequest): Promise<Newsroom>;
|
|
13
|
+
archive(id: NewsroomId): Promise<Newsroom>;
|
|
14
|
+
unarchive(id: NewsroomId): Promise<Newsroom>;
|
|
15
|
+
remove(id: NewsroomId): Promise<void>;
|
|
16
|
+
takeOffline(id: NewsroomId): Promise<Newsroom>;
|
|
17
|
+
takeOnline(id: NewsroomId): Promise<Newsroom>;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { routing } from "../../routing.js";
|
|
2
|
+
import { Query } from "../../types/index.js";
|
|
3
|
+
export class Client {
|
|
4
|
+
constructor(apiClient) {
|
|
5
|
+
this.apiClient = apiClient;
|
|
6
|
+
}
|
|
7
|
+
async list({
|
|
8
|
+
limit,
|
|
9
|
+
offset,
|
|
10
|
+
search,
|
|
11
|
+
sortOrder
|
|
12
|
+
} = {}) {
|
|
13
|
+
return this.apiClient.get(routing.newsroomsUrl, {
|
|
14
|
+
query: {
|
|
15
|
+
limit,
|
|
16
|
+
offset,
|
|
17
|
+
search,
|
|
18
|
+
sort: sortOrder
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
async search(options = {}) {
|
|
23
|
+
const {
|
|
24
|
+
query,
|
|
25
|
+
limit,
|
|
26
|
+
offset,
|
|
27
|
+
search,
|
|
28
|
+
sortOrder
|
|
29
|
+
} = options;
|
|
30
|
+
// TODO: Introduce dedicated Search POST API
|
|
31
|
+
return this.apiClient.get(routing.newsroomsUrl, {
|
|
32
|
+
query: {
|
|
33
|
+
query: Query.stringify(query),
|
|
34
|
+
limit,
|
|
35
|
+
offset,
|
|
36
|
+
search,
|
|
37
|
+
sort: sortOrder
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
async get(id) {
|
|
42
|
+
const {
|
|
43
|
+
newsroom
|
|
44
|
+
} = await this.apiClient.get(`${routing.newsroomsUrl}/${id}`);
|
|
45
|
+
return newsroom;
|
|
46
|
+
}
|
|
47
|
+
async create(payload) {
|
|
48
|
+
const {
|
|
49
|
+
newsroom
|
|
50
|
+
} = await this.apiClient.post(routing.newsroomsUrl, {
|
|
51
|
+
payload
|
|
52
|
+
});
|
|
53
|
+
return newsroom;
|
|
54
|
+
}
|
|
55
|
+
async update(id, payload) {
|
|
56
|
+
const {
|
|
57
|
+
newsroom
|
|
58
|
+
} = await this.apiClient.patch(`${routing.newsroomsUrl}/${id}`, {
|
|
59
|
+
payload
|
|
60
|
+
});
|
|
61
|
+
return newsroom;
|
|
62
|
+
}
|
|
63
|
+
async archive(id) {
|
|
64
|
+
const {
|
|
65
|
+
newsroom
|
|
66
|
+
} = await this.apiClient.post(`${routing.newsroomsUrl}/${id}/archive`);
|
|
67
|
+
return newsroom;
|
|
68
|
+
}
|
|
69
|
+
async unarchive(id) {
|
|
70
|
+
const {
|
|
71
|
+
newsroom
|
|
72
|
+
} = await this.apiClient.post(`${routing.newsroomsUrl}/${id}/unarchive`);
|
|
73
|
+
return newsroom;
|
|
74
|
+
}
|
|
75
|
+
async remove(id) {
|
|
76
|
+
return this.apiClient.delete(`${routing.newsroomsUrl}/${id}`);
|
|
77
|
+
}
|
|
78
|
+
async takeOffline(id) {
|
|
79
|
+
const {
|
|
80
|
+
newsroom
|
|
81
|
+
} = await this.apiClient.post(`${routing.newsroomsUrl}/${id}/offline`);
|
|
82
|
+
return newsroom;
|
|
83
|
+
}
|
|
84
|
+
async takeOnline(id) {
|
|
85
|
+
const {
|
|
86
|
+
newsroom
|
|
87
|
+
} = await this.apiClient.post(`${routing.newsroomsUrl}/${id}/online`);
|
|
88
|
+
return newsroom;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CultureRef,
|
|
2
|
-
export interface
|
|
1
|
+
import type { CultureRef, Newsroom, Pagination, Query } from '../../types';
|
|
2
|
+
export interface ListOptions {
|
|
3
3
|
limit?: number;
|
|
4
4
|
offset?: number;
|
|
5
5
|
/**
|
|
@@ -8,18 +8,18 @@ export interface NewsroomListRequest {
|
|
|
8
8
|
search?: string;
|
|
9
9
|
sortOrder?: string;
|
|
10
10
|
}
|
|
11
|
-
export interface
|
|
11
|
+
export interface SearchOptions extends ListOptions {
|
|
12
12
|
/**
|
|
13
13
|
* Filter query using Prezly JSON Query Language
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
query?: Query;
|
|
16
16
|
}
|
|
17
|
-
export interface
|
|
17
|
+
export interface ListResponse {
|
|
18
18
|
newsrooms: Newsroom[];
|
|
19
19
|
pagination: Pagination;
|
|
20
20
|
sort: string;
|
|
21
21
|
}
|
|
22
|
-
export interface
|
|
22
|
+
export interface CreateRequest {
|
|
23
23
|
name: string;
|
|
24
24
|
/**
|
|
25
25
|
* Subdomain to be used for the newsroom.
|
|
@@ -40,9 +40,9 @@ export interface NewsroomCreateRequest {
|
|
|
40
40
|
* Theme ID or codename
|
|
41
41
|
*/
|
|
42
42
|
active_theme?: string;
|
|
43
|
-
status?:
|
|
43
|
+
status?: Newsroom.Status.ACTIVE | Newsroom.Status.INACTIVE;
|
|
44
44
|
}
|
|
45
|
-
export interface
|
|
45
|
+
export interface UpdateRequest {
|
|
46
46
|
name?: string;
|
|
47
47
|
/**
|
|
48
48
|
* Subdomain to be used for the newsroom.
|
|
@@ -79,8 +79,8 @@ export interface NewsroomUpdateRequest {
|
|
|
79
79
|
* Timezone name in the ICANN tz database.
|
|
80
80
|
*/
|
|
81
81
|
timezone?: string;
|
|
82
|
-
email_branding_mode?: EmailBrandingMode;
|
|
83
|
-
email_branding?: EmailBranding;
|
|
82
|
+
email_branding_mode?: Newsroom.EmailBrandingMode;
|
|
83
|
+
email_branding?: Newsroom.EmailBranding;
|
|
84
84
|
is_privacy_portal_enabled?: boolean;
|
|
85
85
|
/**
|
|
86
86
|
* Available only when license has
|
|
@@ -97,5 +97,5 @@ export interface NewsroomUpdateRequest {
|
|
|
97
97
|
* "subscription_form" feature flag
|
|
98
98
|
*/
|
|
99
99
|
is_subscription_form_enabled?: boolean;
|
|
100
|
-
status?:
|
|
100
|
+
status?: Newsroom.Status.ACTIVE | Newsroom.Status.INACTIVE;
|
|
101
101
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DeferredJobsApiClient } from '../../api';
|
|
2
|
+
import type { SenderAddress } from '../../types';
|
|
3
|
+
import type { CreateRequest, UpdateRequest } from './types';
|
|
4
|
+
export declare class Client {
|
|
5
|
+
private readonly apiClient;
|
|
6
|
+
constructor(apiClient: DeferredJobsApiClient);
|
|
7
|
+
list(): Promise<SenderAddress[]>;
|
|
8
|
+
create(payload: CreateRequest): Promise<SenderAddress>;
|
|
9
|
+
get(senderId: SenderAddress['id']): Promise<SenderAddress>;
|
|
10
|
+
update(senderId: SenderAddress['id'], payload: UpdateRequest): Promise<SenderAddress>;
|
|
11
|
+
remove(senderId: SenderAddress['id']): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { routing } from "../../routing.js";
|
|
2
|
+
export class Client {
|
|
3
|
+
constructor(apiClient) {
|
|
4
|
+
this.apiClient = apiClient;
|
|
5
|
+
}
|
|
6
|
+
async list() {
|
|
7
|
+
const {
|
|
8
|
+
senders
|
|
9
|
+
} = await this.apiClient.get(routing.senderAddressesUrl);
|
|
10
|
+
return senders;
|
|
11
|
+
}
|
|
12
|
+
async create(payload) {
|
|
13
|
+
const {
|
|
14
|
+
sender
|
|
15
|
+
} = await this.apiClient.post(routing.senderAddressesUrl, {
|
|
16
|
+
payload
|
|
17
|
+
});
|
|
18
|
+
return sender;
|
|
19
|
+
}
|
|
20
|
+
async get(senderId) {
|
|
21
|
+
const {
|
|
22
|
+
sender
|
|
23
|
+
} = await this.apiClient.get(`${routing.senderAddressesUrl}/${senderId}`);
|
|
24
|
+
return sender;
|
|
25
|
+
}
|
|
26
|
+
async update(senderId, payload) {
|
|
27
|
+
const {
|
|
28
|
+
sender
|
|
29
|
+
} = await this.apiClient.patch(`${routing.senderAddressesUrl}/${senderId}`, {
|
|
30
|
+
payload
|
|
31
|
+
});
|
|
32
|
+
return sender;
|
|
33
|
+
}
|
|
34
|
+
async remove(senderId) {
|
|
35
|
+
return this.apiClient.delete(`${routing.senderAddressesUrl}/${senderId}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface CreateRequest {
|
|
2
2
|
sender_name: string;
|
|
3
3
|
sender_email: string;
|
|
4
4
|
is_default?: boolean;
|
|
5
5
|
}
|
|
6
|
-
export interface
|
|
6
|
+
export interface UpdateRequest {
|
|
7
7
|
sender_name?: string;
|
|
8
8
|
is_default?: true;
|
|
9
9
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DeferredJobsApiClient } from '../../api';
|
|
2
|
+
import type { Snippet } from '../../types';
|
|
3
|
+
import type { CreateRequest, UpdateRequest } from './types';
|
|
4
|
+
declare type SnippetId = Snippet['uuid'] | Snippet['id'];
|
|
5
|
+
export declare class Client {
|
|
6
|
+
private readonly apiClient;
|
|
7
|
+
constructor(apiClient: DeferredJobsApiClient);
|
|
8
|
+
list(): Promise<Snippet[]>;
|
|
9
|
+
get(snippetId: SnippetId): Promise<Snippet>;
|
|
10
|
+
create(payload: CreateRequest): Promise<Snippet>;
|
|
11
|
+
update(snippetId: SnippetId, payload: UpdateRequest): Promise<Snippet>;
|
|
12
|
+
remove(snippetId: SnippetId): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { routing } from "../../routing.js";
|
|
2
|
+
export class Client {
|
|
3
|
+
constructor(apiClient) {
|
|
4
|
+
this.apiClient = apiClient;
|
|
5
|
+
}
|
|
6
|
+
async list() {
|
|
7
|
+
const url = routing.snippetsUrl;
|
|
8
|
+
const {
|
|
9
|
+
snippets
|
|
10
|
+
} = await this.apiClient.get(url);
|
|
11
|
+
return snippets;
|
|
12
|
+
}
|
|
13
|
+
async get(snippetId) {
|
|
14
|
+
const url = routing.snippetsUrl;
|
|
15
|
+
const {
|
|
16
|
+
snippet
|
|
17
|
+
} = await this.apiClient.get(`${url}/${snippetId}`);
|
|
18
|
+
return snippet;
|
|
19
|
+
}
|
|
20
|
+
async create(payload) {
|
|
21
|
+
const url = routing.snippetsUrl;
|
|
22
|
+
const {
|
|
23
|
+
snippet
|
|
24
|
+
} = await this.apiClient.post(url, {
|
|
25
|
+
payload
|
|
26
|
+
});
|
|
27
|
+
return snippet;
|
|
28
|
+
}
|
|
29
|
+
async update(snippetId, payload) {
|
|
30
|
+
const url = routing.snippetsUrl;
|
|
31
|
+
const {
|
|
32
|
+
snippet
|
|
33
|
+
} = await this.apiClient.patch(`${url}/${snippetId}`, {
|
|
34
|
+
payload
|
|
35
|
+
});
|
|
36
|
+
return snippet;
|
|
37
|
+
}
|
|
38
|
+
async remove(snippetId) {
|
|
39
|
+
const url = routing.snippetsUrl;
|
|
40
|
+
return this.apiClient.delete(`${url}/${snippetId}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { DeferredJobsApiClient } from '../../api';
|
|
2
|
+
import type { ExtendedStory, Story } from '../../types';
|
|
3
|
+
import type { ListOptions, ListResponse, SearchOptions, CreateRequest, UpdateRequest } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* `uuid` is the preferred way of targeting a Story. Numeric `id` is considered deprecated.
|
|
6
|
+
*/
|
|
7
|
+
declare type StoryId = Story['uuid'] | Story['id'];
|
|
8
|
+
export declare class Client {
|
|
9
|
+
private readonly apiClient;
|
|
10
|
+
constructor(apiClient: DeferredJobsApiClient);
|
|
11
|
+
list<Include extends readonly (keyof Story.ExtraFields)[], Options extends ListOptions<Include>, StoryRecord extends Story = Options['include'] extends Include ? Story & Pick<Story.ExtraFields, Options['include'][number]> : Story>(options?: Options): Promise<ListResponse<StoryRecord>>;
|
|
12
|
+
search<Include extends readonly (keyof Story.ExtraFields)[], Options extends ListOptions<Include>, StoryRecord extends Story = Options['include'] extends Include ? Story & Pick<Story.ExtraFields, Options['include'][number]> : Story>(options: SearchOptions<Include>): Promise<ListResponse<StoryRecord>>;
|
|
13
|
+
get(id: StoryId): Promise<ExtendedStory>;
|
|
14
|
+
create(payload: CreateRequest): Promise<ExtendedStory>;
|
|
15
|
+
update(id: StoryId, payload: UpdateRequest): Promise<ExtendedStory>;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { routing } from "../../routing.js";
|
|
2
|
+
export class Client {
|
|
3
|
+
constructor(apiClient) {
|
|
4
|
+
this.apiClient = apiClient;
|
|
5
|
+
}
|
|
6
|
+
async list(options) {
|
|
7
|
+
const {
|
|
8
|
+
limit,
|
|
9
|
+
offset,
|
|
10
|
+
sortOrder,
|
|
11
|
+
include
|
|
12
|
+
} = options ?? {};
|
|
13
|
+
return this.apiClient.get(routing.storiesUrl, {
|
|
14
|
+
query: {
|
|
15
|
+
limit,
|
|
16
|
+
offset,
|
|
17
|
+
sort: sortOrder,
|
|
18
|
+
include: include ? include.join(',') : undefined
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
async search(options) {
|
|
23
|
+
const {
|
|
24
|
+
limit,
|
|
25
|
+
offset,
|
|
26
|
+
sortOrder,
|
|
27
|
+
include,
|
|
28
|
+
query
|
|
29
|
+
} = options ?? {};
|
|
30
|
+
return this.apiClient.post(routing.storiesSearchUrl, {
|
|
31
|
+
payload: {
|
|
32
|
+
query,
|
|
33
|
+
limit,
|
|
34
|
+
offset,
|
|
35
|
+
sort: sortOrder,
|
|
36
|
+
include: include ? include.join(',') : undefined
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
async get(id) {
|
|
41
|
+
const {
|
|
42
|
+
story
|
|
43
|
+
} = await this.apiClient.get(`${routing.storiesUrl}/${id}`);
|
|
44
|
+
return story;
|
|
45
|
+
}
|
|
46
|
+
async create(payload) {
|
|
47
|
+
const {
|
|
48
|
+
story
|
|
49
|
+
} = await this.apiClient.post(routing.storiesUrl, {
|
|
50
|
+
payload
|
|
51
|
+
});
|
|
52
|
+
return story;
|
|
53
|
+
}
|
|
54
|
+
async update(id, payload) {
|
|
55
|
+
const url = `${routing.storiesUrl}/${id}`;
|
|
56
|
+
const {
|
|
57
|
+
story
|
|
58
|
+
} = await this.apiClient.patch(url, {
|
|
59
|
+
payload
|
|
60
|
+
});
|
|
61
|
+
return story;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Category, CultureRef,
|
|
1
|
+
import type { Category, CultureRef, NewsroomRef, Pagination, Query, Story } from '../../types';
|
|
2
2
|
/**
|
|
3
3
|
* Uploadcare image JSON string.
|
|
4
4
|
*/
|
|
@@ -12,25 +12,26 @@ declare type Html = string;
|
|
|
12
12
|
* String containing Prezly Content Format JSON structure.
|
|
13
13
|
*/
|
|
14
14
|
declare type PrezlyContentFormat = string;
|
|
15
|
-
export
|
|
16
|
-
jsonQuery?: string;
|
|
15
|
+
export interface ListOptions<Include extends readonly (keyof Story.ExtraFields)[]> {
|
|
17
16
|
limit?: number;
|
|
18
17
|
offset?: number;
|
|
19
18
|
sortOrder?: string;
|
|
20
19
|
include?: Include;
|
|
21
|
-
}
|
|
22
|
-
export
|
|
23
|
-
|
|
20
|
+
}
|
|
21
|
+
export interface SearchOptions<Include extends readonly (keyof Story.ExtraFields)[]> extends ListOptions<Include> {
|
|
22
|
+
query?: Query;
|
|
23
|
+
}
|
|
24
|
+
export interface ListResponse<S extends Story = Story> {
|
|
24
25
|
stories: S[];
|
|
25
26
|
pagination: Pagination;
|
|
26
27
|
sort: string;
|
|
27
28
|
}
|
|
28
|
-
interface
|
|
29
|
+
interface GenericCreateRequest {
|
|
29
30
|
newsroom?: NewsroomRef['id'];
|
|
30
31
|
title?: string;
|
|
31
32
|
subtitle?: string;
|
|
32
33
|
published_at?: Iso8601DateTime;
|
|
33
|
-
visibility?:
|
|
34
|
+
visibility?: Story.Visibility;
|
|
34
35
|
culture?: CultureRef['code'];
|
|
35
36
|
header_image?: UploadedImage;
|
|
36
37
|
preview_image?: UploadedImage;
|
|
@@ -39,11 +40,11 @@ interface GenericStoryCreateRequest {
|
|
|
39
40
|
categories?: Category['id'][];
|
|
40
41
|
tags?: string[];
|
|
41
42
|
}
|
|
42
|
-
interface
|
|
43
|
+
interface GenericUpdateRequest {
|
|
43
44
|
title?: string;
|
|
44
45
|
subtitle?: string;
|
|
45
46
|
published_at?: Iso8601DateTime;
|
|
46
|
-
visibility?:
|
|
47
|
+
visibility?: Story.Visibility;
|
|
47
48
|
culture?: CultureRef['code'];
|
|
48
49
|
header_image?: UploadedImage;
|
|
49
50
|
preview_image?: UploadedImage;
|
|
@@ -52,11 +53,11 @@ interface GenericStoryUpdateRequest {
|
|
|
52
53
|
categories?: Category['id'][];
|
|
53
54
|
tags?: string[];
|
|
54
55
|
}
|
|
55
|
-
export interface HtmlStoryCreateRequest extends
|
|
56
|
+
export interface HtmlStoryCreateRequest extends GenericCreateRequest {
|
|
56
57
|
/**
|
|
57
58
|
* If format version is omitted, license default editor version will be implied.
|
|
58
59
|
*/
|
|
59
|
-
format_version?:
|
|
60
|
+
format_version?: Story.FormatVersion.HTML;
|
|
60
61
|
intro: Html;
|
|
61
62
|
content: Html;
|
|
62
63
|
/**
|
|
@@ -64,18 +65,18 @@ export interface HtmlStoryCreateRequest extends GenericStoryCreateRequest {
|
|
|
64
65
|
*/
|
|
65
66
|
attached_gallery_content?: string;
|
|
66
67
|
}
|
|
67
|
-
export interface SlateStoryCreateRequest extends
|
|
68
|
+
export interface SlateStoryCreateRequest extends GenericCreateRequest {
|
|
68
69
|
/**
|
|
69
70
|
* If format version is omitted, license default editor version will be implied.
|
|
70
71
|
*/
|
|
71
|
-
format_version?:
|
|
72
|
+
format_version?: Story.FormatVersion.SLATEJS;
|
|
72
73
|
/**
|
|
73
74
|
* Intro field is not supported for Prezly Content Format stories.
|
|
74
75
|
*/
|
|
75
76
|
intro: never;
|
|
76
77
|
content: PrezlyContentFormat;
|
|
77
78
|
}
|
|
78
|
-
export interface HtmlStoryUpdateRequest extends
|
|
79
|
+
export interface HtmlStoryUpdateRequest extends GenericUpdateRequest {
|
|
79
80
|
intro: Html;
|
|
80
81
|
content: Html;
|
|
81
82
|
/**
|
|
@@ -83,13 +84,13 @@ export interface HtmlStoryUpdateRequest extends GenericStoryUpdateRequest {
|
|
|
83
84
|
*/
|
|
84
85
|
attached_gallery_content?: string;
|
|
85
86
|
}
|
|
86
|
-
export interface SlateStoryUpdateRequest extends
|
|
87
|
+
export interface SlateStoryUpdateRequest extends GenericUpdateRequest {
|
|
87
88
|
/**
|
|
88
89
|
* Intro field is not supported for Prezly Content Format stories.
|
|
89
90
|
*/
|
|
90
91
|
intro: never;
|
|
91
92
|
content: PrezlyContentFormat;
|
|
92
93
|
}
|
|
93
|
-
export declare type
|
|
94
|
-
export declare type
|
|
94
|
+
export declare type CreateRequest = HtmlStoryCreateRequest | SlateStoryCreateRequest;
|
|
95
|
+
export declare type UpdateRequest = HtmlStoryUpdateRequest | SlateStoryUpdateRequest;
|
|
95
96
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { SubscribeRequest, UnsubscribeRequest, UpdateUnsubscribeDetailsRequest } from './types';
|
|
1
|
+
import type { DeferredJobsApiClient } from '../../api';
|
|
2
|
+
import type { Contact, EmailSubscription, Newsroom } from '../../types';
|
|
3
|
+
import type { SubscribeRequest, UnsubscribeRequest, UpdateUnsubscribeDetailsRequest } from './types';
|
|
4
4
|
declare type NewsroomId = Newsroom['uuid'] | Newsroom['id'];
|
|
5
|
-
export
|
|
5
|
+
export declare class Client {
|
|
6
6
|
private readonly apiClient;
|
|
7
|
-
constructor(
|
|
8
|
-
|
|
9
|
-
});
|
|
10
|
-
subscribeToNewsroom<Type extends ContactType>(newsroomId: NewsroomId, payload: SubscribeRequest<Type>): Promise<EmailSubscription>;
|
|
7
|
+
constructor(apiClient: DeferredJobsApiClient);
|
|
8
|
+
subscribeToNewsroom<Type extends Contact.Type>(newsroomId: NewsroomId, payload: SubscribeRequest<Type>): Promise<EmailSubscription>;
|
|
11
9
|
unsubscribeFromNewsroom(newsroomId: NewsroomId, payload: UnsubscribeRequest): Promise<EmailSubscription>;
|
|
12
10
|
updateNewsroomUnsubscribeDetails(newsroomId: NewsroomId, subscriptionId: EmailSubscription['id'], payload: UpdateUnsubscribeDetailsRequest): Promise<EmailSubscription>;
|
|
13
11
|
unsubscribeFromLicense(payload: UnsubscribeRequest): Promise<EmailSubscription>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { routing } from "../../routing.js";
|
|
2
|
+
export class Client {
|
|
3
|
+
constructor(apiClient) {
|
|
4
|
+
this.apiClient = apiClient;
|
|
5
|
+
}
|
|
6
|
+
async subscribeToNewsroom(newsroomId, payload) {
|
|
7
|
+
const url = routing.newsroomSubscribeUrl.replace(':newsroom_id', String(newsroomId));
|
|
8
|
+
const {
|
|
9
|
+
subscription
|
|
10
|
+
} = await this.apiClient.post(url, {
|
|
11
|
+
payload
|
|
12
|
+
});
|
|
13
|
+
return subscription;
|
|
14
|
+
}
|
|
15
|
+
async unsubscribeFromNewsroom(newsroomId, payload) {
|
|
16
|
+
const url = routing.newsroomUnsubscribeUrl.replace(':newsroom_id', String(newsroomId));
|
|
17
|
+
const {
|
|
18
|
+
subscription
|
|
19
|
+
} = await this.apiClient.post(url, {
|
|
20
|
+
payload
|
|
21
|
+
});
|
|
22
|
+
return subscription;
|
|
23
|
+
}
|
|
24
|
+
async updateNewsroomUnsubscribeDetails(newsroomId, subscriptionId, payload) {
|
|
25
|
+
const url = routing.newsroomUnsubscribeUrl.replace(':newsroom_id', String(newsroomId));
|
|
26
|
+
const {
|
|
27
|
+
subscription
|
|
28
|
+
} = await this.apiClient.patch(`${url}/${subscriptionId}`, {
|
|
29
|
+
payload
|
|
30
|
+
});
|
|
31
|
+
return subscription;
|
|
32
|
+
}
|
|
33
|
+
async unsubscribeFromLicense(payload) {
|
|
34
|
+
const url = routing.licenseUnsubscribeUrl;
|
|
35
|
+
const {
|
|
36
|
+
subscription
|
|
37
|
+
} = await this.apiClient.post(url, {
|
|
38
|
+
payload
|
|
39
|
+
});
|
|
40
|
+
return subscription;
|
|
41
|
+
}
|
|
42
|
+
async updateLicenseUnsubscribeDetails(subscriptionId, payload) {
|
|
43
|
+
const url = routing.licenseUnsubscribeUrl;
|
|
44
|
+
const {
|
|
45
|
+
subscription
|
|
46
|
+
} = await this.apiClient.patch(`${url}/${subscriptionId}`, {
|
|
47
|
+
payload
|
|
48
|
+
});
|
|
49
|
+
return subscription;
|
|
50
|
+
}
|
|
51
|
+
}
|